tdbg: add per-schedule V1/V2/sentinel status check to schedule migrate status - #11636
Draft
davidporter-id-au wants to merge 2 commits into
Draft
tdbg: add per-schedule V1/V2/sentinel status check to schedule migrate status#11636davidporter-id-au wants to merge 2 commits into
davidporter-id-au wants to merge 2 commits into
Conversation
Add a --schedule-id flag to `tdbg schedule migrate status`. When set, it
looks up one specific schedule instead of reporting namespace-wide
V1-vs-V2 counts, and reports whether it is currently V1
(workflow-backed), V2 (CHASM), or caught in a migration sentinel state.
It always probes both sides -- the V1 workflow ID and the V2/CHASM
business ID -- via the same DescribeMutableState RPC that `tdbg
execution describe` uses, regardless of which ID form was passed in.
This avoids inferring the answer from the ID's shape (e.g. its prefix)
without confirming it against the server, and lets it also flag the
two kinds of migration sentinel:
- a CHASM-side sentinel Scheduler component reserving the ID during
a V1->V2 migration
- a V1-side DummyWorkflow reserving the workflow ID during a V2->V1
rollback
Output leads with a plain-language headline describing the schedule's
current, authoritative form, followed by a note about any sentinel
found on the other side, a details table of both sides' raw status,
and the exact `execution describe` invocations to inspect each side
further.
fmt.Fprintf with no format verbs -> fmt.Fprint, per golangci-lint's revive unnecessary-format check on PR temporalio#11636.
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
Adds a
--schedule-idflag totdbg schedule migrate status. When set, it looks up one specific schedule instead of the namespace-wide V1-vs-V2 counts, and reports whether that schedule is currently V1 (workflow-backed), V2 (CHASM), or caught in a migration sentinel state.Why
During schedule migration triage, an operator often needs to know the status of one specific schedule, not aggregate counts. There was no way to answer that without manually poking
execution describeand reasoning about CHASM node internals by hand.How it works
It always probes both sides — the V1 workflow ID (
temporal-sys-scheduler:<id>) and the V2/CHASM business ID (<id>) — via the sameDescribeMutableStateRPC thattdbg execution describeuses, regardless of which ID form was passed in. It deliberately does not short-circuit based on the input's shape (e.g. its prefix) without confirming against the server — an unconfirmed inference is confusing/untrustworthy in a diagnostic tool.This lets it flag both kinds of migration sentinel:
Schedulercomponent reserving the ID during a V1→V2 migrationDummyWorkflowreserving the workflow ID during a V2→V1 rollbackOutput leads with a plain-language headline describing the schedule's current, authoritative form (written for someone with no prior knowledge of the V1/V2 migration internals), followed by a note about any sentinel found on the other side, a details table of both sides' raw status, and the exact
execution describeinvocations to inspect each side further.Example output (V2→V1 rollback in flight)
Testing
go test ./tools/tdbg/... -run TestScheduleStatus -v— new tests cover: prefixed input, genuine V1, genuine V2, V1 genuine + CHASM sentinel, V1 sentinel + genuine V2, not-found on both sides, and an unexpected/inconsistent-state fallback. Existing aggregate-count tests are unaffected.go build ./tools/...,go vet ./tools/tdbg/...tdbg schedule migrate status --helpoutput.🤖 Generated with Claude Code