Bug 1214604

Summary: Async cache store doesn't clear the table rows while sync store does
Product: [JBoss] JBoss Data Grid 6 Reporter: Osamu Nagano <onagano>
Component: InfinispanAssignee: Galder ZamarreƱo <galder.zamarreno>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Gencur <mgencur>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.1CC: dstahl, jdg-bugs, rmarwaha, ttarrant, vjuranek
Target Milestone: CR1   
Target Release: 6.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-23 12:26:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
restcache.zip none

Description Osamu Nagano 2015-04-23 08:07:10 UTC
Description of problem:
A customer is monitoring a table which is configured as a store of async stringKeyedJdbcStore.  When they execute cache.clear(), it removes data from memory (cache.get(key) returns null) but the table entries are left.  If the cache store is sync one, the table entries are removed as well.


Version-Release number of selected component (if applicable):
Infinispan 'Infinium' 6.2.1.Final-redhat-2


How reproducible:
Always.


Steps to Reproduce:
A reproducer is available, which is a REST web app with library mode JDG.
1. Prepare standalone EAP 6.x with "ExampleDS" to persist as follows.
<connection-url>jdbc:h2:tcp://localhost/~/tmp/test</connection-url>

2. Start H2 database by the following command.  Web interface will be launched as well.  Access to the above JDBC URL with username/password "sa/sa".
java -cp $JBOSS_HOME/modules/system/layers/base/com/h2database/h2/main/h2*.jar org.h2.tools.Server

3. Build and deploy the attached maven project.
The following access pattern exhibit the issue.


Actual results:
curl "http://localhost:8080/restcache/rest/asyncstore/put/key01/aaa"
curl "http://localhost:8080/restcache/rest/asyncstore/clear"
curl "http://localhost:8080/restcache/rest/asyncstore/get/key01"
The last command returns null properly but table "JDG_asyncstore" contains the data still.


Expected results:
Replace "asyncstore" with "syncstore" in the URLs.  Table "JDG_syncstore" is cleared properly.


Additional info:
The cache configuration is as follows.  Sync one has <async enabled="false"/> and it is the only difference.
	<namedCache name="asyncstore">
		<persistence passivation="false">
			<stringKeyedJdbcStore xmlns="urn:infinispan:config:jdbc:6.0"
				fetchPersistentState="false" ignoreModifications="false"
				purgeOnStartup="false">
				<dataSource jndiUrl="java:jboss/datasources/ExampleDS" />
				<stringKeyedTable dropOnExit="false" createOnStart="true"
					prefix="JDG">
					<idColumn name="id" type="VARCHAR2(200)" />
					<dataColumn name="datum" type="BLOB" />
					<timestampColumn name="version" type="NUMBER" />
				</stringKeyedTable>
				<async enabled="true" />
			</stringKeyedJdbcStore>
		</persistence>
	</namedCache>

Comment 1 Osamu Nagano 2015-04-23 08:09:31 UTC
Created attachment 1017796 [details]
restcache.zip