diff --git a/src/internal/kopia/backup_bases.go b/src/internal/kopia/backup_bases.go index f18515d8f..e908e9aec 100644 --- a/src/internal/kopia/backup_bases.go +++ b/src/internal/kopia/backup_bases.go @@ -75,6 +75,10 @@ type BackupBases interface { SnapshotAssistBases() []BackupBase } +func EmptyBackupBase() BackupBases { + return &backupBases{} +} + type backupBases struct { mergeBases []BackupBase assistBases []BackupBase diff --git a/src/internal/operations/manifests.go b/src/internal/operations/manifests.go index ecabe6d97..f1305e825 100644 --- a/src/internal/operations/manifests.go +++ b/src/internal/operations/manifests.go @@ -24,6 +24,17 @@ func produceManifestsAndMetadata( tenantID string, getMetadata, dropAssistBases bool, ) (kopia.BackupBases, []data.RestoreCollection, bool, error) { + // Just return early if we're going to end up dropping all the bases anyway. + // This will avoid loading kopia manifest data in the case that we're doing a + // full enumeration and refetching all item data for the resource. + // + // It's easier to work through later logic if we know that the returned + // kopia.BackupBases is non-nil for non-error cases so return a trivial + // implementation here. + if !getMetadata && dropAssistBases { + return kopia.EmptyBackupBase(), nil, false, nil + } + bb, meta, useMergeBases, err := getManifestsAndMetadata( ctx, bf,