Skip to content

Commit

Permalink
PlannedReparent: Rename PromoteSlave -> PromoteReplica. Deprecate
Browse files Browse the repository at this point in the history
PromoteSlaveWhenCaughtUp RPC

Signed-off-by: deepthi <[email protected]>
  • Loading branch information
deepthi committed Apr 14, 2020
1 parent 4378c83 commit 0fa8c20
Show file tree
Hide file tree
Showing 18 changed files with 373 additions and 126 deletions.
10 changes: 5 additions & 5 deletions go/vt/mysqlctl/fakemysqldaemon/fakemysqldaemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ type FakeMysqlDaemon struct {
// same it returns nil, if different it returns an error
WaitMasterPosition mysql.Position

// PromoteSlaveResult is returned by PromoteSlave
PromoteSlaveResult mysql.Position
// PromoteResult is returned by Promote
PromoteResult mysql.Position

// SchemaFunc provides the return value for GetSchema.
// If not defined, the "Schema" field will be used instead, see below.
Expand Down Expand Up @@ -348,9 +348,9 @@ func (fmd *FakeMysqlDaemon) WaitMasterPos(_ context.Context, pos mysql.Position)
return fmt.Errorf("wrong input for WaitMasterPos: expected %v got %v", fmd.WaitMasterPosition, pos)
}

// PromoteSlave is part of the MysqlDaemon interface
func (fmd *FakeMysqlDaemon) PromoteSlave(hookExtraEnv map[string]string) (mysql.Position, error) {
return fmd.PromoteSlaveResult, nil
// Promote is part of the MysqlDaemon interface
func (fmd *FakeMysqlDaemon) Promote(hookExtraEnv map[string]string) (mysql.Position, error) {
return fmd.PromoteResult, nil
}

// ExecuteSuperQueryList is part of the MysqlDaemon interface
Expand Down
5 changes: 2 additions & 3 deletions go/vt/mysqlctl/mysql_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ type MysqlDaemon interface {

WaitMasterPos(context.Context, mysql.Position) error

// PromoteSlave makes the slave the new master. It will not change
// Promote makes the current server master. It will not change
// the read_only state of the server.
PromoteSlave(map[string]string) (mysql.Position, error)

Promote(map[string]string) (mysql.Position, error)
// Schema related methods
GetSchema(dbName string, tables, excludeTables []string, includeViews bool) (*tabletmanagerdatapb.SchemaDefinition, error)
GetColumns(dbName, table string) ([]*querypb.Field, []string, error)
Expand Down
4 changes: 2 additions & 2 deletions go/vt/mysqlctl/reparent.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func (mysqld *Mysqld) DemoteMaster() (rp mysql.Position, err error) {
return mysqld.MasterPosition()
}

// PromoteSlave will promote a slave to be the new master.
func (mysqld *Mysqld) PromoteSlave(hookExtraEnv map[string]string) (mysql.Position, error) {
// Promote will promote this server to be the new master.
func (mysqld *Mysqld) Promote(hookExtraEnv map[string]string) (mysql.Position, error) {
ctx := context.TODO()
conn, err := getPoolReconnect(ctx, mysqld.dbaPool)
if err != nil {
Expand Down
103 changes: 90 additions & 13 deletions go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go

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

Loading

0 comments on commit 0fa8c20

Please sign in to comment.