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

State transfer should not force all invocations to be synchronous

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 4.1.0.Final, 4.2.0.CR4
    • Fix Version/s: None
    • Component/s: Core, State Transfer
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Workaround #1:

      Disable state transfer - and use a ClusteredCacheLoader to lazily lookup remote state as and when needed. It might require some code changes to make the code efficient, for example:
      If put() method's return value is not needed, pass Flag.SKIP_CACHE_LOAD so that clustered cache loader is not queried for previous value.

      Workaround #2:

      Enable state transfer and REPL_SYNC. Use the Async API (e.g., cache.putAsync(k, v)) to actieve 'fire-and-forget' capabilities.

      Workaround #3:

      Enable state transfer and REPL_ASYNC. All RPCs end up becoming sync, but client threads will not be held up if you enable a replication queue (which is recommended for async mode anyway).

      Show
      Workaround #1: Disable state transfer - and use a ClusteredCacheLoader to lazily lookup remote state as and when needed. It might require some code changes to make the code efficient, for example: If put() method's return value is not needed, pass Flag.SKIP_CACHE_LOAD so that clustered cache loader is not queried for previous value. Workaround #2: Enable state transfer and REPL_SYNC. Use the Async API (e.g., cache.putAsync(k, v)) to actieve 'fire-and-forget' capabilities. Workaround #3: Enable state transfer and REPL_ASYNC. All RPCs end up becoming sync, but client threads will not be held up if you enable a replication queue (which is recommended for async mode anyway).
    • Estimated Difficulty:
      High

      Description

      Enabling state transfer is forcing even asynchronous caches to become synchronous.

      A better way is needed to make sure state transfer works correctly (sync calls needed here) while normal replication calls remain asynchronous.

      See https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/remoting/transport/jgroups/CommandAwareRpcDispatcher.java#L254 where the response mode is overridden based on whether replay is supported. And replay support is always on when state transfer is enabled:

      https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/remoting/rpc/RpcManagerImpl.java#L101

      Need to explore whether a joiner flag can be maintained based on a view change, and replay only supported when a joiner is still "joining", and not otherwise.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  manik Manik Surtani
                  Reporter:
                  galder.zamarreno Galder Zamarreño
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: