[infinispan-issues] [JBoss JIRA] (ISPN-3164) Replacing entry via Memcached does not increment version of original HotRod entry
Martin Gencur (JIRA)
jira-events at lists.jboss.org
Fri May 31 07:45:55 EDT 2013
[ https://issues.jboss.org/browse/ISPN-3164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778424#comment-12778424 ]
Martin Gencur commented on ISPN-3164:
-------------------------------------
As you might expect, replacing the entry via REST results in NPE on the last HotRod client's call:
{code}
org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for message id[5] returned server error (status=0x85): java.lang.NullPointerException
at org.infinispan.client.hotrod.impl.protocol.Codec10.checkForErrorsInResponseStatus(Codec10.java:162)
at org.infinispan.client.hotrod.impl.protocol.Codec10.readHeader(Codec10.java:118)
at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:78)
at org.infinispan.client.hotrod.impl.operations.AbstractKeyOperation.sendKeyOperation(AbstractKeyOperation.java:74)
at org.infinispan.client.hotrod.impl.operations.GetWithVersionOperation.executeOperation(GetWithVersionOperation.java:58)
at org.infinispan.client.hotrod.impl.operations.GetWithVersionOperation.executeOperation(GetWithVersionOperation.java:45)
at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:68)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.getVersioned(RemoteCacheImpl.java:159)
at org.infinispan.it.compatibility.EmbeddedRestMemcachedHotRodTest.testHotRodPutMemcachedReplaceHotRodGetVersionedTest(EmbeddedRestMemcachedHotRodTest.java:204)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
{code}
This is perhaps for a separate JIRA? If we don't fix it, we should at least document that this does not work. But in order to have fully compatible endpoints, it would be nice to fix this.
> Replacing entry via Memcached does not increment version of original HotRod entry
> ---------------------------------------------------------------------------------
>
> Key: ISPN-3164
> URL: https://issues.jboss.org/browse/ISPN-3164
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 5.3.0.CR1
> Reporter: Martin Gencur
> Assignee: Galder ZamarreƱo
> Fix For: 5.3.0.Final
>
>
> 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.
> {code:java}
> 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
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list