Problem: https://github.com/bitcoin-core/leveldb-subtree/pull/61 disabled read-triggered seek compactions to avoid large chainstate write amplification from random UTXO lookups. That avoids repeated read-driven rewrites, but fragmented LevelDB layouts no longer self-repair during IBD.
During IBD, this can leave validation reading through too many SSTables in compactible levels, putting pressure on LevelDB's table-cache/open-file/mmap budget. After IBD, normal chainstate churn can also leave obsolete entries behind until ordinary LevelDB compaction naturally reaches the affected levels.
Fix: After each completed full chainstate flush, decide whether to compact the chainstate.
After IBD compact randomly with 1/1000 probability per full flush.
This spreads compactions across nodes and keeps recurring maintenance stateless, without storing last-compaction height or timestamp metadata in the chainstate database.
Compaction runs on a background thread (utxocompact) so it does not block validation.