v0.7.0

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:

  1. Callers of Entry.JSON() must marshal the fields they need from Entry directly.
  2. Existing <db>/<xx>/<yy>/<zz>/<md5>.json files are left untouched and are safe to delete once the database loads correctly.
  3. If a previous version lost records from its snapshot, recover them from those files before deleting: read each JSON, skip entries whose expire_at has passed, and Set the rest back.
翻譯

每次寫入原本會額外輸出一份 <db>/<xx>/<yy>/<zz>/<md5>.json。這些檔案從來不被讀回,是一份會與快照及日誌漂移的隱性第二事實來源。鏡像與存取器 Entry.JSON() 一併移除。

遷移方式:

  1. 呼叫 Entry.JSON() 的程式改為直接序列化 Entry 所需欄位。
  2. 既有的 <db>/<xx>/<yy>/<zz>/<md5>.json 檔案原地保留,確認資料庫可正常載入後即可刪除。
  3. 若舊版曾從快照遺失紀錄,刪除前先從這些檔案復原:逐筆讀取 JSON、略過 expire_at 已過期者,其餘 Set 回資料庫。

Changes

BREAKING

翻譯
  • 移除逐鍵 JSON 鏡像與 Entry.JSON() 存取器

FIX

翻譯
  • 重播失敗時拒絕壓縮,避免不完整狀態覆蓋仍可讀的檔案
  • 關閉流程的回收僅在壓縮成功後執行,壓縮失敗不再刪除有效檔案
  • 重播的讀取錯誤如實往外傳,不再把截斷的讀取當成正常結束

FEAT

翻譯
  • 保留前一代並在最新快照無法重播時自動退回
  • 重播所選快照之後的每個日誌,使較舊的一代也能還原至當前狀態

Scope


Generated by SKILL