Repository navigation
test(embed): cover accepted commit during standalone shutdown - #28730
mergify[bot] merged 11 commits into
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head d76a14cb4497254252ddbc44d149218f696e8045. Two P2 test blockers remain:
-
Fault cleanup can strand the accepted transaction on assertion failure. In
issue_28012_28013_shutdown_test.go,defer fault.Disable()runs before the latert.Cleanup. If an assertion fails beforecommitRelease, the transaction remains blocked inFJ_CommitWait; Disable removes/stops the fault map but does not wake its WAIT channel, so cleanup cannot remove the fault andcluster.Close()may wait through TN drain (up to four minutes), leaving the worker stuck. Cleanup should release/remove the WAIT first, join launched goroutines, close the cluster, then disable faults. -
The test does not prove commit overlaps TN drain. The new hook is reached before cluster lock and service teardown. After observing hook entry, the test waits a fixed 200 ms then releases commit; CN/frontend shutdown may not yet have reached the TN drain dependency. A regression in TN drain ordering could therefore pass. Synchronize on the actual admission/drain boundary and the still-active accepted handler before releasing commit.
Exact-head CI run 34814895299 passed; the race-UT job took 49m40s total. I could not obtain per-test timing, so this is not evidence that the new case is below the ~45s single-test limit. No timing pass is claimed.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review(Astra medium,head 277d5e5)
REQUEST_CHANGES:发现 1 个 P2 测试生命周期问题;未确认 P0/P1 生产回归。
- [P2] issue_28012_28013_shutdown_test.go:233-235:sql.Open 启动 database 的 connection-opener goroutine,但当前在 Ping 成功前没有注册 cleanup。若 Ping 失败,require.NoError 会直接终止测试,调用方不会把该 DB 加入 dbs,DB.Close 也不会执行,可能遗留客户端 goroutine。建议 sql.Open 成功后立即注册 t.Cleanup/关闭登记,再执行 Ping;同时使用 PingContext(ctx),避免 Ping 使用 background context 逃逸测试的两分钟取消预算。
其余检查:shutdown 的 quiesce、active-handler drain、replica/storage teardown 顺序未发现新的所有权冲突;waiter 唤醒、commit/abort 终态和 restart/reuse 路径未发现新的 P0/P1。该测试确实改善了 accepted-commit during standalone shutdown 的回归覆盖,但 500ms negative-observation window 不是 scheduler-independent proof,且当前 head 的 build/UT/SCA/coverage 仍在 CI 中。
|
已按最新 review 修复并 push(
验证:
未手动触发外部测试环境;push 后的 required CI 由 GitHub 自动运行。 |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review (Astra medium, exact head 4275fc0)
APPROVE.
Reviewed all changed hunks in all eight files, including tenant-selector consumers, accepted-handler accounting, standalone shutdown ordering, WAIT removal, assertion-failure cleanup, restart ownership, and transaction atomicity oracles.
No concrete blocking findings remain. The previous DB cleanup defect is fixed: registration precedes PingContext, with focused failure/cancellation coverage. This is regression coverage with narrow fault-injection hooks; the large-feature design gate does not apply. The dedicated cluster is justified by destructive shutdown and restart.
Reused exact-head CI run 35304429553, including confirmed execution and passing race results for the shutdown scenario and both DB cleanup tests. git diff --check passed.
|
Queued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 56 minutes 5 seconds in the queue, including 55 minutes 46 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #28012
issue #28013
What this PR does / why we need it:
Adds focused standalone lifecycle regression coverage for #28012 and #28013.
WaitWalAndTailand beforeon1PCApplywithout stalling unrelated tenants;embed.Cluster.Close()path while that transaction is held, lets transaction-server drain advance, and verifies that TN teardown and full standalone shutdown cannot complete before the accepted handler reaches a terminal state;PingContext, with focused tests for ping failure and context cancellation;This PR adds regression coverage and test instrumentation only; it does not change normal production shutdown behavior.
Verification
pkg/objectio,pkg/tnservice,pkg/txn/rpc, andpkg/vm/engine/tae/txn/txnbasetests: passed;