2 Replies Latest reply on Jul 15, 2016 4:11 AM by Marek Posolda

    OutdatedTopologyException in clustered invalidation cache because StateTransferInterceptor not in the chain

    Marek Posolda Expert

      I have the following setup:

      - 2 nodes in cluster with mode INVALIDATION_SYNC. No-transaction cache.

      - Node1 is starting

      - Called "cache.remove" on some key on node1. At the same time, node2 is starting, which is causing  topology change.

      - The "cache.remove" call on node1 is throwing OutdatedTopologyException.

       

      I found the cause is that StateTransferInterceptor is not added in InterceptorChain during INVALIDATION mode. It's just available during REPLICATION or DISTRIBUTED modes - infinispan/InterceptorChainFactory.java at master · infinispan/infinispan · GitHub .

       

      Indeed when I manually added StateTransferInterceptor to my invalidation cache:

       

      invalidationConfigBuilder.customInterceptors()
          .addInterceptor()
          .before(NonTransactionalLockingInterceptor.class)
          .interceptorClass(StateTransferInterceptor.class);

       

      I can see that issue is gone as OutdatedTopologyException is catched and command is retried with new topology

       

      My question is:

      - Is it any reason why StateTransferInterceptor is not added to invalidation cache? Any side effect of adding it?

      - Should I create JIRA for adding interceptor to invalidation cache too?

       

      I am attaching the Java unit test for reproducing issue. On my laptop when I run it, I can almost always simulate the issue.

       

      Thanks,

      Marek