Skip to content

Verify rollback ownership across continue-as-new - #57

Open
chaptersix wants to merge 2 commits into
migration-handoff/rollbackfrom
migration-handoff/rollback-chain
Open

chaptersix wants to merge 2 commits into
migration-handoff/rollbackfrom
migration-handoff/rollback-chain

Conversation

@chaptersix

@chaptersix chaptersix commented Sep 5, 2026

Copy link
Copy Markdown
Owner

An owned V1 descendant changes its start request ID after continue-as-new, causing #47 to reject the handoff. Verify its authoritative first-run identity and original create request. Consume a replicated start claim before the only create attempt, then persist an acceptance receipt before closing CHASM. Retries reconcile ownership or use the receipt without recreating a completed destination.

Missing ownership proof remains fail-closed and requires operator reconciliation. Older persisted migrations are reconcile-only; old executors must be drained before relying on this protocol.

Evidence, sequence diagram and recovery boundary. Focused ownership and fault-boundary tests pass; make proto completed. Affected scheduler packages and V1 replay tests pass. The native History continue-as-new test passes in both replication modes. make lint-code-fast reports zero issues; repeated make proto produces no generated diff; git diff --check passes. A bounded three-second migration fuzz smoke run passes (75 cached baseline inputs exercised). Physical crash and namespace-failover integration tests were not run.

@chaptersix
chaptersix marked this pull request as ready for review September 5, 2026 02:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T02:21:20.912993Z 39c52cb Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39c52cb910

ℹ️ 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".

Comment on lines +241 to +243
pending := s.WorkflowMigration.StartPending
s.WorkflowMigration.StartPending = false
return pending, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fence the start claim across namespace failover

For a global namespace, this transition and StartWorkflowExecution are persisted and replicated independently under different execution keys. If the initial start_pending=true state reaches the standby but this update does not before failover, the new active cluster can consume the stale claim again; when the first destination has continued as new and its descendant has since closed or been deleted, the ALLOW_DUPLICATE start succeeds and creates a second scheduler chain. The claim therefore does not provide the advertised single-start guarantee across failover without a destination-side fence or another cross-cluster reconciliation step.

Useful? React with 👍 / 👎.

Comment on lines +321 to +322
if err != nil {
return "", fmt.Errorf("failed to resolve migration destination chain: %w", err)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep missing destinations retryable

When the claim was consumed but the start failed before committing—or the committed destination is not yet visible—GetMutableState returns serviceerror.NotFound, and this wrapping preserves that type. queues.executableImpl.isInvalidTaskError treats any wrapped NotFound as an invalid task and acknowledges it, so with StartPending already false and an idempotent MigrateToWorkflow call adding no replacement task, the source remains paused and migration-pending with no executor left to observe a later destination or operator repair. Return a retryable reconciliation error instead of propagating NotFound.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant