-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Layered Tables
-
None
-
Storage Engines, Storage Engines - Transactions
-
33.388
-
SE Transactions - 2026-12-04
-
5
*Description:*
Layered iteration can report a prepare conflict while repositioning the alternate constituent, even when the other constituent has a readable key that should be returned first. Conflicts from `search_near()` or the subsequent `next()`/`prev()` calls are propagated before merge selection compares the candidates.
This can occur after a context change invalidates cached positions, including a write through another cursor in the same transaction, or when iteration follows `search()` on an ingest key. The prepared key may be ahead in the scan direction, not only outside it.
*Reported reproduction:*
1. Populate stable with `key10`, `key20`, and `key80`; prepare an update to `key80`.
2. Inside the step-down window, populate ingest with `key30` and `key50`.
3. Scan forward, returning `key10`, `key20`, and `key30`.
4. Write through another cursor in the reader’s transaction, invalidating the iteration context.
5. Call `next()` again.
*Actual:* The call reports `WT_PREPARE_CONFLICT` while repositioning stable at `key80`, before returning readable ingest key `key50`. Retrying remains blocked until the prepared transaction resolves.
*Expected:* Return `key50` first and report the conflict only when the prepared key becomes the next merge candidate.
*Scope / acceptance criteria:*
- Investigate retaining the blocked alternate as a merge candidate rather than immediately propagating the positioning conflict.
- Cover both scan directions, same-transaction writes through another cursor, and iteration after `search()`/`search_near()`.
- Verify exact key/value order and ingest precedence on the same cursor, without resets, before and after prepared commit or rollback.
- Preserve handling of bounded positioning conflicts that retain no usable key.
*Context:* Identified during review of PR #15102(https://github.com/wiredtiger/wiredtiger/pull/15102). The reviewer also reports the search-entry case on develop; confirm that baseline during investigation. This follow-up concerns conflict timing during alternate repositioning, rather than the stale-value behavior after snapshot/read-timestamp changes tracked by WT-17960.