Skip to content

STAC-24630: Add stackgraph-v2 backup/restore#32

Open
craffit wants to merge 5 commits into
mainfrom
stac-24630
Open

STAC-24630: Add stackgraph-v2 backup/restore#32
craffit wants to merge 5 commits into
mainfrom
stac-24630

Conversation

@craffit

@craffit craffit commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Adds documentation for the new sstackgraph backup/restore v2. The interaction is documented in this docs PR: rancher/stackstate-product-docs#360

@craffit
craffit force-pushed the stac-24630 branch 3 times, most recently from 140322e to fbd2289 Compare July 16, 2026 14:34
Comment thread cmd/stackgraphv2/abort.go
cmd := &cobra.Command{
Use: "abort",
Short: "Abort a partially backfilled restore.",
Long: "Abort a partially backfilled restore. This will not load (backfill) any data but keep the data as is." +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please provide examples how to run this command. The same for backfill

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would you put an example in the docs or in the --help section? (or both?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Put an example in the docs and improved the 'description'


func backfillCmd(globalFlags *config.CLIGlobalFlags) *cobra.Command {
cmd := &cobra.Command{
Use: "backfill",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it supposed to be executed by the user directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll try to clarify when this should be used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I clarified both in the 'description' portion of the help command and in the docs

Comment thread cmd/stackgraphv2/check_and_finalize.go Outdated
K8sClient: appCtx.K8sClient,
Namespace: appCtx.Namespace,
JobName: checkJobName,
ServiceName: "stackgraph",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should it be stackgraph-v2 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

// waitAndCleanupRestoreJob waits for job completion and cleans up resources
func waitAndCleanupRestoreJob(k8sClient *k8s.Client, namespace, jobName string, log *logger.Logger) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this command should have its own version of PrintWaitingMessage (https://github.com/StackVista/stackstate-backup-cli/blob/main/internal/orchestration/restore/job.go#L83) Explaininig backfill and abort command. This way it would more clear to the user.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it should explain scenarios when the user have to run either of these commands.

  • sts-backup stackgraph-v2 backfill. The restore command will automatically restore both the live and backfill portion of a backup. If, however, the restore command gets interrupted (through CTRL-C) or fails due to instability the cluster, this command can be used to restart the backfill job, restoring the backfill portion of the data.
  • sts-backup stackgraph-v2 abort. If restoring the backfill portion of a backup cannot be recovered or is lost somehow, abort can be used to wrap up the restore command with the data that got already ingested successfully. This command is really a last resort and should not be needed in normal operation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

gotcha, i improve the message for restore, but also for backfill/abort and checkAndFinalize so the user knows what follow-up actions are possible.

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.

2 participants