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

File cache store ignores maxEntries property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • 6.0.0.Final
    • 6.0.0.Beta1
    • Server
    • None

    Description

      The following test fails if the new file cache store is configured with maxEntries property:

      @Test
          public void testMaxEntriesAndLocationParametersDuringRestart() throws Exception {
              controller.start(CONTAINER);
              RemoteCacheManager rcm = new RemoteCacheManager(new ConfigurationBuilder().addServer()
                                                                    .host(server.getHotrodEndpoint().getInetAddress().getHostName())
                                                                    .port(server.getHotrodEndpoint().getPort())
                                                                    .build());
              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"));
              //assert the existence of a single file in the filesystem
              File f = new File(singleFCSPath, "default.dat");
              assertTrue(f.exists());
              //assert that SingleFileCacheStore was registered
              MBeanServerConnectionProvider provider = new MBeanServerConnectionProvider(server.getHotrodEndpoint().getInetAddress().getHostName(), MANAGEMENT_PORT);
              assertEquals("[org.infinispan.persistence.file.SingleFileStore]", getAttribute(provider, CACHE_LOADER_MBEAN, "stores"));
              controller.kill(CONTAINER);
              controller.start(CONTAINER);
              assertEquals("v2", rc.get("k2"));
              assertEquals("v3", rc.get("k3"));
              assertNull(rc.get("k1")); //maxEntries was 2, this entry should be lost as the oldest entries are removed
      //^^^^fails here, the entry is still there
              controller.stop(CONTAINER);
          }
      

      Cache 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"/>
                          <file-store
                                  passivation="false"
                                  preload="false"
                                  purge="false"
                                  relative-to="temp"
                                  path="single-file-cache-store"
                                  >
                              <property name="maxEntries">2</property>
                          </file-store>
                      </local-cache>
                  </cache-container>
              </subsystem>
      

      The complete test is here: https://code.engineering.redhat.com/gerrit/gitweb?p=jdg-functional-tests.git;a=tree;f=remote/file-cache-store;h=0168fb920ff63de768bdc0ba7012fe1cd5d09409;hb=HEAD

      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: