Repository navigation
backup create: add --emergency and --emergency-source flags - #1488
Draft
maxenglander wants to merge 3 commits into
Draft
maxenglander wants to merge 3 commits into
maxenglander wants to merge 3 commits into
Conversation
--emergency requests an emergency backup that clones data from a live tablet instead of waiting for the next scheduled backup. --clone-tablet-type selects the tablet type to clone from (primary, replica, or rdonly) and is required with --emergency, rejected otherwise. No client-side default is applied; both fields are sent on the existing create-backup request. Co-authored-by: max <max@planetscale.com>
maxenglander
marked this pull request as draft
October 24, 2026 04:00
The create request sends emergency_source. --emergency-source is required with --emergency and rejected without it. Values stay primary, replica, and rdonly. Co-authored-by: max <max@planetscale.com>
rdonly is rejected. Allowed values are primary and replica. Co-authored-by: max <max@planetscale.com>
This branch has not been deployed
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 two new flags to
pscale backup create:--emergency— requests an emergency backup that clones data from a live tablet instead of waiting for the next scheduled backup.--emergency-source— selects the tablet type to clone from:primaryorreplica.rdonlyis rejected.The create request body sends these as
emergencyandemergency_source.Validation
--emergency-sourceis required when--emergencyis set.--emergency-sourceis rejected when--emergencyis not set.--emergency-sourcevalues are validated againstprimaryandreplica.rdonlyand any other value are rejected.CreateBackupRequestwhen provided.Out of scope
api-bbandapp-bbare unchanged.Docs
Updated the CLI's agent-facing reference (
AGENTS.md, embedded and served viapscale agent-guide --skill) with an "Emergency backups" section documenting the flags and their required/rejected relationship, plus the flag help text and commandLongdescription shown inpscale backup create --help.Testing
go test ./internal/cmd/backup/ -run TestBackup_Create--emergencywithout--emergency-source(error),--emergency-sourcewithout--emergency(error), an invalid--emergency-sourcevalue (error), andrdonly(error).