Commit 395e1e2
committed
Improve trust DB autosizing for reload storms
Trust database auto sizing only considered active pages in the final named database. A reload drops the LMDB database and rebuilds it, so repeated reloads can drive LMDB allocated high-water pages to the map limit even when the final entry count is stable. That also left manual db_max_size users with weak diagnostics and allowed overlapping reload requests to trigger redundant rebuilds.
Centralize LMDB sizing state, size auto maps for both steady-state active pages and reload high-water headroom, grow before the drop/rebuild transaction, and keep shrink conservative with hysteresis and a reload floor. Manual sizing now logs a recommended map size when a reload would need more headroom. Trust database reload requests are coalesced while pending or active, with a log entry when a duplicate request is dropped.1 parent fec1474 commit 395e1e2
1 file changed
Lines changed: 556 additions & 131 deletions
0 commit comments