Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mysql-shell engine as a supported engine #586

Merged
merged 7 commits into from
Sep 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add mysql-shell-backup-location flag when using mysqlsh engine backup
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Aug 29, 2024
commit 4d4318c503ddc3f5188474f49a4d6910c5e47099
10 changes: 8 additions & 2 deletions pkg/operator/vttablet/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ package vttablet
import (
"fmt"

corev1 "k8s.io/api/core/v1"
planetscalev2 "planetscale.dev/vitess-operator/pkg/apis/planetscale/v2"
"planetscale.dev/vitess-operator/pkg/operator/lazy"
"planetscale.dev/vitess-operator/pkg/operator/vitess"
"planetscale.dev/vitess-operator/pkg/operator/vitessbackup"
corev1 "k8s.io/api/core/v1"
)

func xtrabackupFlags(spec *Spec, backupThreads, restoreThreads int) vitess.Flags {
Expand Down Expand Up @@ -51,7 +51,8 @@ func init() {
"wait_for_backup_interval": waitForBackupInterval,
"backup_engine_implementation": string(spec.BackupEngine),
}
if spec.BackupEngine == planetscalev2.VitessBackupEngineXtraBackup {
switch spec.BackupEngine {
case planetscalev2.VitessBackupEngineXtraBackup:
// When vttablets take backups, we let them keep serving, so we
// limit to single-threaded to reduce the impact.
backupThreads := 1
Expand All @@ -68,6 +69,11 @@ func init() {
restoreThreads = 1
}
flags.Merge(xtrabackupFlags(spec, backupThreads, restoreThreads))
case planetscalev2.VitessBackupEngineMySQLShell:
svm := vitessbackup.StorageVolumeMounts(spec.BackupLocation)
flags.Merge(vitess.Flags{
"mysql-shell-backup-location": svm[0].MountPath,
})
}
clusterName := spec.Labels[planetscalev2.ClusterLabel]
storageLocationFlags := vitessbackup.StorageFlags(spec.BackupLocation, clusterName)
Expand Down
Loading