fix(lockservice): recover active txn checks after CN recreation#25651
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Blocking issue:
Why I think this is a real bug:
Suggestion:
|
|
合理采纳并已修复,提交 7b18585。 根因是 ResetBackend 虽然为 refresh/reset gate 使用了 bounded context,但 pre/post-refresh 两次 snapshot lookup 仍调用 context-insensitive API;built-in cluster 未 ready 时会阻塞在 readyC,并持续占用全局 reset slot。 修复:
验证:新回归 count=50;相关 race count=10;完整 clusterservice/common-morpc/lockservice 测试、go vet、go build、git diff --check 均通过。分支已 rebase 到最新 main。 |
|
已系统性核验并合理采纳,修复提交 308a27b。 采纳:
Decision log:
验证:新增 queue/session/drain 测试 count=50;相关 race count=10;完整 clusterservice/common-morpc/lockservice/metric 测试、go vet、go build、git diff --check 全部通过。 |
|
Another blocker on the latest head:
Why this matters:
There is even a test locking in the stale-pin behavior today: Suggestion:
|
|
合理采纳并已修复,提交 5e7326f。 这个 blocker 的本质是:refresh 失败必须保持业务状态 unknown,但 route invalidation 必须是单调的;已被负响应证明可疑的 endpoint 不能因为 control-plane 失败而重新变成可用 hint。 修复:
测试更新:
验证:ResetBackend count=50;相关 recovery race count=10;完整 clusterservice/common-morpc/lockservice/metric 测试、go vet、go build、git diff --check 均通过。分支已 rebase 到最新 main 78f14f9。 |
|
已复审当前 head 此前提出的 correctness/lifecycle blockers 均已闭环:peer 本地验证通过:
结论:可以合入。 |
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #25650
What this PR does / why we need it:
Fixes TN-side lockservice recovery after CN hot recreation without restarting TN.
GetActiveTxnrecovery path, avoiding stale long-lived CGO hostname resolution while leaving normal lock/transaction hot paths unchanged.Valid=falseresponse after resetting the endpoint, preventing a stale IP reassigned to another CN from being treated as an authoritative response.Validcommit admission with invalid-CN fencing and protectsResumefrom stale cleanup re-fencing.Validation:
go test ./pkg/common/morpc -count=1go test ./pkg/lockservice -count=1-race, repeated 10/20 times)make dev-buildwith typecheckBenchmarkValidDuringRecoveryChanges: 125-145 ns/op, 0 B/op, 0 allocs/op