Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1747

Default configuration for Infinispan used in workspace caches doesn't work well with Infinispan 5.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 3.1.0.Final
    • 3.0.1.Final
    • Configuration
    • None
    • Workaround Exists
    • Hide

      Use a repository-specific cache configuration for the workspace cache, via the workspaces.cacheConfiguration property in the repository-specific JSON configuration file to reference an Infinispan configuration such as:

      <?xml version="1.0" encoding="UTF-8"?>
      <infinispan
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
              xmlns="urn:infinispan:config:5.1">
      
          <global>
              <globalJmxStatistics jmsDomain="workspaceCachesForMyRepository"/>
          </global>
          
          <!--
            Define the configuration for each workspace cache. This configuration will be used if there is no "namedCache"
            definition for the workspace name. Note that the names of caches following the convention 
            "{repositoryName}/{workspaceName}".
          -->
          <default>
      
              <!-- Local in-memory caches with no persistence. -->
              <clustering mode="LOCAL"/>
      
              <!-- No more that 10K entries per cache, with LIRS eviction. -->
              <eviction maxEntries="10000" strategy="LIRS"/>
      
              <!-- Expire entries after 120 seconds or after 60 seconds of not being used (whichever comes first). -->
              <expiration lifespan="120000" maxIdle="60000"/>  
                
          </default>
          
      </infinispan>
      

      and choose an appropriate and unique value for the "jmxDomain" attribute.

      Show
      Use a repository-specific cache configuration for the workspace cache, via the workspaces.cacheConfiguration property in the repository-specific JSON configuration file to reference an Infinispan configuration such as: <?xml version= "1.0" encoding= "UTF-8" ?> <infinispan xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd" xmlns= "urn:infinispan:config:5.1" > <global> <globalJmxStatistics jmsDomain= "workspaceCachesForMyRepository" /> </global> <!-- Define the configuration for each workspace cache. This configuration will be used if there is no "namedCache" definition for the workspace name. Note that the names of caches following the convention "{repositoryName}/{workspaceName}" . --> <default> <!-- Local in-memory caches with no persistence. --> <clustering mode= "LOCAL" /> <!-- No more that 10K entries per cache, with LIRS eviction. --> <eviction maxEntries= "10000" strategy= "LIRS" /> <!-- Expire entries after 120 seconds or after 60 seconds of not being used (whichever comes first). --> <expiration lifespan= "120000" maxIdle= "60000" /> </default> </infinispan> and choose an appropriate and unique value for the " jmxDomain " attribute.

      Although ModeShape 3.1 is built to run with Infinispan 5.1.2.FINAL, it is possible to run with later versions of Infinispan, including 5.1.8.Final and even 5.2 (the latest we tested was 5.2.0.Beta6).

      However, Infinispan 5.2.x will now report an error if multiple cache containers are started within the same process. Each ModeShape repository uses one cache container for the repository content, but this container is specified in the repository's JSON configuration file and can easily be changed to include the following fragment in the XML:

      <infinispan ...>
          <global>
              <globalJmxStatistics jmsDomain="myRepository"/>
              <!-- etc. -->
          </global>
          <!-- etc. -->
      </infinispan>
      

      where "myRepository" matches the name of the ModeShape repository.

      However, each ModeShape repository also internally uses another cache container for caches of the node objects. This cache container is configured with by the "org.modeshape.jcr.default_workspace_cache-config.xml" file (on the classpath), though a different file can be specified in the repository's JSON configuration file via the "workspaces.cacheContainer" field.

      When running with Infinispan 5.2, however, using the built-in "org.modeshape.jcr.default_workspace_cache-config.xml" file results in an exception that prevents the repository from starting.

      See the Infinispan documentation for more detail.

              rhauch Randall Hauch (Inactive)
              rhauch Randall Hauch (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: