Repository navigation
cluster: approval check follow-ups (lock race, older follower, own log lines, converge on none) - #1666
Merged
Conversation
Second delta review of PR 1661, item 3. When a coordinator-paired part ended, ClusterService read the last "Error:" line of the whole rank log. A part that ended without an error line of its own was then judged by an earlier part's line, for example an earlier "coordinator could not be reached", and its quick end was not counted. The service now records the log offset where each part begins writing and reads only from there (`ClusterService.lastError(in:from:)`). A log shorter than the offset was replaced and is read whole. Row: ClusterApprovalWatchTests.aPartsQuickEndsAreCountedFromItsOwnLogLinesOnly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…one" Second delta review of PR 1661, item 2. A follower whose build does not report `approvalID` in its status sent no field, which decoded as nil and read as "no approval": the leader would then converge an offered pair to none against a follower that may carry the approval. Each Mac now reports `approvalID` always, "" for none. ClusterApprovalCheck.peerApprovalID reads an absent field (an older build) or no answer as unknown, so macsDiffer is false and nothing converges. Row: ClusterApprovalWatchTests.aFollowerThatDoesNotReportItsApprovalIsNeverTakenForOneWithout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… not offered Second delta review of PR 1661, item 4. When the leader still held a cluster approval it does not offer (it ended, or the cluster serves locally only) and the other Mac held none or another, the check converged on none: it sent "none" to the other Mac and said "neither Mac carries one now", but the leader kept its own, so the line was not true and every check found the same difference again. ClusterApprovalSync.converge(nil) now also saves the leader's setup without the cluster approval it holds. Row: ClusterApprovalWatchTests.convergingOnNoneAlsoClearsTheLeadersApprovalThatIsNotOffered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… before any stop Second delta review of PR 1661, item 1, and review finding 3. - ClusterService.checkApproval read the saved setup, the record and the other Mac's status and computed the step before it took the command lock, then acted on that step. A person's command could change the setup, the scope or the other Mac in between. The step is now decided again under the lock, from the setup, record and status as they are then, with the same coordinator answer (the coordinator is asked at most once per check). - ClusterApprovalSync.apply runs the change: a save is first checked against the leader's own files and pairing (ClusterApprovalAttachment.attachment), so no part stops for an approval the leader refuses; then the parts stop, the change runs on both Macs, and the parts start again. - A busy command lock no longer retries at every tick: the check backs off to the next minute and says so in the log. Row: ClusterApprovalWatchTests.noPartStopsForAnApprovalTheLeadersOwnCheckRefuses (refused: no stop, nothing sent or started; a stop that fails changes and starts nothing; accepted: one stop, both Macs saved, one start). The lock race and the back-off live in the service loop's thread and the per-user command lock file; they have no row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model-free onboarding checks (provider-swift/Tests/ClusterOnboardingChecks, a real pseudo-terminal with scripted operations, compiled with plain swiftc) ran only by hand, so leaderWaitsForThePartsAfterTheRegistration (PR 1661) had no CI run. They now run as a step of the Cluster Metadata Checks job, beside the other model-free cluster check runners. test.md says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own follower ID configuration.md "Coordinator-paired member": the Both or neither row names "" for none and an older follower that does not report the field; the new Changing row says the leader decides under the command lock, checks a save against its own files before any stop, and waits a minute on a busy lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
…ect register CI run 40817707824 on the follow-up branch: - ClusterService.lastError(in:from:) named its byte window `tail`, which the existing line read a few lines below redeclared. Renamed to `window`. - The onboarding checks, now run in CI for the first time, still expected the operations to end at the test request. Since PR 1661 a public-scope setup calls `register` after a test that passed; seven expectations now include it. The run had 582 passed, 9 failed; these were the 9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chitecture Docs Impact maps the changed cluster sources to docs/architecture/inference.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch had an error being 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.
Summary
Follow-up to PR 1661 (merged into dev at 45f0c22). It fixes the medium and low findings of the second delta review of the cluster approval check. No change to the provider protocol or the coordinator API. Each fix is one signed commit with a row.
ClusterApprovalSync.applychecks a save against the leader's own files and pairing before any part stops. A busy command lock waits for the next check, a minute later, instead of retrying at every tick.approvalIDalways (""for none). A status without the field (an older build), or no answer, is unknown: the leader does not compare it and does not converge.converge(nil)(596fe33). When the leader holds a cluster approval it does not offer (it ended, or the cluster serves locally only), converging on none also saves the leader's setup without it. The log line is then true and the next check finds no difference.provider-swift/Tests/ClusterOnboardingChecks/run.sh, withleaderWaitsForThePartsAfterTheRegistrationfrom PR 1661) now run as a step of theCluster Metadata Checksjob.Before / After
flowchart LR subgraph Before A1[check: read setup, record, follower status] --> S1[step] S1 --> L1{command lock} L1 -->|busy| R1[retry next tick] L1 -->|held| X1[stop parts, then check, then change] end subgraph After A2[check: read setup, record, follower status] --> S2[step] S2 --> L2{command lock} L2 -->|busy| R2[retry at the next check, a minute later] L2 -->|held| D2[read again, decide again] D2 --> C2[leader's own check of a save] C2 -->|refused| N2[no part stops] C2 -->|accepted| X2[stop parts, change both Macs, start parts] endHooked up
ClusterApprovalSync.applyClusterService.checkApproval(under the command lock)ClusterApprovalCheck.peerApprovalIDClusterService.checkApproval(decide)ClusterApprovalCheck.macsDiffer,stepClusterServiceStatus.approvalID(""for none)ClusterService.status()ClusterApprovalCheck.peerApprovalIDClusterService.childLogOffset,lastError(in:from:)ClusterService.supervise(part start:seekToEndOfFile)supervise(part end ->ClusterApprovalCheck.memberQuickEnds)Run cluster onboarding checks.github/workflows/ci.yml, jobCluster Metadata Checksprovider-swift/Tests/ClusterOnboardingChecks/run.shProvider Unit Tests(scripts/run-provider-tests.sh), the onboarding checks inCluster Metadata ChecksRows
ClusterApprovalWatchTests.noPartStopsForAnApprovalTheLeadersOwnCheckRefusesClusterApprovalWatchTests.aFollowerThatDoesNotReportItsApprovalIsNeverTakenForOneWithoutapprovalID(older build) and no answer are unknown: no difference, step keeps;""is none and differs; the same ID does notClusterApprovalWatchTests.aPartsQuickEndsAreCountedFromItsOwnLogLinesOnlyClusterApprovalWatchTests.convergingOnNoneAlsoClearsTheLeadersApprovalThatIsNotOfferedClusterOnboardingChecks.leaderWaitsForThePartsAfterTheRegistration(now in CI)Deviations
apply, which they now call under the lock, has one.Validation evidence
lastError(in:from:)(taildeclared twice), and the onboarding checks, run in CI for the first time, had 582 passed and 9 failed: seven expectations still ended the operations at the test request, before PR 1661'sregister.Run cluster onboarding checks), Docs Lint, Release Integrity.Decisions for David
None.
🤖 Generated with Claude Code