Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(release/v20.03) Change groupId from int to uint32. #5614

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion worker/backup_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ type predicateSet map[string]struct{}
// loadFn is a function that will receive the current file being read.
// A reader, the backup groupId, and a map whose keys are the predicates to restore
// are passed as arguments.
type loadFn func(reader io.Reader, groupId int, preds predicateSet) (uint64, error)
type loadFn func(reader io.Reader, groupId uint32, preds predicateSet) (uint64, error)

// LoadBackup will scan location l for backup files in the given backup series and load them
// sequentially. Returns the maximum Since value on success, otherwise an error.
Expand Down
2 changes: 1 addition & 1 deletion worker/file_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (h *fileHandler) Load(uri *url.URL, backupId string, fn loadFn) LoadResult
// of the last backup.
predSet := manifests[len(manifests)-1].getPredsInGroup(gid)

groupMaxUid, err := fn(fp, int(gid), predSet)
groupMaxUid, err := fn(fp, gid, predSet)
if err != nil {
return LoadResult{0, 0, err}
}
Expand Down
2 changes: 1 addition & 1 deletion worker/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func RunRestore(pdir, location, backupId, keyfile string) LoadResult {
// Scan location for backup files and load them. Each file represents a node group,
// and we create a new p dir for each.
return LoadBackup(location, backupId,
func(r io.Reader, groupId int, preds predicateSet) (uint64, error) {
func(r io.Reader, groupId uint32, preds predicateSet) (uint64, error) {

dir := filepath.Join(pdir, fmt.Sprintf("p%d", groupId))
r, err := enc.GetReader(keyfile, r)
Expand Down
2 changes: 1 addition & 1 deletion worker/s3_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (h *s3Handler) Load(uri *url.URL, backupId string, fn loadFn) LoadResult {
// of the last backup.
predSet := manifests[len(manifests)-1].getPredsInGroup(gid)

groupMaxUid, err := fn(reader, int(gid), predSet)
groupMaxUid, err := fn(reader, gid, predSet)
if err != nil {
return LoadResult{0, 0, err}
}
Expand Down