fix(incrservice): keep lazy cleanup cancelable - #26883
Merged
Merged
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? |
gouhongshen
approved these changes
Aug 9, 2026
gouhongshen
left a comment
Contributor
There was a problem hiding this comment.
Codex automated review
No blocking or non-blocking defects found. Existing discussion contained no substantive reviews or inline findings; focused tests were blocked by missing native headers.
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
TestHashBuildSharedBudgetRecoverySQLcompleted its main workload, but CN shutdown joined the auto-increment cleanup worker while it was deleting metadata for a dropped table. The delete inheritedWithWaitCommittedLogAppliedinto the nested SQL execution. After the transaction committed,SyncLatestCommitTSwaited with its own five-minute background timeout and did not observe the cleanup worker context, so teardown ended in the five-minute fatal timeout seen in both PR #26850 and PR #26806.A second deep-review pass found that the successful account lookup result was overwritten by the subsequent delete result when the tenant existed. Its batches therefore never reached
Result.Close, retaining their mpool allocation for every cleaned table. The lookup result is now closed immediately after reading it, and the test uses a real allocated result to verify thatCurrNBreturns to zero.Safety
This delete is lazy GC for a globally allocated table ID that is not reused. Commit durability is sufficient; no later operation requires the same CN to observe the deletion immediately. Failed deletes remain in the destroyed-table set and are retried. Allocation and offset mutation paths retain their committed-logtail waits.
Validation
TestDeletego test ./pkg/incrservicego test -race ./pkg/incrserviceT=0/0/0.06s,B=30s,N=100TestHashBuildSharedBudgetRecoverySQLnormally and under race; raceT=18.28s,B=30s,N=1go build ./pkg/incrservicego vet ./pkg/incrservicegolangci-lint run ./pkg/incrservice/...(0 issues)Failure examples: