Cleaner way to disable merge bases during preview (#4711)
Switch to a cleaner way of disabling merge bases when making a preview backup. This sets the flag to not find merge bases instead of finding them and then dropping them. Manually tested running a backup with `--preview` (local dev flag) and `--disable-incrementals` and verified in the log that merge bases were dropped --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [x] 🧹 Tech Debt/Cleanup #### Test Plan - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
f4ed4d7250
commit
8cf2c1b294
@ -412,23 +412,6 @@ func (op *BackupOperation) do(
|
||||
}
|
||||
}
|
||||
|
||||
// Drop merge bases if we're doing a preview backup. Preview backups may use
|
||||
// different delta token parameters so we need to ensure we do a token
|
||||
// refresh. This could eventually be pushed down the stack if we track token
|
||||
// versions.
|
||||
//
|
||||
// TODO(ashmrtn): Until we use token versions to determine this, refactor
|
||||
// input params to produceManifestsAndMetadata and do this in that function
|
||||
// instead of here.
|
||||
if op.Options.PreviewLimits.Enabled {
|
||||
logger.Ctx(ctx).Info("disabling merge bases for preview backup")
|
||||
|
||||
mans.DisableMergeBases()
|
||||
|
||||
canUseMetadata = false
|
||||
mdColls = nil
|
||||
}
|
||||
|
||||
ctx = clues.Add(
|
||||
ctx,
|
||||
"can_use_metadata", canUseMetadata,
|
||||
@ -515,7 +498,11 @@ func makeFallbackReasons(tenant string, sel selectors.Selector) ([]identity.Reas
|
||||
// checker to see if conditions are correct for incremental backup behavior such as
|
||||
// retrieving metadata like delta tokens and previous paths.
|
||||
func useIncrementalBackup(sel selectors.Selector, opts control.Options) bool {
|
||||
return !opts.ToggleFeatures.DisableIncrementals
|
||||
// Drop merge bases if we're doing a preview backup. Preview backups may use
|
||||
// different delta token parameters so we need to ensure we do a token
|
||||
// refresh. This could eventually be pushed down the stack if we track token
|
||||
// versions.
|
||||
return !opts.ToggleFeatures.DisableIncrementals && !opts.PreviewLimits.Enabled
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user