Bug 799236

Summary: JDG is forced to use L1 caching for distributed mode
Product: [JBoss] JBoss Data Grid 6 Reporter: Martin Gencur <mgencur>
Component: unspecifiedAssignee: Tristan Tarrant <ttarrant>
Status: VERIFIED --- QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: jdg-bugs
Target Milestone: ---   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Gencur 2012-03-02 08:20:03 UTC
Description of problem:

When users don't want to use L1 caching, they have to set l1-lifespan to 0:
<distributed-cache 
    name="default" 
    start="EAGER"
    ...
    l1-lifespan="0" 
    ...

However, this settings causes an exception to be thrown in ER2:

08:46:12,959 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 24) JBAS014612: Operation ("add") failed - address: ([
    ("subsystem" => "infinispan"),
    ("cache-container" => "default"),
    ("distributed-cache" => "default")
]): org.infinispan.config.ConfigurationException: Can only move entries to L1 on rehash when L1 is enabled
	at org.infinispan.configuration.cache.L1ConfigurationBuilder.validate(L1ConfigurationBuilder.java:116)
	at org.infinispan.configuration.cache.ClusteringConfigurationBuilder.validate(ClusteringConfigurationBuilder.java:90)
	at org.infinispan.configuration.cache.ConfigurationBuilder.validate(ConfigurationBuilder.java:132)
	at org.infinispan.configuration.cache.ConfigurationBuilder.build(ConfigurationBuilder.java:140)
	at org.jboss.as.clustering.infinispan.subsystem.CacheAdd.performRuntime(CacheAdd.java:193)
	at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:50) [jboss-as-controller-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:387) [jboss-as-controller-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
	at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:274) [jboss-as-controller-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
	at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:202) [jboss-as-controller-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
	at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:311) [jboss-as-controller-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21]
	at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA-redhat-1.jar:2.0.0.GA-redhat-1]


This can be fixed in ISPN subsystem of AS7 by adding .disableOnRehash() at https://github.com/jbossas/jboss-as/blob/master/clustering/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/DistributedCacheAdd.java#L68

Nevertheless, I'm for a change in Infinispan itself. One would suppose that when they set .l1().disable(), the l1 caching will be really disabled. Users are, though, forced to set it like this: .l1().disable().disableOnRehash(). Otherwise they get the exception above.  

We should create a JIRA based on the decision where the fix should be - either in ISPN or AS7.

Comment 1 Martin Gencur 2012-03-02 08:22:52 UTC
When I set l1-lifespan to anything higher than 0, it works. But then the L1 caching is enabled.

Comment 2 Martin Gencur 2012-03-16 08:51:52 UTC
Verified with ER4.