From 06b29085ffc860f570737b7684bfb4762a483231 Mon Sep 17 00:00:00 2001 From: adityamaru Date: Fri, 20 Jan 2023 14:07:40 -0500 Subject: [PATCH 1/2] backupccl: add logging to backup manifest handling Release note: None --- pkg/ccl/backupccl/backupinfo/manifest_handling.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/ccl/backupccl/backupinfo/manifest_handling.go b/pkg/ccl/backupccl/backupinfo/manifest_handling.go index 414727386655..0a396321ce4c 100644 --- a/pkg/ccl/backupccl/backupinfo/manifest_handling.go +++ b/pkg/ccl/backupccl/backupinfo/manifest_handling.go @@ -164,11 +164,12 @@ 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 @@ -176,9 +177,16 @@ func ReadBackupManifestFromStore( // // 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. From 17bb2b5e76800ba4e288e48f746fd4cbb67d2fed Mon Sep 17 00:00:00 2001 From: adityamaru Date: Fri, 20 Jan 2023 14:44:50 -0500 Subject: [PATCH 2/2] storage: log the ExportRequest pagination reason Release note: None --- pkg/storage/mvcc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/storage/mvcc.go b/pkg/storage/mvcc.go index 53803ed89e81..dd41d22970c5 100644 --- a/pkg/storage/mvcc.go +++ b/pkg/storage/mvcc.go @@ -6416,6 +6416,7 @@ func mvccExportToWriter( if isNewKey { resumeKey.Timestamp = hlc.Timestamp{} } + log.VInfof(ctx, 2, "paginating ExportRequest: CPU over-limit") break } } @@ -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 { @@ -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 {