Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: {Unused} Cache
    • Labels:
      None
    • Environment:
      Windows and Linux, Tomcat 5.5.23 and Tomcat 6.0.16.
    • keywords:
      oscache cluster patch
    • Similar issues:

      Description

      I know you guys are working on some new clustering solutions, but for the time being here is a patch to fix the existing one.

      Steps to follow:

      1. JGroups needs concurrent.jar. Get the sources (http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html) build it and add it to your local repository.
      2. Add concurrent.jar to your pom.xml:
      <dependency>
      <groupId>concurrent</groupId>
      <artifactId>concurrent</artifactId>
      <version>1.3.4</version>
      </dependency>
      3.In WEB-INF/oscache.properties:
      cache.event.listeners=com.xpn.xwiki.cache.impl.SharedJavaGroupsBroadcastingListener

      I removed com.xpn.xwiki.cache.impl.XWikiCacheListener from the original oscache.properies, that class had a faulty logic and didn't do anything usefull.

      About the patch.
      Changes in src/main/java/com/xpn/xwiki/cache/impl/OSCacheService.java:
      There are a few caches created here, we are interested to cluster only the "xwiki.store.pagecache"
      The name of the cache has to be propagated to the listeners, the only way to do this is to add it as a property when a new OSCacheCache object is created.
      In the initCache() method the names of the caches are all reset to "Cache # " + cacheCount , not sure why, so I removed this logic.

      Changes in src/main/java/com/xpn/xwiki/cache/impl/SharedJavaGroupsBroadcastingListener.java:
      The map of caches is replaced with a single cache object.
      We are interesed only in events coming from the cache called "xwiki.store.pagecache"

      Known Issues:
      If you shut down a server node by just killing the java process, the cache will not shutdown cleanly, so when you restart the server the application will hang.
      I observed this when using xwiki on Tomcat 6.0.16.
      To solve this, always use the shutdown script, or you will have to restart all the nodes in the cluster.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vmassol Vincent Massol
                Reporter:
                otabay Oliver Tabay
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: