Skip to content

test(embed): renew SQL deadline after restart admission - #29398

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
aunjgr:fix/28012-restart-sql-context
Sep 27, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
aunjgr:fix/28012-restart-sql-context

Conversation

@aunjgr

@aunjgr aunjgr commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Refs #28012, #28013, and the CI failure on #29254. This does not close either issue.

Review notes

The UT coverage job failed in TestIssue28012And28013AcceptedCommitDuringStandaloneShutdown after the restarted cluster waited 2m15s to reacquire shared embedded-cluster admission. Its pre-shutdown SQL context had a two-minute deadline; the first post-restart PingContext therefore received context deadline exceeded. The coverage aggregator failed only because this UT producer did not publish a complete profile.

Validated on current main using the existing Pixi GCC 14 toolchain, without a container: exact test selected and passed with coverage (20.2s) and race (24.7s); the owning pkg/tests/issues/isolated package passed (167.9s). Incremental go vet, golangci-lint, gofmt, and diff checks passed. Full CI is pending on this PR.

What this PR does / why we need it:

Give post-restart SQL verification a fresh two-minute context only after the embedded cluster reacquires admission. Cancel the pre-shutdown context when that phase ends and retain all accepted-commit, durability, and cleanup assertions.

@aunjgr
aunjgr requested a review from XuPeng-SH as a code owner September 27, 2026 03:51
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review of 47e17587fb0dced0a18631e98d9f98dfd64b44f9, with current main a73f14eee3e6e36bd987d11beee35b329de6d5cf and merge-base 9c6fcb5b501d040ab1bcb5ada139939770468638: no blocking findings.

The full diff is one test file, +12/-15. The fix addresses the cause of the reported CI failure: the pre-shutdown SQL deadline previously continued expiring while cluster.Start() reacquired runner-wide admission. A separate context created after successful restart gives the verification phase its own bounded SQL budget. Every post-restart SQL operation uses that context. Accepted-commit, all-or-nothing durability and subsequent-write assertions are retained unchanged.

Closure Review result
Context ownership / failure cleanup (Q1) Both contexts have deferred cancellation, including assertion FailNow; the first is also canceled before restart. Deferred cancellation runs before t.Cleanup, which releases WAIT fault points, joins workers and closes registered DBs/cluster. DB registration precedes Ping, so Ping failure remains cleanable.
Wait / restart boundary (Q2) Admission wait is excluded from both SQL budgets. Existing commit/shutdown waits and barriers remain intact. This patch does not bound the shared admission wait itself; it fixes the expired SQL context after that wait completes.
Retained resources (Q3) One additional bounded-lifetime context/timer; no new worker, queue, retained collection or fixture.

Engineering/performance: minimal local fix, net three lines removed, no production hot-path or protocol change, no extra cluster startup, sleeps or retry loop. An ordinary test-maintenance fix does not need a design document or a new BVT. Reproducing the queue delay by adding a multi-minute sleep would be unnecessary test cost. This PR appropriately references rather than closes #28012/#28013: it repairs test infrastructure and does not establish that those broader production issues are fully resolved.

Evidence: inspected the complete diff and unchanged dependent fixture/admission/DB-cleanup paths; diff check passed. GitHub checks report the Ubuntu UT job and arm64 SCA job passed. The PR body reports focused coverage/race and owning-package passes; those local runs were not independently rerun in this review. Skipped coverage/upgrade checks are not treated as passes. No new runtime tests or production changes were made.

@mergify mergify Bot added the queued label Sep 27, 2026
@mergify

mergify Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-27 10:38 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-09-27 10:39 UTC · at 66e89ff6c1ece72ce39969fcedb13153c87d9fd8

This pull request spent 41 seconds in the queue, with no time running CI.

Reason

Pull request #29398 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants