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

Replacing entry via Memcached does not increment version of original HotRod entry

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 5.3.0.Final
    • None
    • None

      When an entry is stored via HotRod and later replaced by Memcached (or Embedded, it does not matter), the version of the entry does not change. This makes operations like replaceWithVersion of HotRod client unreliable in compatibility mode.

      public void testHotRodPutMemcachedReplaceHotRodGetVersionedTest() throws Exception {
            final String key1 = "6";
      
            // 1. Put with Hot Rod
            RemoteCache<String, Object> remote = cacheFactory.getHotRodCache();
            assertEquals(null, remote.withFlags(Flag.FORCE_RETURN_VALUE).put(key1, "v1"));
            VersionedValue oldValue = remote.getVersioned(key1);
      
            // 2. Replace with Memcached
            Future<Boolean> f = cacheFactory.getMemcachedClient().set(key1, 0, "v2");
            assertTrue(f.get(60, TimeUnit.SECONDS));
      
            // 3. Get with HotRod
            assertEquals("v2", remote.getVersioned(key1).getValue());
            assertTrue("The entry version should have changed", oldValue.getVersion() != remote.getVersioned(key1).getVersion());
            //^^^ fails here
         }
      

              rh-ee-galder Galder ZamarreƱo
              mgencur Martin Gencur (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: