Conversation
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 77 out of 80 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go:1
- Corrected spelling of 'storate' to 'storage.k8s.io' in the PR description example.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,10 +1,9 @@ | |||
| #!/bin/bash | |||
| #!/bin/sh | |||
There was a problem hiding this comment.
We don't need any bash-specific features in this script, so using /bin/sh is better for portability (even though our images are expected to support bash). Do you think we need bash?
| return "", errors.Wrap(err, "failed to get backup target pod") | ||
| } | ||
|
|
||
| // TODO: should this be optional, since this can take a while on large datasets? |
There was a problem hiding this comment.
Yeah I discussed this with PG team yesterday and looks like it can (and should) be made optional
|
|
||
| func (e *offlineExec) checkpoint(ctx context.Context, instanceName string) error { | ||
| exec := func(_ context.Context, stdin io.Reader, stdout, stderr io.Writer, command ...string) error { | ||
| return e.podExec(ctx, e.cluster.GetNamespace(), instanceName+"-0", naming.ContainerDatabase, stdin, stdout, stderr, command...) |
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 77 out of 80 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if ptr.Deref(pgBackup.Spec.RepoName, "") == "" { | ||
| if updErr := pgBackup.UpdateStatus(ctx, r.Client, func(bcp *v2.PerconaPGBackup) { | ||
| bcp.Status.State = v2.BackupFailed | ||
| bcp.Status.Error = "repoName is required when method is 'pgbackrest'" | ||
| }); updErr != nil { | ||
| return reconcile.Result{}, fmt.Errorf("failed to update backup status: %w", updErr) | ||
| } | ||
| pgCluster = nil | ||
| return reconcile.Result{}, errors.New("'repoName' is required when method is 'pgbackrest'") | ||
| } |
There was a problem hiding this comment.
After setting the backup status to BackupFailed for missing repoName, the reconciler returns a non-nil error. This will cause unnecessary error logs/requeues even though the failure is already persisted in status. Consider returning reconcile.Result{} with nil error (or a normal requeue delay if you need finalizers to run) after updating the status.
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
| return fmt.Errorf("checkpoint failed: %s", stderr) | ||
| } | ||
|
|
||
| log.Info("checkpoint executed", "stdout", stdout, "stderr", stderr) |
There was a problem hiding this comment.
The logging for successful checkpoint (line 105) includes both stdout and stderr, which could potentially log sensitive information. While checkpoint output is typically safe, consider whether logging the full output is necessary or if a simple success message would suffice.
commit: 216ebbe |
Due to the high volume of requests, we're unable to provide free service for this account. To continue using the service, please upgarde to a paid plan.
CHANGE DESCRIPTION
Adds support for taking backups using VolumeSnapshots API. VolumeSnapshots enable fast backups directly via the CSI driver.
This PR adds support for
offlinesnapshot backups.The operator will:
To take scheduled snapshots:
To restore a snapshot in-place, you may do so using
PerconaPGRestore:It is also possible to restore a snapshot and perform PiTR using pgbackrest, as long as backups in both sources belong to the same timeline:
Restoring to a new cluster can be done by directly specifying the dataSource in the instance volume claim spec:
Later we plan to add support for an online mode where the operator can perform a snapshot on a live primary without suspending it.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability