enhance status API#879
Closed
morgo wants to merge 2 commits into
Closed
Conversation
Collaborator
Author
|
Forking the strict removal to #910 while we experiment more with this. |
morgo
added a commit
that referenced
this pull request
Jun 9, 2026
Removes the --strict CLI flag and the Migration.Strict field, along with the strict branch in setup(), the WithStrict() test helper, the four TestResumeFromCheckpoint*Strict* tests, and the corresponding sections of docs/migrate.md and resume-from-checkpoint.md. With --strict gone, a failed resume-from-checkpoint always logs the reason and falls back to a fresh migration. The typed status.Err* values (ErrMismatchedAlter, ErrBinlogNotFound, ErrCheckpointTooOld, ErrCheckpointCollision) are still produced and logged internally; only the strict consumer of them is removed. This is a breaking change for anyone passing --strict: Kong will error on the unknown flag. Per prior discussion the flag was already not-recommended. Forked out of #879. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Surfaces resume-from-checkpoint outcome and active throttler on the runner/Progress API so external clients (GUIs, automation) can summarize migration state without scraping logs. Closes block#844. Runner getters (migration + move): - UsedResumeFromCheckpoint() bool - ResumeError() error (preserves typed status.Err* values for errors.Is) Both fields are guarded by a sync.RWMutex so concurrent reads via the getters cannot race with the setup() goroutine's write. Throttler interface gains String() string — empty when not throttled, descriptive when active. Implemented across Noop, Mock, Replica, CommitLatency, ActiveThreads, multiThrottler (joins children with "; "), and the test double. status.Progress gains Throttler throttler.Throttler (never nil; both runners initialize r.throttler to Noop). Surfacing the throttler itself avoids needing a Progress-struct mapping when throttler types add new data later. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The test compares Progress structs as literals; now that Progress.Throttler
is initialized to &throttler.Noop{} on the runner, the literals must include
it too.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c14e711 to
5e49008
Compare
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.
Closes #844.
Summary
Surfaces resume-from-checkpoint outcome and the active throttler on the runner/Progress API so external clients (GUIs, automation) can summarize migration state without scraping logs.
Runner getters (migration + move)
UsedResumeFromCheckpoint() boolResumeError() error— preserves typedstatus.Err*values forerrors.IsmatchingBoth fields are guarded by a
sync.RWMutexso concurrent reads via the getters cannot race with thesetup()goroutine's write.Throttler interface
Throttlergains aString() stringmethod — empty when not throttled, descriptive when active. Implemented on:Noop→ always""Mock→"mock throttler (always throttled)"Replica→"replica lag %dms exceeds tolerance %s"CommitLatency→"Aurora commit latency %s exceeds threshold %s"ActiveThreads→"Aurora active threads %d exceed vCPUs %d"multiThrottler→ joins non-empty children with;Progress struct
status.Progressgains aThrottler throttler.Throttlerfield. Guaranteed non-nil — both runners initializer.throttlerto&throttler.Noop{}so callers can dispatch on it without nil checks. Surfacing the throttler itself (rather than cherry-picking fields) means future throttler-specific data is available without amendingProgress.Test plan
go build ./...go vet ./...go test ./pkg/throttler/...— green-racesuite against MySQLProgress.Throttler(interface value in a returned struct) is acceptable shape for downstream consumers🤖 Generated with Claude Code