Repository navigation
Description
Is there an existing issue for the same bug?
- I searched open issues and pull requests for
fixedSlice, lockservice refcount, invalid refcount, and the observed index-out-of-range panic.
Branch Name
main
Commit ID
b870113dab4d340b42ea0b489aae3430b49be6e1
Other Environment Information
- OS: macOS arm64
- Go: 1.26.4
- Package:
pkg/lockservice
Actual Behavior
cowSlice.slice loads the current fixedSlice pointer and then increments its reference count unconditionally. A concurrent COW replacement can retire that object and reduce its reference count to zero between those two operations. The reader then revives the retired object from zero, fails the generation check, and returns the same object to sync.Pool a second time.
Measured on the exact commit above, a deterministic production-path interleaving makes one retired fixedSlice execute two effective pool releases. This can give two live owners the same pooled object. In the multi-CN QA for #27806, CN2 subsequently observed a capacity-1 slice with stale length 1 and panicked in fixedSlice.append; that incident is supporting evidence, while the deterministic double-release oracle is the current-main proof.
Expected Behavior
Once a fixedSlice reference count reaches zero, stale readers must not resurrect it. Each generation must have exactly one effective return to the pool, and a pooled object must have only one live acquisition owner.
Steps to Reproduce
- Create a capacity-1
cowSlice. - Enter
cowSlice.sliceafter it captures the current version and pointer but before it acquires a reference. - Force a real
cowSlice.appendCOW replacement from that barrier. - Let the replacement publish the new pointer, advance the version, and unref the old object to zero.
- Resume the reader.
- On current main, the unconditional
ref()revives the old object; the failed version CAS thenunref()s it and releases it a second time.
Focused oracle: TestCowSliceSliceReadConcurrentWithAppend
- Base result:
FAIL, expected one release but observed two. - Test-only barrier patch SHA-256:
a353103622f372112aa40f195d8c4a69715c135e65ac98b2a7bc65c03f79c4d0. - The test uses the real
slice -> append -> replace -> unref -> pool releasepath and no sleeps.
Additional information
- Observed fix(fulltext2): fence cross-CN cache generations #27806 QA evidence: fix(fulltext2): fence cross-CN cache generations #27806 (comment)
- Inferred incident chain: duplicate pool ownership can let one owner publish a non-zero length while another owner sees the same capacity-1 storage, producing the observed append bound violation.
- Pending validation: focused/race/package tests, dependent
mo-servicebuild, allocation/performance comparison, and independent multi-CN smoke after the fix. - QA required: yes, because this is a shared-state lifecycle bug that can crash a CN.
Activity
fix(lockservice): prevent fixedSlice refcount resurrection (#27928)
VioletQwQ-0 commentedon Sep 2, 2026
补充 #27884 修复后的独立多 CN 产品烟测证据。
版本与环境
c7fb30d91ed46e6b9d0a0a6cde4af2f690bef37f44b0803bdc64e1169fa60a603786bee3a5972abc,已确认包含上述 merge commitpr27806:44b0803-arm64sha256:68290448b5db2bbad5484e6cdb892bcb7395451f7cb3145f7cffe85cf4c9f58665ca8b42839dacf812a584de72a633a5d8f2a29902729c8321b324ff4915cea1场景与终态
该运行是 #27806 的精确头直连矩阵,同时覆盖了此前发现 #27884 时被
fixedSlice.appendpanic 阻断的多 CN 产品路径:结构化终态:
MATRIX_PASSPASSgeneration 从 setup
0:1经 INSERT0:2、UPDATE0:4、DELETE0:5、lost RPC0:6收敛至 sender interruption0:7。QA 结论与边界
这份证据满足 #27928 PR 描述中尚缺的“修复后 Linux/arm64 独立多 CN smoke”技术门禁。它与 #27928 已有的确定性 unit/race 证据共同覆盖:
fixedSlice.appendpanic、hang 或异常退出本评论是自动化/产品烟测证据关联,不代替测试人员或 issue owner 的正式 QA 接受。关闭 #27884 前仍需明确的 tester/owner PASS,包含测试版本、环境和终态结果;GitHub CI 结论也是独立门禁。
VioletQwQ-0 commentedon Sep 3, 2026
@Ariznawlll 该问题现转入测试验收,请复核并正式接受现有 smoke 证据,不需要重新执行完整多 CN 矩阵。
修复版本
MERGEDe5d3ff5937cc1caed7ad937701eeab4827bda388c7fb30d91ed46e6b9d0a0a6cde4af2f690bef37f1092ab739c120052fff0b8d1ff27854663cd098f44b0803bdc64e1169fa60a603786bee3a5972abc,已确认包含上述 merge commit已有验证证据
pr27806:44b0803-arm64sha256:68290448b5db2bbad5484e6cdb892bcb7395451f7cb3145f7cffe85cf4c9f58665ca8b42839dacf812a584de72a633a5d8f2a29902729c8321b324ff4915cea1MATRIX_PASS,teardownPASS,fatal scan 为空,未观察到 CN panic、hang 或异常退出本次验收范围
请仅检查上述精确版本、环境、覆盖场景和结构化终态是否足以接受 #27884 的修复,不要求重新跑完整矩阵。PR 页面现存的 SCA runner 失联和 TKE BVT 75 分钟超时,按 issue owner 本次决定不作为转测/验收阻塞,也不要求重跑。
如证据可接受,请回复明确的
PASS,并带上接受的版本、环境及终态;如不可接受,请回复FAIL并指出具体证据缺口或不符合项。在收到明确 PASS 前,该 issue 保持 OPEN 和phase/testing。Ariznawlll commentedon Sep 5, 2026
测试验收结论
c7fb30d91ed46e6b9d0a0a6cde4af2f690bef37f44b0803bdc64e1169fa60a603786bee3a5972abc覆盖场景
结果
MATRIX_PASSPASSfixedSlice.appendpanic、CN panic、hang 或异常退出结论
修复后的真实多 CN 产品路径验证通过,满足本 issue 的验收条件,现关闭 issue。
fix(lockservice): prevent fixedSlice refcount resurrection (matrixori…
fix(lockservice): prevent fixedSlice refcount resurrection (matrixori…
fix(lockservice): prevent fixedSlice refcount resurrection (matrixori…
[4.2-dev] fix(lockservice): prevent fixedSlice refcount resurrection (#…