]
Tristan Tarrant updated ISPN-3182:
----------------------------------
Status: Pull Request Sent (was: Pull Request Sent)
Git Pull Request:
Compatibility mode does not work correctly in ISPN server
---------------------------------------------------------
Key: ISPN-3182
URL:
https://issues.jboss.org/browse/ISPN-3182
Project: Infinispan
Issue Type: Bug
Components: Server
Reporter: Martin Gencur
Assignee: Tristan Tarrant
Priority: Critical
Fix For: 5.3.0.Final
ISPN version: f6d1761 - Galder ZamarreƱo, ISPN-3062 Push JCache TCK output to screen
Using <compatibility enabled="true"> , storing an antry via HotRod, and
reading it again via HotRod fails -> null is returned.
If the compatibility mode is disabled, the HotRod's get() operation returns the
correct value.
The following code snippet illustrates the bug:
{code:java}
@Test
public void testHotRodPutRestGetTest() throws Exception {
final String key = "1";
// 1. Put with Hot Rod
RemoteCache<String, byte[]> remote = getHotRodCache();
assertEquals(null, remote.withFlags(Flag.FORCE_RETURN_VALUE).put(key,
"v1".getBytes()));
assertArrayEquals("v1".getBytes(), remote.get(key));
//^^^^ --------- fails here
// 2. Get with REST
HttpMethod get = new GetMethod(getRestUrl() + "/" + key);
getRestClient().executeMethod(get);
assertEquals(HttpServletResponse.SC_OK, get.getStatusCode());
assertEquals("v1".getBytes(), get.getResponseBody());
}
{code}
The tests along with the example configuration file can be found at
https://github.com/mgencur/infinispan-server/tree/ISPN-3176/compatibility...
The relevant part of TRACE log is here:
{code}
14:54:57,066 TRACE [org.infinispan.util.concurrent.locks.LockManagerImpl]
(HotRodServerWorker-3) Successfully acquired lock 1!
14:54:57,066 TRACE [org.infinispan.interceptors.EntryWrappingInterceptor]
(HotRodServerWorker-3) Wrapping entry '1'? true
14:54:57,066 TRACE [org.infinispan.container.EntryFactoryImpl] (HotRodServerWorker-3)
Exists in context? null
14:54:57,067 TRACE [org.infinispan.container.EntryFactoryImpl] (HotRodServerWorker-3)
Retrieved from container null
14:54:57,067 TRACE [org.infinispan.container.EntryFactoryImpl] (HotRodServerWorker-3)
Creating new entry.
14:54:57,069 TRACE [org.infinispan.interceptors.CallInterceptor] (HotRodServerWorker-3)
Executing command: PutKeyValueCommand{key=1, value=v1, flags=[OPERATION_HOTROD],
putIfAbsent=false, metadata=EmbeddedMetadata{version=ServerEntryVersion(1)},
successful=true}.
14:54:57,070 TRACE [org.infinispan.interceptors.EntryWrappingInterceptor]
(HotRodServerWorker-3) About to commit entry ReadCommittedEntry(74161820){key=1, value=v1,
oldValue=null, isCreated=true, isChanged=true, isRemoved=false, isValid=true}
14:54:57,071 TRACE [org.infinispan.container.entries.ReadCommittedEntry]
(HotRodServerWorker-3) Updating entry (key=1 removed=false valid=true changed=true
created=true loaded=false value=v1]
14:54:57,071 TRACE [org.infinispan.interceptors.EntryWrappingInterceptor]
(HotRodServerWorker-3) The return value is null
14:54:57,072 TRACE [org.infinispan.util.concurrent.locks.LockManagerImpl]
(HotRodServerWorker-3) Attempting to unlock 1
14:54:57,073 TRACE
[org.infinispan.util.concurrent.locks.containers.ReentrantPerEntryLockContainer]
(HotRodServerWorker-3) Unlocking lock instance for key 1
14:54:57,074 TRACE [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWorker-3)
Write response ResponseWithPrevious{version=12, messageId=3, operation=PutResponse,
status=Success, previous=null}
14:54:57,074 TRACE [org.infinispan.server.hotrod.HotRodEncoder] (HotRodServerWorker-3)
Encode msg ResponseWithPrevious{version=12, messageId=3, operation=PutResponse,
status=Success, previous=null}
14:54:57,075 TRACE [org.infinispan.server.hotrod.Encoders$Encoder12$]
(HotRodServerWorker-3) Write topology response header with no change
14:54:57,075 TRACE [org.infinispan.server.hotrod.HotRodEncoder] (HotRodServerWorker-3)
Write buffer contents A10302000000 to channel [id: 0x6ef9bcb3, /127.0.0.1:55677 =>
/127.0.0.1:11222]
14:54:57,078 TRACE [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWorker-3)
Decode using instance @265b1dbd
14:54:57,078 TRACE [org.infinispan.server.hotrod.Decoder10$] (HotRodServerWorker-3)
Operation code: 3 has been matched to GetRequest
14:54:57,079 TRACE [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWorker-3)
Decoded header HotRodHeader{op=GetRequest, version=12, messageId=4, cacheName=, flag=0,
clientIntelligence=3, topologyId=-1}
14:54:57,079 TRACE [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWorker-3)
Decode using instance @265b1dbd
14:54:57,080 TRACE [org.infinispan.interceptors.InvocationContextInterceptor]
(HotRodServerWorker-3) Invoked with command GetKeyValueCommand {key=[B0x033e0131..(4),
flags=null} and InvocationContext
[org.infinispan.context.SingleKeyNonTxInvocationContext@721c2e8a]
14:54:57,080 TRACE [org.infinispan.container.EntryFactoryImpl] (HotRodServerWorker-3)
Exists in context? null
14:54:57,080 TRACE [org.infinispan.container.EntryFactoryImpl] (HotRodServerWorker-3)
Retrieved from container null
14:54:57,080 TRACE [org.infinispan.interceptors.CallInterceptor] (HotRodServerWorker-3)
Executing command: GetKeyValueCommand {key=[B0x033e0131..(4), flags=null}.
14:54:57,081 TRACE [org.infinispan.commands.read.GetKeyValueCommand]
(HotRodServerWorker-3) Entry not found
14:54:57,081 TRACE [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWorker-3)
Write response GetResponse{version=12, messageId=4, operation=GetResponse,
status=KeyDoesNotExist, data=null}
14:54:57,081 TRACE [org.infinispan.server.hotrod.HotRodEncoder] (HotRodServerWorker-3)
Encode msg GetResponse{version=12, messageId=4, operation=GetResponse,
status=KeyDoesNotExist, data=null}
{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: