Skip to content

Commit

Permalink
update func GetBackupCandidates
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Wang <[email protected]>
  • Loading branch information
Jun Wang committed Nov 29, 2023
1 parent 370a3cf commit e2c9a0e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions go/vt/vtctl/reparentutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,9 @@ func waitForCatchUp(
// GetBackupCandidates is used to get a list of healthy tablets for backup
func GetBackupCandidates(tablets []*topo.TabletInfo, stats []*replicationdatapb.Status) (res []*topo.TabletInfo) {
for i, stat := range stats {
// Always include TabletType_PRIMARY
if tablets[i].Type == topodatapb.TabletType_PRIMARY {
res = append(res, tablets[i])
continue
}
// shardTablets[i] and stats[i] is 1:1 mapping
// Healthy shardTablets[i] will be added to tablets
if stat != nil {
// Always include TabletType_PRIMARY. Healthy shardTablets[i] will be added to tablets
if tablets[i].Type == topodatapb.TabletType_PRIMARY || stat != nil {
res = append(res, tablets[i])
}
}
Expand Down

0 comments on commit e2c9a0e

Please sign in to comment.