Conversation
Contributor
|
✅ No conflicts with other open PRs targeting |
Contributor
|
I see you updated files related to
|
The single-instance check was broken in two ways: it was global, so a shard_assignment job could not run alongside a settings job, and the activeJobID pointer was never stored, so the 'already active' error could never actually fire. Track the active job ID per config type (settings / shard_assignment) in a sync.Map. ServicesForSpec validates the config type and claims the slot atomically via LoadOrStore, so one settings job and one shard_assignment job may coexist while a second job of the same type is rejected. OnDeleteJob frees the slot only if it is held by the deleted job's ID, so deleting a rejected duplicate cannot evict the active job.
bolekk
force-pushed
the
fix-cresettings-job-check-per-config-type
branch
from
September 21, 2026 18:36
f84dfd9 to
a0cf664
Compare
bolekk
marked this pull request as ready for review
September 21, 2026 18:36
bolekk
requested review from
jmank88,
justinkaseman,
mchain0 and
pavel-raykov
September 21, 2026 18:36
|
bolekk
enabled auto-merge
September 21, 2026 19:20
justinkaseman
approved these changes
Sep 21, 2026
bolekk
disabled auto-merge
September 22, 2026 00:13
mchain0
approved these changes
Sep 22, 2026
mchain0
added this pull request to the merge queue
Sep 22, 2026
Any commits made after this event will not be merged.
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.




Problem
The check enforcing a single CRESettings job instance in
core/services/cresettings/delegate.gowas broken in two ways:shard_assignmentjob could not run while asettingsjob was active, even though they write to separateloop.AtomicSettingsstores.activeJobIDwas only everLoaded andCompareAndSwaped — never stored — so theanother CRESettings job is already activeerror was unreachable, andOnDeleteJobalways loggedjob was not active.Fix
settings/shard_assignment) in async.Map.ServicesForSpecvalidates the config type, then claims the slot atomically viaLoadOrStore— one settings job and one shard_assignment job may now coexist, while a second job of the same config type is rejected.OnDeleteJobfrees the slot only if it is held by the deleted job's ID (CompareAndDelete), so deleting a rejected duplicate cannot evict the active job's slot.configTypehelper guarantees the start and delete paths derive the same slot key.Deployment Validation