Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1437212 - Indexed cache with a cache store does not return the complete list of entries after a JDG restart
Indexed cache with a cache store does not return the complete list of entries...
Status: NEW
Product: JBoss Data Grid 6
Classification: JBoss
Component: Infinispan (Show other bugs)
6.5.1
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Adrian Nistor
Martin Gencur
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-29 15:02 EDT by Bill DeCoste
Modified: 2017-03-31 15:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bill DeCoste 2017-03-29 15:02:13 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.
Comment 2 Bill DeCoste 2017-03-30 18:12:44 EDT
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.
Comment 3 Bill DeCoste 2017-03-30 18:21:29 EDT
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
Comment 4 Bill DeCoste 2017-03-31 15:30:29 EDT
The timestamp-column is a red herring. The problematic configuration is the cache being indexed or not.
Comment 5 Bill DeCoste 2017-03-31 15:38:50 EDT
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.

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