Fence scheduler rollback destination ownership - #47
chaptersix wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 735701fda3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if migrationRequestID == "" { | ||
| migrationRequestID = uuid.NewString() |
There was a problem hiding this comment.
Preserve generated migration IDs across client retries
When an older caller omits request_id, each Admin API invocation generates a different value. If the first invocation commits MigrateToWorkflow but its response is lost, the caller's retry reaches the pending migration with a new ID and Scheduler.MigrateToWorkflow returns AlreadyExists instead of idempotent success. The fallback ID must remain stable across external retries, or omission should be handled without treating retries as competing migrations.
Useful? React with 👍 / 👎.
Problem
CHASM-to-workflow rollback generated a fresh V1 start request ID on every task attempt and accepted
every
WorkflowExecutionAlreadyStartedresponse. A foreign destination could close the CHASMsource, and a source-close failure followed by destination closure could restart deleted state via
ALLOW_DUPLICATE. The admin preflight also treated completed and terminated dummy workflows aslive sentinels.
Fix
WorkflowMigrationState.StartWorkflowExecutionattempt.AlreadyStartedonly when its recordedStartRequestIdmatches.The implementation and compatibility boundary are described in the commit-pinned
rollback note.
Before/after
On the evidence parent, a foreign rollback destination closes CHASM and response-loss retries use
rotating UUIDs. On this branch, the collision regression passes with CHASM retained; retry
boundaries use the same durable ID and create one destination. Running sentinels remain blocked,
while completed and terminated sentinels proceed.
Compatibility and failure modes
An old pending rollback without a durable ID is retained for operator recovery. An owned V1 chain
that has already continued as new may no longer report the original current-run start request ID;
the strict check fails closed rather than guessing ownership. The ID is replicated CHASM state,
so crash and namespace failover do not depend on process-local memory. The change adds no RPC and
no ordinary scheduler hot-path work.
Validation
All commands pass; fuzz seeds are
0, 1, 7, 42, 63(432 executions in the final bounded run).Stack