Bug 1214604 - Async cache store doesn't clear the table rows while sync store does
Summary: Async cache store doesn't clear the table rows while sync store does
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Infinispan
Version: 6.4.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: 6.5.0
Assignee: Galder Zamarreño
QA Contact: Martin Gencur
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-23 08:07 UTC by Osamu Nagano
Modified: 2019-07-11 09:00 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-23 12:26:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
restcache.zip (6.09 KB, application/zip)
2015-04-23 08:09 UTC, Osamu Nagano
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker ISPN-5490 0 Major Resolved Cache.clear() does not clear the cache store with async store 2016-04-20 05:57:31 UTC

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


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