Skip to content

Commit 998a50a

Browse files
fix(backup): allow for empty snapshot dirs on reindexing
Fixes #3733
1 parent 64b9b8c commit 998a50a

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

pkg/service/backup/service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ func (s *Service) Backup(ctx context.Context, clusterID, taskID, runID uuid.UUID
786786
Config: s.config,
787787
Client: client,
788788
},
789+
PrevStage: run.Stage,
789790
Metrics: s.metrics,
790791
Units: run.Units,
791792
OnRunProgress: s.putRunProgressLogError,

pkg/service/backup/worker.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ type workerTools struct {
6464
type worker struct {
6565
workerTools
6666

67+
PrevStage Stage
6768
Metrics metrics.BackupMetrics
6869
Units []Unit
6970
Schema *bytes.Buffer

pkg/service/backup/worker_index.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ func (w *worker) indexSnapshotDirs(ctx context.Context, h hostInfo) ([]snapshotD
147147
}
148148
}
149149

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

0 commit comments

Comments
 (0)