-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Cursors
-
None
-
Storage Engines - Foundations
-
386.735
-
None
-
None
The current next_random implementation in the layered cursor reaches directly into the file-cursor layer, which is an ugly layering violation:
- _clayered_seed_random (src/cursor/cur_layered.c) casts a constituent WT_CURSOR * to WT_CURSOR_BTREE * and pokes cbt->rnd and cbt->next_random_sample_size directly. This duplicates logic from _curfile_create instead of going through a proper file-cursor API.
- _clayered_next_random (src/cursor/cur_layered.c) calls _wti_curfile_next_random directly on the constituent rather than going through cursor->next dispatch.
The reason we ended up here: configuring the constituent cursors with next_random=true would rebind their cursor->next to the random-pick implementation, which breaks _clayered_iterate's deletion-skip loop (it spins forever on an all-tombstoned ingest btree). See WT-15189 for the original spin bug. The current workaround is to open constituents _without next_random=true but seed their random state manually.
- is related to
-
WT-15189 test/format disagg follower and Python tests time out in clayered_next_random
-
- In Code Review
-