Claude Opus 5.5 · Balanced
dual-storage-architecture-grafana-codex
Grafana · Go · L · 300–799 lines · 4 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 5 of 9
- Comments published
- 5
- Comments matching a bug
- 5
- Comments not matching
- 0
- Cost of this PR
- $0.859
Published comments (5)
Legacy writes use request context that is cancelled when the handler returns — The apiserver cancels `ctx` once `Create` returns, so `Legacy.Create` usually gets a cancelled context and the legacy write is silently lost. Detach it with `context.WithoutCancel(ctx)` before `WithTimeoutCause`, and do the same in `Update`, `Delete` and `DeleteCollection`.
Legacy update recomputes from raw objInfo instead of reusing storage result — Passing the raw `objInfo` makes legacy recompute the update against its own possibly stale object, so the stores can diverge or fail on a resourceVersion conflict. Wrap it as the removed code did, with `&updateWrapper{upstream: objInfo, updated: res}`, before calling `Legacy.Update`.
Async legacy DeleteCollection timing recorded as unified-storage metric — Legacy latency and errors get mixed into the unified-storage metrics. Call `recordLegacyDuration` instead of `recordStorageDuration` here.
Delete success metric uses object name instead of kind as label — Each deleted object `name` creates its own metric series, causing unbounded cardinality and mislabeled data. Pass `options.Kind` like every other `recordStorageDuration` call.
Storage create failure recorded as legacy error in metrics — `Storage.Create` failures show up as legacy errors, so unified-storage error metrics undercount them. Call `recordStorageDuration(true, ...)` instead of `recordLegacyDuration`. **Also found in:** - `pkg/apiserver/rest/dualwriter_mode3.go:127-130`