v0.4.5 Release Notes
Released
v0.4.4 -> v0.4.5
Summary
Split Entry.parseCached into a write-path parseAndCache and a read-path cached to eliminate a data race between concurrent RLock holders, and fix GetField which previously called the cache accessor with no lock held.
翻譯
將 `Entry.parseCached` 拆分為寫路徑 `parseAndCache` 與讀路徑 `cached`,消除並發 RLock 持有者之間的 data race,並修復 `GetField` 先前在完全無鎖狀態下呼叫快取存取器的問題。Changes
FIX
- Split
Entry.parseCached()intoparseAndCache()(write-path, mutatese.parsed, must be called under write lock or single-threaded init) andcached()(pure read, returns(nil, false)on miss; safe under RLock) - Fix
GetFielddata race: previously calledparseCached()afterGet()had already released the RLock — now holds the db RLock across lookup, cache read, andWalkKeysto prevent concurrent map mutation bySetField/IncrField/DelField
翻譯
- 將
Entry.parseCached()拆分為parseAndCache()(寫路徑,會寫入e.parsed,必須持寫鎖或單執行緒初始化時呼叫)與cached()(純讀,miss 時回傳(nil, false);RLock 下安全) - 修復
GetField的 data race:先前在Get()已釋放 RLock 後才呼叫parseCached()— 現在整個查找、快取讀取、WalkKeys流程皆在 db RLock 下進行,避免SetField/IncrField/DelField並發修改共用 map
REFACTOR
- Update all write-path callers (
Set,SetField,IncrField,DelField, AOF replay) to useparseAndCache() - Update read-path callers (
Query,GetField) to usecached(), relying on the invariant that every write path warmse.parsedbefore releasing the write lock
翻譯
- 將所有寫路徑(
Set、SetField、IncrField、DelField、AOF replay)改為呼叫parseAndCache() - 將讀路徑(
Query、GetField)改為呼叫cached(),仰賴「每個寫路徑在釋放寫鎖前已預熱e.parsed」此不變量
Files Changed
| File | Status | Tag |
|---|---|---|
core/store/set.go |
Modified | FIX, REFACTOR |
core/store/get.go |
Modified | FIX |
core/store/query.go |
Modified | REFACTOR |
core/store/setField.go |
Modified | REFACTOR |
core/store/incrField.go |
Modified | REFACTOR |
core/store/del.go |
Modified | REFACTOR |
core/store/aof.go |
Modified | REFACTOR |
CLAUDE.md |
Modified | DOC |
Generated by SKILL