Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4351

Clarify the behaviour of putForExternalRead in clustered caches

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 6.0.2.Final
    • Core, Documentation
    • None
    • Documentation (Ref Guide, User Guide, etc.)

      The putForExternal documentation says

      putForExternalRead is consider to be a fast operation because regardless of whether it’s successful or not, it doesn’t wait for any locks, and so returns to the caller promptly.

      But the documentation doesn't say how putForExternalRead should behave in a clustered cache. Currently, the command is replicated to all the owners in distributed mode, and to all the cluster members in replicated mode. So the command may be delayed while waiting for the responses from those other nodes. The exception is invalidation mode, which doesn't replicate putForExternalRead commands - only regular {{put}}s generate invalidations.

      The documentation also doesn't mention the interaction of putForExternalRead operations with transactions. Currently, PUT_FOR_EXTERNAL_READ-flagged commands are executed as non-transactional commands even when the cache is transactional, presumably to avoid the overhead of transactions. But this undermines the argument for wrapping regular write operations in an implicit transaction, when running in a transactional cache.

      I propose changing putForExternalRead to only write on the local node (as it already does in invalidation mode), and documenting it as such. In distribution mode, it should be a no-op when the local node is not an owner.

            Unassigned Unassigned
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: