vitthalbywar-tibco opened a new issue, #12540: URL: https://github.com/apache/ignite/issues/12540
Hello, Key/Value API (getEntries) sees intermediate states during concurrent transaction commit. ## Environment - Apache Ignite 2.17.0 - Single node (also reproducible in cluster) - Persistence enabled When using `PESSIMISTIC` / `READ_COMMITTED` transactions with the Key/Value API (`cache.getEntries()`), a concurrent reader transaction can see **intermediate states** during another transaction's commit phase. ### Expected Behavior With `READ_COMMITTED` isolation, a reader should only see **committed data**. When one transaction deletes 500 entries via `removeAll()` and commits, a concurrent reader using `getEntries()` should see either: - **500 entries** (before commit completes), OR - **0 entries** (after commit completes) It should **never** see intermediate counts like 450, 300, 150, etc. ### Actual Behavior During the commit phase of `removeAll()`, the reader sees **decreasing counts** (e.g., 450 → 300 → 150 → 0) as entries become invisible one-by-one during the commit loop. Example output: ``` [DELETE] Transaction started at 15:48:30.100 [DELETE] removeAll() completed, about to commit at 15:48:30.200 [READ] Starting concurrent reads at 15:48:30.210 !!! INCONSISTENCY DETECTED !!! [READ] Iteration 1: Saw 450 entries (INCONSISTENT - expected 500 or 0) [READ] Iteration 2: Saw 312 entries (INCONSISTENT - expected 500 or 0) [READ] Iteration 3: Saw 189 entries (INCONSISTENT - expected 500 or 0) [READ] Iteration 4: Saw 47 entries (INCONSISTENT - expected 500 or 0) [READ] Final count: 0 entries at 15:48:30.450 [DELETE] Transaction committed at 15:48:30.450 === SUMMARY === RESULT: DIRTY READ DETECTED! During commit, reader saw counts between 47 and 450 Expected: Only 500 (before commit) or 0 (after commit) ``` Please refer attached maven project(IgniteDirtyReadTest.zip) with sample code. Please refer README.md for instructions. If we read with `PESSIMISTIC / SERIALIZABLE` OR `REPEATABLE_READ` then read will wait for the lock keys to be released from delete tx and in this case read will be consistent. But the question is why should it see intermediate state after commit as started for `READ_COMMITTED`. Please suggest if we are missing something. Thank you. Best regards, Vitthal Bywar [IgniteDirtyReadTest.zip](https://github.com/user-attachments/files/23784947/IgniteDirtyReadTest.zip) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
