# v0.4.5 Release Notes

> 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.
<details>
<summary>翻譯</summary>
將 `Entry.parseCached` 拆分為寫路徑 `parseAndCache` 與讀路徑 `cached`，消除並發 RLock 持有者之間的 data race，並修復 `GetField` 先前在完全無鎖狀態下呼叫快取存取器的問題。
</details>

## Changes

### FIX
- Split `Entry.parseCached()` into `parseAndCache()` (write-path, mutates `e.parsed`, must be called under write lock or single-threaded init) and `cached()` (pure read, returns `(nil, false)` on miss; safe under RLock)
- Fix `GetField` data race: previously called `parseCached()` after `Get()` had already released the RLock — now holds the db RLock across lookup, cache read, and `WalkKeys` to prevent concurrent map mutation by `SetField` / `IncrField` / `DelField`

<details>
<summary>翻譯</summary>

- 將 `Entry.parseCached()` 拆分為 `parseAndCache()`（寫路徑，會寫入 `e.parsed`，必須持寫鎖或單執行緒初始化時呼叫）與 `cached()`（純讀，miss 時回傳 `(nil, false)`；RLock 下安全）
- 修復 `GetField` 的 data race：先前在 `Get()` 已釋放 RLock 後才呼叫 `parseCached()` — 現在整個查找、快取讀取、`WalkKeys` 流程皆在 db RLock 下進行，避免 `SetField` / `IncrField` / `DelField` 並發修改共用 map

</details>

### REFACTOR
- Update all write-path callers (`Set`, `SetField`, `IncrField`, `DelField`, AOF replay) to use `parseAndCache()`
- Update read-path callers (`Query`, `GetField`) to use `cached()`, relying on the invariant that every write path warms `e.parsed` before releasing the write lock

<details>
<summary>翻譯</summary>

- 將所有寫路徑（`Set`、`SetField`、`IncrField`、`DelField`、AOF replay）改為呼叫 `parseAndCache()`
- 將讀路徑（`Query`、`GetField`）改為呼叫 `cached()`，仰賴「每個寫路徑在釋放寫鎖前已預熱 `e.parsed`」此不變量

</details>

***

## 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](https://github.com/pardnchiu/skill-version-generate)
