-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Btree
-
None
-
Storage Engines
-
87.905
-
None
-
None
__wt_update_obsolete_check() walks the update chain on updates to a page, looking for updates that became globally visible so it can free the older ones. When the oldest update on the chain that is not globally visible (the blocker) already has a globally visible transaction ID and only waits for its durable timestamp to pass the pinned timestamp - the normal case with a snapshot history window, such as MongoDB's minSnapshotHistoryWindowInSeconds - nothing on the chain can become obsolete before that timestamp moves, yet each update walks the chain again.
The check now records that transaction ID and timestamp on the page together with a skip budget (obsolete_check_skip, at most 100 updates and never past the 1000-update forced eviction check), and __wt_update_serial() skips the walk while the budget lasts. Chains with prepared blockers or with updates that must be removed from the history store are not skipped.
Measured effect
- YCSB workload B (95% read, 5% update): cycles/op -3.9%, instructions/op -1.4%
- YCSB workload C (100% read): instructions/op +1.3%
Measured in mongod (MongoDB master) running with this WiredTiger change.
YCSB, single-node replica set, 5M documents in the WiredTiger cache; cycles and instructions per operation.
Risk
Chains can grow by at most 100 more updates between checks; the 1000-update forced eviction check is unchanged.
Tests
Adds test/suite/test_update_obsolete_skip01.py: reads at older timestamps while updates are skipped, chains trimmed again once the timestamps move forward, the forced eviction of pages with more than 1000 updates to an item, and a prepared update on the same page.