4 Replies Latest reply on Nov 16, 2018 5:23 AM by bvnghiem1012

    configure infinispan state-transfer for replicated cache

    thomash

      Why is it no longer possible to disable/enable initial-state-transfer for a replicated (infinispan) cache in wildfly?

      The "enabled" attribute was removed between jboss-as-infinispan_3.0.xsd and jboss-as-infinispan_4.0.xsd

      What is the reason for that?

      If anything was changed to the scheme, I would have expected the addition of the await-initial-transfer attribute, which is supported by infinispan 8.2 (which is shipped with wildfly).

      Instead of that, an existing attribute was decommissioned.

        • 1. Re: configure infinispan state-transfer for replicated cache
          pferraro

          The goal was to replace the single flag with an enumeration of 3 valid states, but this was never completed.  I've opened https://issues.jboss.org/browse/WFLY-9648 to track this.

          • 2. Re: configure infinispan state-transfer for replicated cache
            thomash

            Great! Thanks.

            Is there any way I can configure this setting anyway? Can I change the xsd to add that attribute?

            Or is is not supported at all by the wildfly-infinispan integration.

            I tried adding <state-transfer enabled="false"/> using the 3.0 xsd scheme: In that case there is no xml-validation exception, but I see this in the logs:

            Jan:05,09:20:31,138 WARN  (:Controller Boot Thread:) [org.jboss.as.clustering.infinispan] WFLYCLINF0004: The 'enabled' attribute of the 'state-transfer' element is no longer supported and will be ignored
            
            
            • 3. Re: configure infinispan state-transfer for replicated cache
              pferraro

              The only workaround is to configure this programmatically. e.g.

               

              @Resource(lookup="java:jboss/infinispan/container/mycontainer")
              private EmbeddedCacheManager manager;
              @Resource(lookup="java:jboss/infinispan/configuration/mycontainer/mycache")
              private Configuration config;
              private Cache cache;
              
              @PostConstruct
              public void init() {
                  Configuration newConfig = new ConfigurationBuilder().read(this.config).stateTransfer().enabled(false).build();
                  this.manager.defineConfiguration("new-cache", newConfig);
                  this.cache = this.manager.getCache("new-cache");
              }
              
              @PreDestroy
              public void destroy() {
                  this.manager.undefineConfiguration("new-cache");
              }
              • 4. Re: configure infinispan state-transfer for replicated cache
                bvnghiem1012

                Hi Paul,

                 

                I have a cluster with 5 nodes on WildFly13 using standalone-full-ha.xml profile.

                When I did a whole cluster restart, 3 of 5 servers running well but 2 of them failed to startup. The error log says state-transfer of "entity" cache was failure as below.

                2018-11-16 13:37:25,859 ERROR [ServerService Thread Pool -- 6]-[org.jboss.msc.service.fail] MSC000001: Failed to start service org.wildfly.clustering.infinispan.cache.hibernate.entity: org.jboss.msc.service.StartException in service org.wildfly.clustering.infinispan.cache.hibernate.entity: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.start() throws java.lang.Exception on object of type StateTransferManagerImpl

                         at org.wildfly.clustering.service.FunctionalValueService.start(FunctionalValueService.java:70)

                         at org.wildfly.clustering.service.AsynchronousServiceBuilder.lambda$start$0(AsynchronousServiceBuilder.java:99)

                         at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

                         at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)

                         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)

                         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1349)

                         at java.lang.Thread.run(Thread.java:748)

                         at org.jboss.threads.JBossThread.run(JBossThread.java:485)

                Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.start() throws java.lang.Exception on object of type StateTransferManagerImpl

                at org.infinispan.commons.util.SecurityActions.lambda$invokeAccessibly$0(SecurityActions.java:83)

                         at org.infinispan.commons.util.SecurityActions.doPrivileged(SecurityActions.java:71)

                         at org.infinispan.commons.util.SecurityActions.invokeAccessibly(SecurityActions.java:76)

                         at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:185)

                         at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:968)

                         at org.infinispan.factories.AbstractComponentRegistry.lambda$invokePrioritizedMethods$6(AbstractComponentRegistry.java:703)

                         at org.infinispan.factories.SecurityActions.lambda$run$1(SecurityActions.java:72)

                         at org.infinispan.security.Security.doPrivileged(Security.java:44)

                         at org.infinispan.factories.SecurityActions.run(SecurityActions.java:71)

                         at org.infinispan.factories.AbstractComponentRegistry.invokePrioritizedMethods(AbstractComponentRegistry.java:696)

                         at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:689)

                         at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:607)

                         at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:244)

                         at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:1051)

                         at org.infinispan.cache.impl.AbstractDelegatingCache.start(AbstractDelegatingCache.java:421)

                         at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:644)

                         at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:589)

                         at org.infinispan.manager.DefaultCacheManager.internalGetCache(DefaultCacheManager.java:475)

                         at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:461)

                         at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:447)

                         at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:86)

                         at org.wildfly.clustering.infinispan.spi.service.CacheBuilder.get(CacheBuilder.java:71)

                         at org.wildfly.clustering.infinispan.spi.service.CacheBuilder.get(CacheBuilder.java:54)

                         at org.wildfly.clustering.service.SuppliedValueService.lambda$new$0(SuppliedValueService.java:42)

                         at org.wildfly.clustering.service.FunctionalValueService.start(FunctionalValueService.java:68)

                         ... 7 more

                 

                 

                The "entiy" cache configuration is not changed. It is invalidation-cache.

                 

                Now, I want to disable state-transfer for it as well but there is no option to do because the state-transfer element is not allowed under invalidation-cache.

                Do you have any idea on make state-transfer is configurable for invalidation-cache as same as we do for replicated-cache and distributed-cache?