Skip to content
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
5 changes: 5 additions & 0 deletions go/vt/vttablet/tabletmanager/rpc_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ func (agent *ActionAgent) ChangeType(ctx context.Context, tabletType topodatapb.
return err
}

// If we have been told we're master, update master term start time.
if tabletType == topodatapb.TabletType_MASTER {
agent.setMasterTermStartTime(time.Now())
}

// let's update our internal state (stop query service and other things)
if err := agent.refreshTablet(ctx, "ChangeType"); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttablet/tabletmanager/shard_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (agent *ActionAgent) abortMasterTerm(ctx context.Context, masterAlias *topo
if *mysqlctl.DisableActiveReparents {
// Don't touch anything at the MySQL level. Just update tablet state.
log.Infof("Active reparents are disabled; updating tablet state only.")
return agent.SlaveWasRestarted(ctx, masterAlias)
return agent.ChangeType(ctx, topodatapb.TabletType_REPLICA)
}

// Do a full demotion to convert MySQL into a replica.
Expand Down