Skip to content

Add --reject-stale to branch routing-rules get - #1443

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
routing-rules-reject-stale
Closed

cursor[bot] wants to merge 2 commits into
mainfrom
routing-rules-reject-stale

Conversation

@cursor

@cursor cursor Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem:

pscale branch routing-rules get reads the branch schema snapshot, which can lag live cluster state after SwitchTraffic. Applying that snapshot with routing-rules update is a full replacement and can revert live routes.

Solution:

Add --reject-stale on get, which sends reject_stale=true to the API. Map the routing_rules_snapshot_stale API code to an action_required JSON error. routing-rules update fails with that same code when the snapshot is stale; next steps are to wait for a new snapshot or read live rules with pscale branch vtctld get-routing-rules.

Requires the matching API change.


Security impact:

None.


Testing:

go test ./internal/cmd/branch/... ./internal/cmdutil/...

cursoragent and others added 2 commits September 24, 2026 00:19
pscale branch routing-rules get reads a schema snapshot that can lag
live cluster state after SwitchTraffic, and update replaces the entire
routing map. Document that, warn that --keep-routing-rules=true can
block a later MoveTables complete, and point operators at
pscale branch vtctld get-routing-rules for live rules.

Co-authored-by: max <max@planetscale.com>
Co-authored-by: max <max@planetscale.com>
@planetscale-ai-tools

Copy link
Copy Markdown
Contributor

Superseded by #1444, which surfaces the write-side block instead of adding a --reject-stale read flag.

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