Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3348

Unable to read entries from SingleFileCacheStore after server restart

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Critical
    • 6.0.0.Beta2
    • 6.0.0.Alpha1
    • Server

    Description

      Using the following configuration:

      <subsystem xmlns="urn:infinispan:server:core:5.3" default-cache-container="default">
                  <cache-container name="default" default-cache="default" listener-executor="infinispan-listener" eviction-executor="infinispan-eviction" replication-queue-executor="infinispan-repl-queue">
                      <local-cache name="default" start="EAGER">
                          <locking isolation="NONE" acquire-timeout="30000" concurrency-level="1000" striping="false"/>
                          <transaction mode="NONE"/>
                          <store class="org.infinispan.loaders.file.SingleFileCacheStore" passivation="false" preload="false" purge="false">
                              <property name="location">${java.io.tmpdir}/single-file-cache-store</property>
                              <property name="maxEntries">2</property>
                          </store>
                      </local-cache>
                  </cache-container>
              </subsystem>
      

      ...it is not possible to retrieve the cache entry from the cache store after server restart, as demonstrated by the following test:

      RemoteCache<String, String> rc = rcm.getCache();
              rc.clear();
              assertNull(rc.get("k1"));
              rc.put("k1", "v1");
              rc.put("k2", "v2");
              rc.put("k3", "v3");
              assertEquals("v1", rc.get("k1"));
              assertEquals("v2", rc.get("k2"));
              assertEquals("v3", rc.get("k3"));
              controller.kill(CONTAINER);
              controller.start(CONTAINER);
              assertEquals("v2", rc.get("k2"));
      //^^^fails here - unable to find k2
      
              assertEquals("v3", rc.get("k3"));
              assertNull(rc.get("k1")); //maxEntries was 2, this entry should be lost as the oldest entries are removed
              controller.stop(CONTAINER);
      

      Note that preload is set to false for this test. When I set it to true, the test passes.

      I tried to modify BaseCacheStoreFunctionalTest#testPreloadAndExpiry, disable "preload" and retrieve the cache entries after server restart by calling cache.get() (not from DataContainer) and the test passed (I ran SingleFileCacheStoreFunctionalTest which extends BaseCacheStoreFunctionalTest). So it seems the bug is related to the server distribution.

      Attachments

        Activity

          People

            mircea.markus Mircea Markus (Inactive)
            mgencur Martin Gencur
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: