From 534924f6960a65505287c7a8e7a67e3257c6a567 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Thu, 27 Apr 2023 00:45:56 +0530 Subject: [PATCH] Don't try to fetch backup version if no compete backups available (#3230) Regression from https://github.com/alcionai/corso/commit/62daf10213ce29782752924bc1c53a44a65dfe01#diff-f088d3a5f56348ddaf6fbf485c2aeaa6d8b40a860de014f7084db6daf0753829R267 --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [x] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup #### Issue(s) * # #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/operations/backup.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 6878acf69..e08883d89 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -241,8 +241,9 @@ func (op *BackupOperation) do( backupID model.StableID, ) (*details.Builder, error) { var ( - reasons = selectorToReasons(op.Selectors, false) - fallbackReasons = makeFallbackReasons(op.Selectors) + reasons = selectorToReasons(op.Selectors, false) + fallbackReasons = makeFallbackReasons(op.Selectors) + lastBackupVersion = version.NoBackup ) logger.Ctx(ctx).With( @@ -264,9 +265,11 @@ func (op *BackupOperation) do( return nil, clues.Wrap(err, "producing manifests and metadata") } - _, lastBackupVersion, err := lastCompleteBackups(ctx, op.store, mans) - if err != nil { - return nil, clues.Wrap(err, "retrieving prior backups") + if canUseMetaData { + _, lastBackupVersion, err = lastCompleteBackups(ctx, op.store, mans) + if err != nil { + return nil, clues.Wrap(err, "retrieving prior backups") + } } cs, excludes, err := produceBackupDataCollections(