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

backupccl,storage: add logs around manifest handling and ExportRequest pagination #95622

Merged
merged 2 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
5 changes: 5 additions & 0 deletions pkg/storage/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6416,6 +6416,7 @@ func mvccExportToWriter(
if isNewKey {
resumeKey.Timestamp = hlc.Timestamp{}
}
log.VInfof(ctx, 2, "paginating ExportRequest: CPU over-limit")
break
}
}
Expand Down Expand Up @@ -6479,6 +6480,8 @@ func mvccExportToWriter(
rangeKeys.Clear()
rangeKeysSize = 0
resumeKey = unsafeKey.Clone()
log.VInfof(ctx, 2, "paginating ExportRequest: rangekeys hit size limit: "+
"reachedTargetSize: %t, reachedMaxSize: %t", reachedTargetSize, reachedMaxSize)
break
}
if reachedMaxSize {
Expand Down Expand Up @@ -6543,6 +6546,8 @@ func mvccExportToWriter(
if isNewKey || !opts.StopMidKey {
resumeKey.Timestamp = hlc.Timestamp{}
}
log.VInfof(ctx, 2, "paginating ExportRequest: point keys hit size limit: "+
"reachedTargetSize: %t, reachedMaxSize: %t", reachedTargetSize, reachedMaxSize)
break
}
if reachedMaxSize {
Expand Down