Repository navigation
fix: release embedded cluster ownership after terminal cleanup - #29048
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.
Astra medium deep review at exact head f25cd2c. COMMENT ONLY (self-authored PR).\n\nNo confirmed P0/P1/P2 findings. Reviewed terminal cleanup/error certification, ownership retention and matching release, repeated Close/idempotence, detached-CN dependency ordering, rollback/restart blocking, frontend admission sealing and concurrent stop, Sirius/pipeline cleanup, and retained-state bounds. No new double release, leak, deadlock, unbounded retention, or liveness defect found.\n\nTests cover completed-error release, incomplete-owner preservation, rollback, shared-fixture reset, concurrent stop, pre-registration connections, and pipeline/runtime ordering; new synchronization uses barriers rather than sleeps. Exact-head Ubuntu race CI selected all owning packages and passed; coverage UT, SCA, shared build, and active BVTs also passed.\n\nResidual notes: local tests and claimed 100-repeat focused runs were not independently reproduced; fail-stop behavior for unclassified cleanup errors remains intentional, and the original heartbeat-timeout trigger is not changed.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #29044
What this PR does / why we need it:
A failed CN final metadata-withdrawal heartbeat is cached by
Close. Embedded cleanup treated every close error as unfinished work, so it retained the completed CN, its TN/log dependencies, and the complete-cluster admission lease forever. Subsequent tests then failed admission rather than testing their own behavior.Separate local completion from diagnostic errors. CN certifies completion only after local cleanup succeeds, while preserving the withdrawal error and remote generation fencing. Embed consumes this ownership contract to finish reverse cleanup and release leases even when returning a diagnostic. Unknown local/drain failures remain conservative: dependencies and cleanup owners are retained.
Make that completion assertion safe: frontend shutdown seals accepted-connection admission and joins connection handlers including deferred session cleanup. Cancel/join pipeline users before retiring Sirius/Mongo runtimes. Detached pending CNs close before TN/WAL dependencies; incomplete startup owners cannot be overwritten by another Start. Rollback and shared fixtures clear only completed owners.
Validation
TestAutoIDCacheRestartAndDisabledNodepasses under race (35.99s test time), preserving the original SQL assertions and three real close/admission-release cycles.01a0ae02-a9bf-7311-b8bd-a341229dad00; review agent01a0ae13-2848-7603-b11a-e244fb8a62c9,gpt-6-astra/ medium, final diff SHA-2566cf2e4bfd88c553553b34a2b9448b9d5db4d3a39aab77e96689e74f717f2eca2.No new real-cluster fixture, BVT, sleep, retry, deadline extension, or weakened SQL assertion. New cases use existing fakes and barriers. This removes a demonstrated retained-service/admission cascade; no overall CI wall-time saving is claimed without same-mode CI measurement.
Local evidence uses Go 1.26.4 on Darwin arm64 with provenance-checked, independently built native libraries. The original HAKeeper timeout trigger is not established by this change. Unclassified local teardown errors remain fail-stop rather than being falsely certified complete. CI validation on Ubuntu/race is pending.