Skip to content

Commit

Permalink
managerclient: add host to repair progress details
Browse files Browse the repository at this point in the history
Previously if a specific host was specified for a repair that was not
reported in the repair progress and not tracked with a repair run.

Added host to the repair_run table and return that info via the API and
render in the progress output when available.

fixes #3067
  • Loading branch information
kevinbarbour authored and mmatczuk committed Mar 7, 2022
1 parent f0f8e6b commit bd08511
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/managerclient/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ Progress: {{ FormatRepairProgress .TokenRanges .Success .Error }}
Intensity: {{ .Intensity }}
Parallel: {{ .Parallel }}
{{- end }}
{{ if .Host }}Host: {{ .Host }}
{{ end -}}
{{ if .Dcs }}Datacenters: {{ range .Dcs }}
- {{ . }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions pkg/schema/table/table.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/service/repair/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type Run struct {
ID uuid.UUID

DC []string
Host string
PrevID uuid.UUID
StartTime time.Time
}
Expand Down Expand Up @@ -187,6 +188,7 @@ type TableProgress struct {
type Progress struct {
progress
DC []string `json:"dcs"`
Host string `json:"host"`
Hosts []HostProgress `json:"hosts"`
Tables []TableProgress `json:"tables"`
Intensity float64 `json:"intensity"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/service/repair/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func (s *Service) Repair(ctx context.Context, clusterID, taskID, runID uuid.UUID
TaskID: taskID,
ID: runID,
DC: target.DC,
Host: target.Host,
StartTime: timeutc.Now().UTC(),
}
if err := s.putRun(run); err != nil {
Expand Down Expand Up @@ -743,6 +744,7 @@ func (s *Service) GetProgress(ctx context.Context, clusterID, taskID, runID uuid
return p, err
}
p.DC = run.DC
p.Host = run.Host

return p, nil
}
Expand Down
4 changes: 3 additions & 1 deletion schema/v3.0.0.cql
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ ALTER TABLE scheduler_task ADD last_success timestamp;
ALTER TABLE scheduler_task ADD last_error timestamp;
ALTER TABLE scheduler_task ADD deleted boolean;

-- CALL setExistingTasksDeleted;
-- CALL setExistingTasksDeleted;

ALTER TABLE repair_run ADD host text;
3 changes: 3 additions & 0 deletions swagger/gen/scylla-manager/models/repair_progress.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions swagger/scylla-manager.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
"type": "string"
}
},
"host": {
"type": "string"
},
"intensity": {
"type": "number"
},
Expand Down

0 comments on commit bd08511

Please sign in to comment.