Red Hat Bugzilla – Bug 1437212
Indexed cache with a cache store does not return the complete list of entries after a JDG restart
Last modified: 2017-03-31 15:38:50 EDT
Description of problem: An indexed cache with a cache store with a timestamp-column does not return the complete list of entries after a JDG restart. Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. Create a cache with where the cache store datasource is postgresql <cache-container name="clustered" default-cache="ADDRESSBOOK" > <transport/> <distributed-cache name="ADDRESSBOOK" mode="SYNC" start="EAGER" > <eviction strategy="LRU" /> <string-keyed-jdbc-store datasource="java:/accounts-ds" passivation="true" shared="true"> <string-keyed-table prefix="JDG"> <id-column name="id" type="VARCHAR"/> <data-column name="datum" type="BYTEA"/> <timestamp-column name="version" type="BIGINT"/> </string-keyed-table> </string-keyed-jdbc-store> <indexing index="ALL"> <property name="default.directory_provider">ram</property> </indexing> <locking acquire-timeout="20000" concurrency-level="500" striping="false" /> </distributed-cache> </cache-container> 2. Insert item A into cache (e.g. quickstart.Person) 3. Restart JDG 4. Insert item B into cache (e.g. quickstart.Person) 5. Issue a hotrod remote query (e.g. FROM quickstart.Person _gen0) Actual results: Query returns item B only Expected results: Query returns iteams A and B Additional info: If the cache is not indexed or does not contain a timestamp-column then the query returns the expected results.
After a JDG restart, CacheQueryImpl.hSearchQuery.queryEntityInfos() does not return anything added to the cache prior to the JDG restart. QueryFacadeImpl.executeIndexedQuery.cache contains all of the correct data from before and after the JDG restart. So the search fails but EntityLoader has the correct data available to load if the search succeeded.
One other thing I noticed: 1) Add A to cache 2) Restart JDG 3) Add B to cache QueryFacadeImpl.executeIndexedQuery.cache now contains TWO copies of A and ONE copy of B
The timestamp-column is a red herring. The problematic configuration is the cache being indexed or not.
the luceneQuery doesn't seem to be the issue. If the query is "*:*" then the behavior is the same (pre-restart data not found). So this doesn't appear to be an issue with the class compatibility.