-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Cache and Eviction
-
None
-
Storage Engines
-
87.894
-
None
-
None
__evict_reconcile() never keeps an image of a history store page, so an evicted dirty history store page is always written and discarded, even when the cache has plenty of room and the page is read again soon (reads at older timestamps, updates that consult the history store).
When the eviction server has set WT_EVICT_CACHE_SCRUB, the history store is not dirty-heavy and no clean eviction is needed, history store pages are now reconciled with WT_REC_SAVE_IMAGE_ALWAYS: written and kept in memory as clean pages. __evict_update_work() also sets WT_EVICT_CACHE_SCRUB when the cache is below its eviction target and below the dirty and update triggers.
Measured effect
- YCSB workload B (95% read, 5% update): instructions/op -0.9%
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
Only active while the cache is below its eviction target; under pressure history store eviction is unchanged.
Tests
Adds test/suite/test_hs_scrub_evict01.py: moves many versions to the history store while dirty eviction runs with room in the cache (and, as a control, under cache pressure) and reads every version at its timestamp, across checkpoints and a restart.