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

replace master with primary #9427

Merged
merged 1 commit into from
Dec 21, 2021
Merged
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
8 changes: 4 additions & 4 deletions go/vt/topotools/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,20 @@ func GetAllTabletsAcrossCells(ctx context.Context, ts *topo.Server) ([]*topo.Tab
// SortedTabletMap returns two maps:
// - The replicaMap contains all the non-primary non-scrapped hosts.
// This can be used as a list of replicas to fix up for reparenting
// - The masterMap contains all the tablets without parents
// - The primaryMap contains all the tablets without parents
// (scrapped or not). This can be used to special case
// the old primary, and any tablet in a weird state, left over, ...
func SortedTabletMap(tabletMap map[string]*topo.TabletInfo) (map[string]*topo.TabletInfo, map[string]*topo.TabletInfo) {
replicaMap := make(map[string]*topo.TabletInfo)
masterMap := make(map[string]*topo.TabletInfo)
primaryMap := make(map[string]*topo.TabletInfo)
for alias, ti := range tabletMap {
if ti.Type == topodatapb.TabletType_PRIMARY {
masterMap[alias] = ti
primaryMap[alias] = ti
} else {
replicaMap[alias] = ti
}
}
return replicaMap, masterMap
return replicaMap, primaryMap
}

// CopyMapKeys copies keys from map m into a new slice with the
Expand Down