Skip to content

Commit

Permalink
fix(backup): allow for empty snapshot dirs on reindexing
Browse files Browse the repository at this point in the history
Fixes #3733
  • Loading branch information
Michal-Leszczynski committed Feb 28, 2024
1 parent 64b9b8c commit 998a50a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/service/backup/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ func (s *Service) Backup(ctx context.Context, clusterID, taskID, runID uuid.UUID
Config: s.config,
Client: client,
},
PrevStage: run.Stage,
Metrics: s.metrics,
Units: run.Units,
OnRunProgress: s.putRunProgressLogError,
Expand Down
1 change: 1 addition & 0 deletions pkg/service/backup/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type workerTools struct {
type worker struct {
workerTools

PrevStage Stage
Metrics metrics.BackupMetrics
Units []Unit
Schema *bytes.Buffer
Expand Down
4 changes: 3 additions & 1 deletion pkg/service/backup/worker_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ func (w *worker) indexSnapshotDirs(ctx context.Context, h hostInfo) ([]snapshotD
}
}

if len(dirs) == 0 {
// In case of reindexing, it's possible that all snapshot dirs
// were already uploaded and deleted in the previous run (#3733).
if w.PrevStage != StageUpload && len(dirs) == 0 {
return nil, errors.New("could not find any files")
}

Expand Down

0 comments on commit 998a50a

Please sign in to comment.