Skip to content

Commit f274892

Browse files
committed
backupdest: remove IncludeManifest arg in FindAllIncrementalPaths
Epic: none Release note: none
1 parent 5154683 commit f274892

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

pkg/backup/backupdest/backup_destination.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func ResolveDest(
228228
defer rootStore.Close()
229229
priors, err := FindAllIncrementalPaths(
230230
ctx, execCfg, incrementalStore, rootStore,
231-
chosenSuffix, OmitManifest, len(dest.IncrementalStorage) > 0,
231+
chosenSuffix, len(dest.IncrementalStorage) > 0,
232232
)
233233
if err != nil {
234234
return ResolvedDestination{}, errors.Wrap(err, "adjusting backup destination to append new layer to existing backup")

pkg/backup/backupdest/incrementals.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,14 @@ func FindAllIncrementalPaths(
8686
incStore cloud.ExternalStorage,
8787
rootStore cloud.ExternalStorage,
8888
subdir string,
89-
includeManifest bool,
9089
customIncLocation bool,
9190
) ([]string, error) {
9291
ctx, sp := tracing.ChildSpan(ctx, "backupdest.FindAllIncrementalPaths")
9392
defer sp.Finish()
9493

9594
// Backup indexes do not support custom incremental locations.
9695
if customIncLocation || !ReadBackupIndexEnabled.Get(&execCfg.Settings.SV) {
97-
return LegacyFindPriorBackups(ctx, incStore, includeManifest)
96+
return LegacyFindPriorBackups(ctx, incStore, OmitManifest)
9897
}
9998

10099
indexes, err := ListIndexes(ctx, rootStore, subdir)
@@ -105,25 +104,15 @@ func FindAllIncrementalPaths(
105104
// backup chain, we can assume the index is complete. So either an index has
106105
// been written for every backup in the chain, or there are no indexes at all.
107106
if len(indexes) == 0 {
108-
return LegacyFindPriorBackups(ctx, incStore, includeManifest)
107+
return LegacyFindPriorBackups(ctx, incStore, OmitManifest)
109108
}
110109

111-
paths, err := util.MapE(
110+
return util.MapE(
112111
indexes[1:], // We skip the full backup
113112
func(indexFilename string) (string, error) {
114113
return parseBackupFilePathFromIndexFileName(subdir, indexFilename)
115114
},
116115
)
117-
if err != nil {
118-
return nil, err
119-
}
120-
121-
if includeManifest {
122-
paths = util.Map(paths, func(p string) string {
123-
return path.Join(p, backupbase.DeprecatedBackupManifestName)
124-
})
125-
}
126-
return paths, nil
127116
}
128117

129118
// LegacyFindPriorBackups finds "appended" incremental backups via the legacy
@@ -194,7 +183,7 @@ func backupsFromLocation(
194183
defer incStore.Close()
195184

196185
return FindAllIncrementalPaths(
197-
ctx, execCfg, incStore, rootStore, subdir, false /* includeManifest */, customIncLocation,
186+
ctx, execCfg, incStore, rootStore, subdir, customIncLocation,
198187
)
199188
}
200189

pkg/backup/backupdest/incrementals_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func TestFindAllIncrementalPaths(t *testing.T) {
243243

244244
incs, err := backupdest.FindAllIncrementalPaths(
245245
ctx, &execCfg, incStore, store,
246-
targetSubdir, false /* includeManifest */, false, /* customIncLocation */
246+
targetSubdir, false, /* customIncLocation */
247247
)
248248
require.NoError(t, err)
249249
require.Len(t, incs, len(targetChain)-1)
@@ -324,7 +324,7 @@ func TestFindAllIncrementalPathsFallbackLogic(t *testing.T) {
324324

325325
incs, err := backupdest.FindAllIncrementalPaths(
326326
ctx, &execCfg, stores.inc, stores.root,
327-
subdir, false /* includeManifest */, false, /* customIncLocation */
327+
subdir, false, /* customIncLocation */
328328
)
329329
require.NoError(t, err)
330330
require.Len(t, incs, numBackups-1)
@@ -348,7 +348,7 @@ func TestFindAllIncrementalPathsFallbackLogic(t *testing.T) {
348348

349349
incs, err := backupdest.FindAllIncrementalPaths(
350350
ctx, &execCfg, stores.customInc, stores.root,
351-
subdir, false /* includeManifest */, true, /* customIncLocation */
351+
subdir, true, /* customIncLocation */
352352
)
353353
require.NoError(t, err)
354354
require.Len(t, incs, numBackups-1)
@@ -390,14 +390,14 @@ func TestFindAllIncrementalPathsFallbackLogic(t *testing.T) {
390390
// List from both default and custom incremental locations.
391391
incs, err := backupdest.FindAllIncrementalPaths(
392392
ctx, &execCfg, stores.inc, stores.root,
393-
subdir, false /* includeManifest */, false, /* customIncLocation */
393+
subdir, false, /* customIncLocation */
394394
)
395395
require.NoError(t, err)
396396
require.Len(t, incs, numDefaultIncs)
397397

398398
incs, err = backupdest.FindAllIncrementalPaths(
399399
ctx, &execCfg, stores.customInc, stores.root,
400-
subdir, false /* includeManifest */, true, /* customIncLocation */
400+
subdir, true, /* customIncLocation */
401401
)
402402
require.NoError(t, err)
403403
require.Len(t, incs, numCustomIncs)

0 commit comments

Comments
 (0)