Repository navigation
test(logservice): synchronize TestFailedBootstrap - #28553
Conversation
|
The prior arm64 SCA blocker #28546 is resolved on This PR is now rebased onto current |
047ce69 to
818a4a5
Compare
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? |
818a4a5 to
e59b557
Compare
e59b557 to
c04a565
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head e59b5573249a85f0c37a04ed67e21e33a1248e10 against base/merge-base f6aa238d6d535a344ee41d23d5f3bbcf9ecd7912. No blocker found.
The fail branch now exercises the existing explicit-time seam with the real replicated state setter and checks its error. The supplied time is at or after the established deadline: bootstrap first sets now+window, and the later test call supplies a later now+the same window. The predicate uses !now.Before(deadline), so equality is also expired; there is no sleep or scheduling race needed to reach failure. The manual fixture in the current base disables the background ticker before startup, eliminating a competing deadline/state owner.
The final HAKeeperBootstrapFailed assertion remains intact, while normal bootstrap and remote WAL-recovery controls still use their existing paths. Fresh-store isolation, deferred store cleanup, proposal timeout/cancellation, and leak checks are preserved. This small test-only change adds no resources, shared global mutation, platform-specific code, or meaningful runtime cost; feature-design and SQL BVT gates are not applicable.
git diff --check passed. The PR records named normal control runs and TestFailedBootstrap under -race -count=100 (22.131s); no duplicate long test or CI wait was performed for this force review. Approval is for the reviewed code, not a claim that pending Linux CI has completed.
c04a565 to
af555e4
Compare
## What type of PR is this? - [x] BUG - [ ] API-change - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#28551 ## What this PR does / why we need it: ### Root cause Before the current `main` baseline, `TestFailedBootstrap` directly overwrote `bootstrapCheckDeadline` while the HAKeeper ticker could read it. The broader fixture race is now eliminated by matrixorigin#28554, which runs manual bootstrap tests with workers disabled. This test still bypassed the deadline owner to force expiry instead of using the existing explicit-time bootstrap-check seam. ### Changes - Drive failure expiry through `checkBootstrapWithSetterAt` with a deliberately expired time. - Use the production state setter and require that the replicated state transition succeeds. - Preserve the failure oracle: incomplete bootstrap transitions to `HAKeeperBootstrapFailed`. ### Issue-to-test proof `TestFailedBootstrap` exercises the same incomplete-bootstrap failure path without mutating the production-owned deadline. The normal bootstrap and remote WAL-recovery consumers of the shared helper remain covered as controls. ### Tests - `.agents/skills/mo-dev/scripts/mo-cgo-test -list ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice` (passed after rebase onto main@ac660ae56e, 1.545s) - `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=240s -run ^TestFailedBootstrap$ ./pkg/logservice` (passed after rebase onto main@ac660ae56e, 19.269s) BVT is not applicable: this is an internal Go test ownership and state-transition contract with no SQL or client-visible behavior. ### Residual risk Production code is unchanged. matrixorigin#28554 in the base branch owns ticker isolation for manual bootstrap fixtures; this PR is limited to the deadline-driving seam. Fresh Linux CI is required after the rebase.
## What type of PR is this? - [x] BUG - [ ] API-change - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#28551 ## What this PR does / why we need it: ### Root cause Before the current `main` baseline, `TestFailedBootstrap` directly overwrote `bootstrapCheckDeadline` while the HAKeeper ticker could read it. The broader fixture race is now eliminated by matrixorigin#28554, which runs manual bootstrap tests with workers disabled. This test still bypassed the deadline owner to force expiry instead of using the existing explicit-time bootstrap-check seam. ### Changes - Drive failure expiry through `checkBootstrapWithSetterAt` with a deliberately expired time. - Use the production state setter and require that the replicated state transition succeeds. - Preserve the failure oracle: incomplete bootstrap transitions to `HAKeeperBootstrapFailed`. ### Issue-to-test proof `TestFailedBootstrap` exercises the same incomplete-bootstrap failure path without mutating the production-owned deadline. The normal bootstrap and remote WAL-recovery consumers of the shared helper remain covered as controls. ### Tests - `.agents/skills/mo-dev/scripts/mo-cgo-test -list ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice` (passed after rebase onto main@ac660ae56e, 1.545s) - `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=240s -run ^TestFailedBootstrap$ ./pkg/logservice` (passed after rebase onto main@ac660ae56e, 19.269s) BVT is not applicable: this is an internal Go test ownership and state-transition contract with no SQL or client-visible behavior. ### Residual risk Production code is unchanged. matrixorigin#28554 in the base branch owns ticker isolation for manual bootstrap fixtures; this PR is limited to the deadline-driving seam. Fresh Linux CI is required after the rebase.
## What type of PR is this? - [x] BUG - [ ] API-change - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#28551 ## What this PR does / why we need it: ### Root cause Before the current `main` baseline, `TestFailedBootstrap` directly overwrote `bootstrapCheckDeadline` while the HAKeeper ticker could read it. The broader fixture race is now eliminated by matrixorigin#28554, which runs manual bootstrap tests with workers disabled. This test still bypassed the deadline owner to force expiry instead of using the existing explicit-time bootstrap-check seam. ### Changes - Drive failure expiry through `checkBootstrapWithSetterAt` with a deliberately expired time. - Use the production state setter and require that the replicated state transition succeeds. - Preserve the failure oracle: incomplete bootstrap transitions to `HAKeeperBootstrapFailed`. ### Issue-to-test proof `TestFailedBootstrap` exercises the same incomplete-bootstrap failure path without mutating the production-owned deadline. The normal bootstrap and remote WAL-recovery consumers of the shared helper remain covered as controls. ### Tests - `.agents/skills/mo-dev/scripts/mo-cgo-test -list ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice` - `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice` (passed after rebase onto main@ac660ae56e, 1.545s) - `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=240s -run ^TestFailedBootstrap$ ./pkg/logservice` (passed after rebase onto main@ac660ae56e, 19.269s) BVT is not applicable: this is an internal Go test ownership and state-transition contract with no SQL or client-visible behavior. ### Residual risk Production code is unchanged. matrixorigin#28554 in the base branch owns ticker isolation for manual bootstrap fixtures; this PR is limited to the deadline-driving seam. Fresh Linux CI is required after the rebase.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of the fix for issue #28551. The supplied /pull/28551 URL resolves to that issue; #28553 is its corresponding merged fix.
Reviewed exact head af555e451d1e7ded09f2aca42213acc63236a04a against base/merge-base ac660ae56ecd37bab3dd8c61193617a323377029: one test file, 4 additions / 4 deletions. No code blocker found.
- Root-cause closure: #28554's manual fixture is already in this base. It sets
DisableWorkersbefore store construction, andstartHAKeeperReplicachecks that flag before launching the ticker. The manual test therefore owns the bootstrap deadline/manager/callback. Merely changing the deadline assignment would not fix the original race without this prerequisite. - Correctness and unhappy paths: bootstrap establishes a nonzero deadline at an earlier
time.Now()+window; the test supplies a latertime.Now()+the same window, so the existing!now.Before(deadline)predicate takes the expiry branch without a scheduler-dependent sleep. The realsetBootstrapStateremains in use, its error is now required to be nil, and the subsequent replicated-state read still requiresHAKeeperBootstrapFailed. Existing deadline-before/at/after, setter-error, success, and remote-WAL-recovery controls remain intact. - Lifecycle/engineering: the fixture retains its deferred store shutdown and leak check; the change adds no resources, waits, global state, production locks, or background workers. It reuses the existing explicit-time seam, adds no production code and no net lines, and introduces no production performance cost. No additional design document or SQL BVT is warranted for this test-only change.
Evidence: the author records focused normal controls and TestFailedBootstrap -race -count=100 after rebasing to this base (19.269s), and the exact-head arm64 SCA check succeeded. This review inspected exact-revision source and the complete diff; it did not rerun those tests.
Validation limit: exact-head CI run 34429102291 finished with a failed Ubuntu/x86 UT job (102720745075) and failed CI Required. Its retained annotation says only Process completed with exit code 2; the run-log API now returns HTTP 410. Consequently I cannot attribute that failure to another module or claim the full package/CI was green. The no-code-blocker conclusion above is not a clean-CI certification.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28551
What this PR does / why we need it:
Root cause
Before the current
mainbaseline,TestFailedBootstrapdirectly overwrotebootstrapCheckDeadlinewhile the HAKeeper ticker could read it. The broader fixture race is now eliminated by #28554, which runs manual bootstrap tests with workers disabled. This test still bypassed the deadline owner to force expiry instead of using the existing explicit-time bootstrap-check seam.Changes
checkBootstrapWithSetterAtwith a deliberately expired time.HAKeeperBootstrapFailed.Issue-to-test proof
TestFailedBootstrapexercises the same incomplete-bootstrap failure path without mutating the production-owned deadline. The normal bootstrap and remote WAL-recovery consumers of the shared helper remain covered as controls.Tests
.agents/skills/mo-dev/scripts/mo-cgo-test -list ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run ^(TestFailedBootstrap|TestBootstrap|TestBootstrapWaitsForRemoteWALRecovery)$ ./pkg/logservice(passed after rebase onto main@ac660ae56e, 1.545s).agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=240s -run ^TestFailedBootstrap$ ./pkg/logservice(passed after rebase onto main@ac660ae56e, 19.269s)BVT is not applicable: this is an internal Go test ownership and state-transition contract with no SQL or client-visible behavior.
Residual risk
Production code is unchanged. #28554 in the base branch owns ticker isolation for manual bootstrap fixtures; this PR is limited to the deadline-driving seam. Fresh Linux CI is required after the rebase.