Skip to content

Commit

Permalink
fix(Dgraph): Sort manifests by BackupNum in file handler. (#6263)
Browse files Browse the repository at this point in the history
This was being done in the S3 handler but not in the file handler.
By default the paths are sorted by the filename but sorting by backup
number is more robust.
  • Loading branch information
martinmr authored Aug 26, 2020
1 parent 3638c12 commit df63d6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions worker/file_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ func (h *fileHandler) GetManifests(uri *url.URL, backupId string) ([]*Manifest,
return nil, err
}

// Sort manifests in the ascending order of their BackupNum so that the first
// manifest corresponds to the first full backup and so on.
sort.Slice(manifests, func(i, j int) bool {
return manifests[i].BackupNum < manifests[j].BackupNum
})
return manifests, nil
}

Expand Down

0 comments on commit df63d6c

Please sign in to comment.