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
left a comment
There was a problem hiding this comment.
Approved exact head 37bcb74 after full scheduling-closure review.
The fix preserves the running-task frequency in each eligible candidate view and records only successful allocations in the shared per-round pool, so later Created tasks observe earlier reservations. Label/resource/expiry filtering remains unchanged. The new selectCNs construction also replaces repeated heap insertion with a linear copy plus heap.Init.
Reviewed ordinary, filtered, existing-load, allocation-failure, expired-CN, and dependent logservice paths. No remaining correctness, lifecycle, unbounded-growth, or material performance blocker found.
Local validation on the exact head: four focused regressions each passed under race at count=100; the full pkg/hakeeper/task package passed under race; dependent task-scheduler logservice regressions passed under race; scoped go vet passed.
…#26537) ## 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#25833 ## What this PR does / why we need it: HAKeeper rebuilt a filtered CN pool for every Created task, but that pool reset the Running-task frequencies. A successful allocation then updated only the temporary pool, so the next task in the same scheduling round saw the same stale load snapshot and could select the same CN repeatedly. This PR: - preserves source frequencies when filtering a CN pool; - selects from the per-task eligible view but records a successful allocation in the shared round pool; - leaves failed allocations out of the load count; - adds regressions for existing load, batch scheduling, label/resource filtering, and allocation failure. The change does not alter label/resource eligibility, expired-CN handling, task persistence, timeout behavior, or tie-breaking. Tested with: `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '<each focused regression>' ./pkg/hakeeper/task` `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/hakeeper/task` `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -run '^TestTaskSchedulerCan(ScheduleTasksToCNs|ReScheduleExpiredTasks)$' ./pkg/logservice` `go build -mod=readonly ./pkg/hakeeper/task` `go vet -mod=readonly ./pkg/hakeeper/task` Co-authored-by: XuPeng-SH <[email protected]>
…#26537) ## 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#25833 ## What this PR does / why we need it: HAKeeper rebuilt a filtered CN pool for every Created task, but that pool reset the Running-task frequencies. A successful allocation then updated only the temporary pool, so the next task in the same scheduling round saw the same stale load snapshot and could select the same CN repeatedly. This PR: - preserves source frequencies when filtering a CN pool; - selects from the per-task eligible view but records a successful allocation in the shared round pool; - leaves failed allocations out of the load count; - adds regressions for existing load, batch scheduling, label/resource filtering, and allocation failure. The change does not alter label/resource eligibility, expired-CN handling, task persistence, timeout behavior, or tie-breaking. Tested with: `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '<each focused regression>' ./pkg/hakeeper/task` `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/hakeeper/task` `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -run '^TestTaskSchedulerCan(ScheduleTasksToCNs|ReScheduleExpiredTasks)$' ./pkg/logservice` `go build -mod=readonly ./pkg/hakeeper/task` `go vet -mod=readonly ./pkg/hakeeper/task` Co-authored-by: XuPeng-SH <[email protected]>
…#26537) ## 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#25833 ## What this PR does / why we need it: HAKeeper rebuilt a filtered CN pool for every Created task, but that pool reset the Running-task frequencies. A successful allocation then updated only the temporary pool, so the next task in the same scheduling round saw the same stale load snapshot and could select the same CN repeatedly. This PR: - preserves source frequencies when filtering a CN pool; - selects from the per-task eligible view but records a successful allocation in the shared round pool; - leaves failed allocations out of the load count; - adds regressions for existing load, batch scheduling, label/resource filtering, and allocation failure. The change does not alter label/resource eligibility, expired-CN handling, task persistence, timeout behavior, or tie-breaking. Tested with: `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '<each focused regression>' ./pkg/hakeeper/task` `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/hakeeper/task` `./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -run '^TestTaskSchedulerCan(ScheduleTasksToCNs|ReScheduleExpiredTasks)$' ./pkg/logservice` `go build -mod=readonly ./pkg/hakeeper/task` `go vet -mod=readonly ./pkg/hakeeper/task` Co-authored-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
issue #25833
What this PR does / why we need it:
HAKeeper rebuilt a filtered CN pool for every Created task, but that pool reset the Running-task frequencies. A successful allocation then updated only the temporary pool, so the next task in the same scheduling round saw the same stale load snapshot and could select the same CN repeatedly.
This PR:
The change does not alter label/resource eligibility, expired-CN handling, task persistence, timeout behavior, or tie-breaking.
Tested with:
./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -run '<each focused regression>' ./pkg/hakeeper/task./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 ./pkg/hakeeper/task./.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -run '^TestTaskSchedulerCan(ScheduleTasksToCNs|ReScheduleExpiredTasks)$' ./pkg/logservicego build -mod=readonly ./pkg/hakeeper/taskgo vet -mod=readonly ./pkg/hakeeper/task