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

RemoteCache.getWithMetadata returns expired metadata when server is transactional cache

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 9.2.4.Final, 9.3.1.Final, 9.4.0.Final
    • Hot Rod, Server
    • None

    Description

      I have transactional cache defined on server side (infinispan-server). I have HotRod client application (RemoteCache), which is connected to server above and which calls this:

      remoteCache.put("key", "value", 1000, TimeUnit.SECONDS, 100, TimeUnit.SECONDS);        
      MetadataValue loaded = remoteCache.getWithMetadata("key");
      System.out.println("created: " + loaded.getCreated() + ", lastUsed: " + loaded.getLastUsed());
      

      The output is:

      created: 0, lastUsed: 0
      

      This is not correct and causes some issues as entries are treated as expired. Especially when used together with remote-store, which is not able to load such entries, as PersistenceUtil#loadAndCheckExpiration method always treat the item loaded from RemoteCache as expired. See the attached application for more details.

      STEPS TO REPRODUCE:

      1) Use infinispan-server-9.2.4.Final on server side and HotRod client (RemoteCache) version 9.2.4.Final on client side (maven dependency org.infinispan:infinispan-client-hotrod:9.2.4.Final for client app)

      2) Unzip server 9.2.4.Final to some directory

      3) Change ISPN_SERVER_HOME/standalone/configuration/clustered.xml and just add this transactional cache to the cache-container (NOTE: configuration "transactional" is already defined in the clustered.xml file):

      <distributed-cache name="trans" configuration="transactional" />
      

      4) Run server with:

      ./standalone.sh -c clustered.xml
      

      5) Run the client application from attachement. You can see the output as described above and also that entry is considered as expired (Example app uses same algorithm like RemoteStore together with PersistenceUtil.loadAndCheckExpired ). Original sources here: https://github.com/mposolda/misc/blob/master/ispn-client-listener/src/main/java/org/mposolda/expiration/RemoteCacheExpirationTest.java

      Attachments

        Activity

          Public project attachment banner

            context keys: [headless, issue, helper, isAsynchronousRequest, project, action, user]
            current Project key: ISPN

            People

              wburns@redhat.com Will Burns
              mposolda@redhat.com Marek Posolda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: