v0.7.0 Release Notes
Released
v0.6.2 -> v0.7.0
Summary
Consolidates durability around a single source of truth. The write-only per-key mirror is gone, and the store now keeps one prior generation and falls back to it whenever the newest one cannot be replayed. Compaction refuses to run on an incomplete load, so an unreadable file can no longer be overwritten by empty state.
翻譯
將持久化收斂為單一事實來源。移除只寫不讀的逐鍵鏡像,改為保留前一代並在最新一代無法重播時自動退回。載入不完整時拒絕壓縮,讀不出來的檔案不會再被空狀態覆蓋。
⚠️ Breaking Changes
Per-key JSON mirror removed
Every write used to emit a second copy of the entry to <db>/<xx>/<yy>/<zz>/<md5>.json. Nothing ever read those files back, so they were a silent second source of truth that drifted from the snapshot and log. The mirror and its accessor Entry.JSON() are removed.
Before:
raw, err := entry.JSON()
After:
// removed; entries are persisted through the snapshot and log only
Migration:
- Callers of
Entry.JSON()must marshal the fields they need fromEntrydirectly. - Existing
<db>/<xx>/<yy>/<zz>/<md5>.jsonfiles are left untouched and are safe to delete once the database loads correctly. - If a previous version lost records from its snapshot, recover them from those files before deleting: read each JSON, skip entries whose
expire_athas passed, andSetthe rest back.
翻譯
每次寫入原本會額外輸出一份 <db>/<xx>/<yy>/<zz>/<md5>.json。這些檔案從來不被讀回,是一份會與快照及日誌漂移的隱性第二事實來源。鏡像與存取器 Entry.JSON() 一併移除。
遷移方式:
- 呼叫
Entry.JSON()的程式改為直接序列化Entry所需欄位。 - 既有的
<db>/<xx>/<yy>/<zz>/<md5>.json檔案原地保留,確認資料庫可正常載入後即可刪除。 - 若舊版曾從快照遺失紀錄,刪除前先從這些檔案復原:逐筆讀取 JSON、略過
expire_at已過期者,其餘Set回資料庫。
Changes
BREAKING
- Remove the per-key JSON mirror and the
Entry.JSON()accessor (@pardnchiu) [ad59142]
翻譯
- 移除逐鍵 JSON 鏡像與
Entry.JSON()存取器
FIX
- Refuse compaction while a replay failure is recorded, so incomplete state cannot overwrite a readable file (@pardnchiu) [ad59142]
- Run the close-path collector only after a successful compaction, so a failed one no longer deletes live files (@pardnchiu) [ad59142]
- Propagate read failures out of replay instead of treating a truncated read as a clean end of file (@pardnchiu) [ad59142]
翻譯
- 重播失敗時拒絕壓縮,避免不完整狀態覆蓋仍可讀的檔案
- 關閉流程的回收僅在壓縮成功後執行,壓縮失敗不再刪除有效檔案
- 重播的讀取錯誤如實往外傳,不再把截斷的讀取當成正常結束
FEAT
- Retain one prior generation and fall back to it when the newest snapshot cannot be replayed (@pardnchiu) [ad59142]
- Replay every log after the selected snapshot so an older generation restores the current state (@pardnchiu) [ad59142]
翻譯
- 保留前一代並在最新快照無法重播時自動退回
- 重播所選快照之後的每個日誌,使較舊的一代也能還原至當前狀態
Scope
core/store/— BREAKING, FIX, FEAT (aof.go,gc.go,store.go)core/store/— REMOVE (del.go,incr.go,incrField.go,set.go,setField.go,ttl.go,vcache.go)
Generated by SKILL