Skip to content

Commit

Permalink
fix(backup): allow re-indexing on stage schema
Browse files Browse the repository at this point in the history
Even though stage schema does not need indexed snapshot dirs, they are required in the next stage deduplicate.
  • Loading branch information
Michal-Leszczynski authored and karol-kokoszka committed Aug 9, 2024
1 parent fcb445f commit a647387
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/service/backup/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,15 @@ func (s *Service) Backup(ctx context.Context, clusterID, taskID, runID uuid.UUID

// Skip completed stages
if run.PrevID != uuid.Nil {
// Allow reindexing if previous state is manifest creation or upload
if stage == StageIndex && (prevStage == StageManifest || prevStage == StageUpload || prevStage == StageDeduplicate) { //nolint: revive
// Allow re-indexing when future stages requires access
// to indexed worker.snapshotDirs.
allowReindexOnPrevStage := map[Stage]struct{}{
StageManifest: {},
StageUpload: {},
StageDeduplicate: {},
StageSchema: {},
}
if _, ok := allowReindexOnPrevStage[prevStage]; ok && stage == StageIndex { //nolint: revive
// continue
} else if prevStage.Index() > stage.Index() {
return nil
Expand Down

0 comments on commit a647387

Please sign in to comment.