Repository navigation
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
approved these changes
Jul 31, 2026
XuPeng-SH
left a comment
Contributor
There was a problem hiding this comment.
Deep-reviewed current head 7d3e68d. Stopper admission and Stop linearization now own and join the task-scheduler ticker before NodeHost.Close, closing the shutdown race without coupling it to the HAKeeper tick loop. The close regression passed 100 race runs, TestTickerForTaskSchedule passed 44 race runs, and the full logservice race suite, build, and vet passed. No blocking issues found.
This was referenced Aug 1, 2026
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…n#26507) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#26487 ## What this PR does / why we need it: `store.ticker` launched the HAKeeper task scheduler as a raw goroutine. During logservice shutdown, `tickerStopper.Stop()` joined the parent HAKeeper ticker but not that detached child, so `NodeHost.Close()` could destroy Dragonboat state while the child was still executing `SyncRead`. This change registers the task scheduler with the existing `tickerStopper`. Scheduling remains independent from the HAKeeper tick and health-check loop, while shutdown now cancels and joins both loops before destroying the NodeHost. The regression test blocks the scheduler in checker-state lookup, starts `store.close`, proves the ticker stopper has entered its terminal admission state, and verifies close cannot complete until the scheduler exits. No SQL behavior, wire format, persisted data, configuration, or scheduling policy is changed. Tested with: `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=10m -run '^TestStoreCloseWaitsForTaskScheduleTicker$' ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=52 -timeout=10m -run '^TestTickerForTaskSchedule$' ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30m ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=30m -run '^TestBaseClusterCanWorkWithNewCluster$' ./pkg/embed` `go vet ./pkg/logservice` `go build ./pkg/logservice` Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…n#26507) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#26487 ## What this PR does / why we need it: `store.ticker` launched the HAKeeper task scheduler as a raw goroutine. During logservice shutdown, `tickerStopper.Stop()` joined the parent HAKeeper ticker but not that detached child, so `NodeHost.Close()` could destroy Dragonboat state while the child was still executing `SyncRead`. This change registers the task scheduler with the existing `tickerStopper`. Scheduling remains independent from the HAKeeper tick and health-check loop, while shutdown now cancels and joins both loops before destroying the NodeHost. The regression test blocks the scheduler in checker-state lookup, starts `store.close`, proves the ticker stopper has entered its terminal admission state, and verifies close cannot complete until the scheduler exits. No SQL behavior, wire format, persisted data, configuration, or scheduling policy is changed. Tested with: `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=10m -run '^TestStoreCloseWaitsForTaskScheduleTicker$' ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=52 -timeout=10m -run '^TestTickerForTaskSchedule$' ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30m ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=30m -run '^TestBaseClusterCanWorkWithNewCluster$' ./pkg/embed` `go vet ./pkg/logservice` `go build ./pkg/logservice` Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…n#26507) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#26487 ## What this PR does / why we need it: `store.ticker` launched the HAKeeper task scheduler as a raw goroutine. During logservice shutdown, `tickerStopper.Stop()` joined the parent HAKeeper ticker but not that detached child, so `NodeHost.Close()` could destroy Dragonboat state while the child was still executing `SyncRead`. This change registers the task scheduler with the existing `tickerStopper`. Scheduling remains independent from the HAKeeper tick and health-check loop, while shutdown now cancels and joins both loops before destroying the NodeHost. The regression test blocks the scheduler in checker-state lookup, starts `store.close`, proves the ticker stopper has entered its terminal admission state, and verifies close cannot complete until the scheduler exits. No SQL behavior, wire format, persisted data, configuration, or scheduling policy is changed. Tested with: `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=10m -run '^TestStoreCloseWaitsForTaskScheduleTicker$' ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=52 -timeout=10m -run '^TestTickerForTaskSchedule$' ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30m ./pkg/logservice` `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=30m -run '^TestBaseClusterCanWorkWithNewCluster$' ./pkg/embed` `go vet ./pkg/logservice` `go build ./pkg/logservice` Co-authored-by: XuPeng-SH <[email protected]>
This branch was previously deployed
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #26487
What this PR does / why we need it:
store.tickerlaunched the HAKeeper task scheduler as a raw goroutine. During logservice shutdown,tickerStopper.Stop()joined the parent HAKeeper ticker but not that detached child, soNodeHost.Close()could destroy Dragonboat state while the child was still executingSyncRead.This change registers the task scheduler with the existing
tickerStopper. Scheduling remains independent from the HAKeeper tick and health-check loop, while shutdown now cancels and joins both loops before destroying the NodeHost.The regression test blocks the scheduler in checker-state lookup, starts
store.close, proves the ticker stopper has entered its terminal admission state, and verifies close cannot complete until the scheduler exits.No SQL behavior, wire format, persisted data, configuration, or scheduling policy is changed.
Tested with:
.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=10m -run '^TestStoreCloseWaitsForTaskScheduleTicker$' ./pkg/logservice.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=52 -timeout=10m -run '^TestTickerForTaskSchedule$' ./pkg/logservice.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=30m ./pkg/logservice.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=30m -run '^TestBaseClusterCanWorkWithNewCluster$' ./pkg/embedgo vet ./pkg/logservicego build ./pkg/logservice