Skip to content

Commit

Permalink
use dumpInstances() instead
Browse files Browse the repository at this point in the history
Signed-off-by: Renan Rangel <rrangel@slack-corp.com>
  • Loading branch information
rvrangel committed Aug 21, 2024
1 parent 0bb5631 commit 82a288c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
24 changes: 12 additions & 12 deletions go/test/endtoend/backup/vtctlbackup/backup_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1362,8 +1362,7 @@ func TestReplicaRestoreToTimestamp(t *testing.T, restoreToTimestamp time.Time, e
func verifyTabletBackupStats(t *testing.T, vars map[string]any) {
switch currentSetupType {
// Currently only the builtin backup engine instruments bytes-processed counts.
case XtraBackup, MySQLShell:
default:
case BuiltinBackup:
require.Contains(t, vars, "BackupBytes")
bb := vars["BackupBytes"].(map[string]any)
require.Contains(t, bb, "BackupEngine.Builtin.Compressor:Write")
Expand All @@ -1372,6 +1371,7 @@ func verifyTabletBackupStats(t *testing.T, vars map[string]any) {
if backupstorage.BackupStorageImplementation == "file" {
require.Contains(t, bb, "BackupStorage.File.File:Write")
}
case XtraBackup, MySQLShell:
}

require.Contains(t, vars, "BackupCount")
Expand All @@ -1380,13 +1380,13 @@ func verifyTabletBackupStats(t *testing.T, vars map[string]any) {

switch currentSetupType {
// Currently only the builtin backup engine instruments bytes-processed counts.
case XtraBackup, MySQLShell:
default:
case BuiltinBackup:
require.Contains(t, bc, "BackupEngine.Builtin.Compressor:Close")
require.Contains(t, bc, "BackupEngine.Builtin.Destination:Close")
require.Contains(t, bc, "BackupEngine.Builtin.Destination:Open")
require.Contains(t, bc, "BackupEngine.Builtin.Source:Close")
require.Contains(t, bc, "BackupEngine.Builtin.Source:Open")
case XtraBackup, MySQLShell:
}

require.Contains(t, vars, "BackupDurationNanoseconds")
Expand All @@ -1395,8 +1395,7 @@ func verifyTabletBackupStats(t *testing.T, vars map[string]any) {

switch currentSetupType {
// Currently only the builtin backup engine emits timings.
case XtraBackup, MySQLShell:
default:
case BuiltinBackup:
require.Contains(t, bd, "BackupEngine.Builtin.Compressor:Close")
require.Contains(t, bd, "BackupEngine.Builtin.Compressor:Write")
require.Contains(t, bd, "BackupEngine.Builtin.Destination:Close")
Expand All @@ -1405,6 +1404,7 @@ func verifyTabletBackupStats(t *testing.T, vars map[string]any) {
require.Contains(t, bd, "BackupEngine.Builtin.Source:Close")
require.Contains(t, bd, "BackupEngine.Builtin.Source:Open")
require.Contains(t, bd, "BackupEngine.Builtin.Source:Read")
case XtraBackup, MySQLShell:
}

if backupstorage.BackupStorageImplementation == "file" {
Expand Down Expand Up @@ -1432,14 +1432,14 @@ func verifyTabletRestoreStats(t *testing.T, vars map[string]any) {
verifyRestorePositionAndTimeStats(t, vars)

switch currentSetupType {
case XtraBackup, MySQLShell:
default:
case BuiltinBackup:
require.Contains(t, vars, "RestoreBytes")
bb := vars["RestoreBytes"].(map[string]any)
require.Contains(t, bb, "BackupEngine.Builtin.Decompressor:Read")
require.Contains(t, bb, "BackupEngine.Builtin.Destination:Write")
require.Contains(t, bb, "BackupEngine.Builtin.Source:Read")
require.Contains(t, bb, "BackupStorage.File.File:Read")
case XtraBackup, MySQLShell:
}

require.Contains(t, vars, "RestoreCount")
Expand All @@ -1448,13 +1448,13 @@ func verifyTabletRestoreStats(t *testing.T, vars map[string]any) {

switch currentSetupType {
// Currently only the builtin backup engine emits operation counts.
case XtraBackup, MySQLShell:
default:
case BuiltinBackup:
require.Contains(t, bc, "BackupEngine.Builtin.Decompressor:Close")
require.Contains(t, bc, "BackupEngine.Builtin.Destination:Close")
require.Contains(t, bc, "BackupEngine.Builtin.Destination:Open")
require.Contains(t, bc, "BackupEngine.Builtin.Source:Close")
require.Contains(t, bc, "BackupEngine.Builtin.Source:Open")
case XtraBackup, MySQLShell:
}

require.Contains(t, vars, "RestoreDurationNanoseconds")
Expand All @@ -1463,8 +1463,7 @@ func verifyTabletRestoreStats(t *testing.T, vars map[string]any) {

switch currentSetupType {
// Currently only the builtin backup engine emits timings.
case XtraBackup, MySQLShell:
default:
case BuiltinBackup:
require.Contains(t, bd, "BackupEngine.Builtin.Decompressor:Close")
require.Contains(t, bd, "BackupEngine.Builtin.Decompressor:Read")
require.Contains(t, bd, "BackupEngine.Builtin.Destination:Close")
Expand All @@ -1473,6 +1472,7 @@ func verifyTabletRestoreStats(t *testing.T, vars map[string]any) {
require.Contains(t, bd, "BackupEngine.Builtin.Source:Close")
require.Contains(t, bd, "BackupEngine.Builtin.Source:Open")
require.Contains(t, bd, "BackupEngine.Builtin.Source:Read")
case XtraBackup, MySQLShell:
}

require.Contains(t, bd, "BackupStorage.File.File:Read")
Expand Down
4 changes: 1 addition & 3 deletions go/vt/mysqlctl/mysqlshellbackupengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ func (be *MySQLShellBackupEngine) ExecuteBackup(ctx context.Context, params Back
args = append(args, strings.Fields(mysqlShellFlags)...)
}

args = append(args, "-e", fmt.Sprintf("util.dumpSchemas([\"%s\", \"vt_%s\"], %q, %s)",
sidecar.GetName(),
params.Keyspace,
args = append(args, "-e", fmt.Sprintf("util.dumpInstance(%q, %s)",
location,
mysqlShellDumpFlags,
))
Expand Down

0 comments on commit 82a288c

Please sign in to comment.