Skip to content

Commit

Permalink
backupccl: add logging to backup manifest handling
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
adityamaru committed Feb 1, 2023
1 parent 0fbaa27 commit 06b2908
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/ccl/backupccl/backupinfo/manifest_handling.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,29 @@ func ReadBackupManifestFromStore(
// If we did not find `BACKUP_METADATA` we look for the
// `BACKUP_MANIFEST` file as it is possible the backup was created by a
// pre-23.1 node.
log.VInfof(ctx, 2, "could not find BACKUP_METADATA, falling back to BACKUP_MANIFEST")
backupManifest, backupManifestMemSize, backupManifestErr := ReadBackupManifest(ctx, mem, exportStore,
backupbase.BackupManifestName, encryption, kmsEnv)
if backupManifestErr != nil {
if !errors.Is(backupManifestErr, cloud.ErrFileDoesNotExist) {
return backuppb.BackupManifest{}, 0, err
return backuppb.BackupManifest{}, 0, backupManifestErr
}

// If we did not find a `BACKUP_MANIFEST` we look for a `BACKUP` file as
// it is possible the backup was created by a pre-20.1 node.
//
// TODO(adityamaru): Remove this logic once we disallow restores beyond
// the binary upgrade compatibility window.
log.VInfof(ctx, 2, "could not find BACKUP_MANIFEST, falling back to BACKUP")
oldBackupManifest, oldBackupManifestMemSize, oldBackupManifestErr := ReadBackupManifest(ctx, mem, exportStore,
backupbase.BackupOldManifestName, encryption, kmsEnv)
if oldBackupManifestErr != nil {
if errors.Is(oldBackupManifestErr, cloud.ErrFileDoesNotExist) {
log.VInfof(ctx, 2, "could not find any of the supported backup metadata files")
return backuppb.BackupManifest{}, 0,
errors.Wrapf(oldBackupManifestErr, "could not find BACKUP manifest file in any of the known locations: %s, %s, %s",
backupbase.BackupMetadataName, backupbase.BackupManifestName, backupbase.BackupOldManifestName)
}
return backuppb.BackupManifest{}, 0, oldBackupManifestErr
} else {
// We found a `BACKUP` manifest file.
Expand Down

0 comments on commit 06b2908

Please sign in to comment.