v0.4.2
v0.4.1 -> v0.4.2
Summary
Trigger AOF compaction inline on writes when the inflation ratio (AOF lines / live keys) reaches 2x, with a minimum live-key threshold to avoid wasteful rewrites on small databases.
翻譯
在寫入路徑中依膨脹比(AOF 行數 / 活躍 key 數)達到 2 倍時自動觸發 compaction,並設定最小活躍 key 門檻避免小型資料庫進行無意義的重寫。Changes
PERF
- Track AOF line count per database and trigger compaction inline in
addToAOFwhenaofLines >= live * 2andlive >= 1024, bounding AOF growth for long-running processes without requiring restart - Return line count from
replayAOFto initialize the counter on lazy DB load - Reset
aofLinesto the post-compaction line count so the inflation baseline adapts as the working set grows
翻譯
- 每個 database 追蹤 AOF 行數,在
addToAOF中於aofLines >= live * 2且live >= 1024時直接觸發 compaction,讓長時間運行的 process 不需重啟即可控制 AOF 成長 replayAOF回傳行數,用於 lazy DB 載入時初始化計數器- Compaction 完成後將
aofLines重設為壓縮後的行數,讓膨脹比的基準隨工作集自適應調整
Files Changed
| File | Status | Tag |
|---|---|---|
core/store/aof.go |
Modified | PERF |
core/store/store.go |
Modified | PERF |
Generated by SKILL