2 Replies Latest reply on Apr 5, 2016 1:59 PM by Diego del Río

    Partition handling in invalidation mode caches

    Diego del Río Newbie

      Hi everybody. We are using Infinispan 7.2.5.Final as a L2 cache implementation for Hibernate 4.3.11.Final. All the caches are configured with invalidation/synchronous mode as the default configuration in Hibernate for Infinispan suggests. The cluster has 10+ nodes and we need consistency over availability (in terms of the CAP theorem). We've been doing some tests to see what happens with consistency in case of network partitions and figured out that partition handling is not active in invalidation cache mode.

      During startup, Infinispan creates PartitionManagerHandler's but only for distributed or replicated caches.

       

      @DefaultFactoryFor(classes = PartitionHandlingManager.class)
      public class PartitionHandlingManagerFactory extends AbstractNamedCacheComponentFactory implements
            AutoInstantiableFactory {
         @Override
         @SuppressWarnings("unchecked")
         public <T> T construct(Class<T> componentType) {
            if (configuration.clustering().partitionHandling().enabled()) {
               if (configuration.clustering().cacheMode().isDistributed() ||
                     configuration.clustering().cacheMode().isReplicated()) {
                  return (T) new PartitionHandlingManagerImpl();
               }
            }
            return null;
         }
      }
      

       

      In this scenario, after a network partition, all cluster partitions remain active, i.e, no partition enters degraded mode. This can leave us with two or more cluster partitions having inconsistent data until the partitions merge back, because an entry could be modified in one partition and remain outdated in the others.

      Can someone tell why partition handling isn't supported for invalidation cache mode?

      Thanks in advance