MiniMax M3 · Heavy
dual-storage-architecture-grafana-codex
Grafana · Go · L · 300–799 lines · 4 files
The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.
- Gold bugs found
- 5 of 9
- Comments published
- 7
- Comments matching a bug
- 5
- Comments not matching
- 2
- Cost of this PR
- $0.450
Published comments (7)
DeleteCollection legacy goroutine records duration under wrong metric name — The async legacy goroutine after a unified-store `DeleteCollection` records its latency under the storage histogram, polluting dashboards. Call `d.recordLegacyDuration(err != nil, mode3Str, options.Kind, method, startLegacy)` instead.
DeleteCollection legacy goroutine uses storage duration recorder — The legacy `DeleteCollection` goroutine records latency via `d.recordStorageDuration`, attributing Legacy timings to the unified-storage series. Switch to `d.recordLegacyDuration` so the storage/legacy split stays accurate.
Mode3 Create: storage error recorded to legacy metric — Create's storage-error branch writes into the legacy metric via `d.recordLegacyDuration`, misattributing a UnifiedStorage failure. Use `d.recordStorageDuration(true, mode3Str, options.Kind, method, startStorage)` so dashboards see the failure on the correct series.
recordLegacyDuration used instead of recordStorageDuration on storage Update error — Update's storage-error branch calls `d.recordLegacyDuration` for a Storage failure. Use `d.recordStorageDuration(true, mode3Str, options.Kind, method, startStorage)` to keep the storage/legacy split faithful.
Delete success path logs object name instead of resource kind — Delete's success branch passes `name` where `options.Kind` is expected, putting object identity under the kind label. Replace `name` with `options.Kind` so per-kind dashboards group correctly.
Mode3 Update dispatching to Legacy asynchronously breaks prior sync guarantee — `DualWriterMode3.Update` previously called `Legacy.Update` synchronously with an `updateWrapper`; now it fires a goroutine using unwrapped `objInfo`, so callers can't rely on read-after-update from Legacy. Revert to synchronous legacy update or document the new async guarantee.
TestMode3_Create does not assert the legacy Create was actually invoked — `TestMode3_Create` registers a `legacyStoreMock.Create` expectation but never verifies it was met, so removing the legacy goroutine would still pass. Add `m.AssertExpectations(t)` so the dual-write contract is actually enforced. **Also found in:** - `pkg/apiserver/rest/dualwriter_mode3_test.go:189-241` - `pkg/apiserver/rest/dualwriter_mode3_test.go:297-355`