Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1437212

Summary: Indexed cache with a cache store does not return the complete list of entries after a JDG restart
Product: [JBoss] JBoss Data Grid 6 Reporter: Bill DeCoste <wdecoste>
Component: InfinispanAssignee: Tristan Tarrant <ttarrant>
Status: CLOSED UPSTREAM QA Contact: Martin Gencur <mgencur>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5.1CC: jdg-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:49:38 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:

Description Bill DeCoste 2017-03-29 19:02:13 UTC
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 22:12:44 UTC
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 22:21:29 UTC
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 19:30:29 UTC
The timestamp-column is a red herring. The problematic configuration is the cache being indexed or not.

Comment 5 Bill DeCoste 2017-03-31 19:38:50 UTC
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.

Comment 7 Red Hat Bugzilla 2025-02-10 03:49:38 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.