Bug 1171479 - C++ HotRod Client has wrong cache size after the key/value is expired when using lifespan
Summary: C++ HotRod Client has wrong cache size after the key/value is expired when us...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: CPP Client
Version: 6.3.0
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ER8
: 6.4.0
Assignee: Ion Savin
QA Contact: Alan Field
URL:
Whiteboard:
Depends On:
Blocks: jdg64-GA-Blockers
TreeView+ depends on / blocked
 
Reported: 2014-12-07 15:39 UTC by Benny
Modified: 2015-07-13 04:34 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
C++ sample code to reproduce this issue (1.71 KB, text/x-csrc)
2014-12-07 15:39 UTC, Benny
no flags Details
Java HotRod Client doesn't have this issue (1.21 KB, text/plain)
2014-12-07 15:41 UTC, Benny
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker HRCPP-182 0 Major Open Add support for the new SIZE HotRod op 2016-02-08 07:02:03 UTC
Red Hat Issue Tracker ISPN-5073 0 Major New Improve "Number of Entries" stats 2016-02-08 07:02:03 UTC

Description Benny 2014-12-07 15:39:25 UTC
Created attachment 965582 [details]
C++ sample code to reproduce this issue

Description of problem:
C++ HotRod Client has wrong cache size after the key/value is expired when using lifespan


Version-Release number of selected component (if applicable):
RHEL 6.4 64 bit
JBoss Data Grid 6.3.0 GA
C++ HotRod Client

Steps to Reproduce:
1. Start JDG 6.3.0 server;
2. Using C++ HotRod Client to connect to server;
3. Using C++ HotRod Client to create a key/value to set the lifespan is 3 seconds, and the size is 1 and you can get the key/value;
4. After 3 seconds, you will not get the key/value but the size is still 1;

Comment 1 Benny 2014-12-07 15:40:31 UTC
this issue doesn't exist in JAVA HotRod client.

Comment 3 Benny 2014-12-07 15:41:47 UTC
Created attachment 965583 [details]
Java HotRod Client doesn't have this issue

Comment 4 Ion Savin 2014-12-12 11:39:41 UTC
The native client is using HotRod Protocol 1.2 and size() is implemented using server statistics, more specifically the "currentNumberOfEntries" stat which doesn't seem to be updated as soon as the entry expires.

Version 2.0 of the protocol introduced a proper Size operation. We would need to implement 2.0 in the native client to fix this (the java client is already using this operation and this is why for that client the test works fine).

Comment 5 Tristan Tarrant 2014-12-12 12:22:02 UTC
Additionally the "currentNumberOfEntries" statistic is broken since it returns the size of the data container of the node responding to the request which doesn't take into account: eviction/expiration/persistence/distribution/etc.

Comment 7 Alan Field 2014-12-16 13:09:08 UTC
One possible fix for this issue would be to use the same HotRod protocol version (1.2) in the Java and C++ clients in the product. Then they would be consistent with each other until the new protocol is implemented in all of the clients.

Comment 8 Ion Savin 2014-12-23 11:11:28 UTC
I just realised that for the JDG Java client the behavior is actually identical as the size operation is not used and the same stat ("currentNumberOfEntries") is used instead.

Tested using JDG-6.4.0-ER7-redhat-1 using the attached code and both clients give the correct answer if a get() is performed on the expired keys prior to size() and the wrong answer if a prior get() is not performed.

Comment 9 Divya Mehra 2014-12-23 13:52:21 UTC
Let's exclude this from CR1 until we have had another chat with Tristan about this.

Comment 11 Alan Field 2015-01-08 22:40:57 UTC
Verified with JDG 6.4.0 ER8

Comment 14 Tristan Tarrant 2015-01-15 12:58:04 UTC
In the case of a cache with eviction/passivation to a cachestore, the entries present on the cachestore will be included in the count returned by the size() operation


Note You need to log in before you can comment on or make changes to this bug.