fix(txmetacache): restore delete correctness for native and trimmed #836
Conversation
|
🤖 Claude Code Review Status: Complete Summary: This PR correctly fixes delete operations for Native and Trimmed bucket types. The previous implementation bypassed the swiss map API and corrupted the length counter. The new shard-rebuild approach properly maintains length correctness. Findings: ✅ Correctness: Delete implementation properly synchronized with locks. The shard rebuild approach correctly maintains the length counter that was broken by the old ✅ Test Coverage: Comprehensive test additions verify delete correctness (Has returns false, Get fails, map size shrinks) and include concurrent stress testing across all bucket types. ✅ Documentation: Lock invariants are now clearly documented with inline comments explaining which lock protects each bucket type. Minor Performance Note: Both Verification Required (per AGENTS.md): Since the PR description states "Full test suite not run", ensure the following pass before merge: Previous Issues: All previously flagged race condition concerns have been resolved and were incorrect. |
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-05-13 12:55 UTC |
…uckets Rebuild target shards on delete so hash removal updates shard length accounting, and document the intentional freeChunks locking invariants while tightening delete and concurrency tests.
2c50037 to
0237eeb
Compare
|



Summary
Del()correctness forbucketNativeandbucketTrimmedby deleting from the correct shard while keeping shard length accounting accurate.bucketNativeusesfreeChunksLockbucketTrimmed/bucketUnallocatedrequire caller-heldb.muDel(k):Has(k) == falseGet(k)failsSet/Get/Del/Resetstress testValidation
go test ./stores/txmetacache -run '^$' -count=1(compile-only)