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: 1 addition & 4 deletions go/test/endtoend/reparent/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,7 @@ func CheckDBstatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet,
// unable to setReplicationSource. Since some tests are used in upgrade-downgrade testing, we need this function to
// work with different versions of vtctl.
func SetReplicationSourceFailed(tablet *cluster.Vttablet, prsOut string) bool {
if strings.Contains(prsOut, fmt.Sprintf("tablet %s failed to SetReplicationSource", tablet.Alias)) {
return true
}
return strings.Contains(prsOut, fmt.Sprintf("tablet %s failed to SetMaster", tablet.Alias))
return strings.Contains(prsOut, fmt.Sprintf("tablet %s failed to SetReplicationSource", tablet.Alias))
}

// CheckReplicationStatus checks that the replication for sql and io threads is setup as expected
Expand Down
66 changes: 20 additions & 46 deletions go/test/fuzzing/vttablet_fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,14 @@ func (fs *fuzzStore) callExecuteFetchAsApp() error {
return nil
}

// callInitMaster implements a wrapper
// for fuzzing InitMaster
func (fs *fuzzStore) callInitMaster() error {
// callInitPrimary implements a wrapper
// for fuzzing InitPrimary
func (fs *fuzzStore) callInitPrimary() error {
tablet, err := fs.getTablet()
if err != nil {
return err
}
_, _ = fs.client.InitMaster(context.Background(), tablet, false)
_, _ = fs.client.InitPrimary(context.Background(), tablet, false)
return nil
}

Expand Down Expand Up @@ -346,25 +346,14 @@ func (fs *fuzzStore) callStopReplication() error {
return nil
}

// callMasterPosition implements a wrapper
// for fuzzing MasterPosition
func (fs *fuzzStore) callMasterPosition() error {
// callPrimaryPosition implements a wrapper
// for fuzzing PrimaryPosition
func (fs *fuzzStore) callPrimaryPosition() error {
tablet, err := fs.getTablet()
if err != nil {
return err
}
_, _ = fs.client.MasterPosition(context.Background(), tablet)
return nil
}

// callDemoteMaster implements a wrapper
// for fuzzing DemoteMaster
func (fs *fuzzStore) callDemoteMaster() error {
tablet, err := fs.getTablet()
if err != nil {
return err
}
_, _ = fs.client.DemoteMaster(context.Background(), tablet)
_, _ = fs.client.PrimaryPosition(context.Background(), tablet)
return nil
}

Expand All @@ -379,14 +368,14 @@ func (fs *fuzzStore) callReplicationStatus() error {
return nil
}

// callMasterStatus implements a wrapper
// for fuzzing MasterStatus
func (fs *fuzzStore) callMasterStatus() error {
// callPrimaryStatus implements a wrapper
// for fuzzing PrimaryStatus
func (fs *fuzzStore) callPrimaryStatus() error {
tablet, err := fs.getTablet()
if err != nil {
return err
}
_, _ = fs.client.MasterStatus(context.Background(), tablet)
_, _ = fs.client.PrimaryStatus(context.Background(), tablet)
return nil
}

Expand All @@ -401,17 +390,6 @@ func (fs *fuzzStore) callDemotePrimary() error {
return nil
}

// callUndoDemoteMaster implements a wrapper
// for fuzzing UndoDemoteMaster
func (fs *fuzzStore) callUndoDemoteMaster() error {
tablet, err := fs.getTablet()
if err != nil {
return err
}
_ = fs.client.UndoDemoteMaster(context.Background(), tablet)
return nil
}

// callUndoDemotePrimary implements a wrapper
// for fuzzing UndoDemotePrimary
func (fs *fuzzStore) callUndoDemotePrimary() error {
Expand Down Expand Up @@ -543,9 +521,9 @@ func (fs *fuzzStore) callVReplicationWaitForPos() error {
return nil
}

// callSetMaster implements a wrapper
// for fuzzing SetMaster
func (fs *fuzzStore) callSetMaster() error {
// callSetReplicationSource implements a wrapper
// for fuzzing SetReplicationSource
func (fs *fuzzStore) callSetReplicationSource() error {
tablet, err := fs.getTablet()
if err != nil {
return err
Expand All @@ -562,7 +540,7 @@ func (fs *fuzzStore) callSetMaster() error {
if err != nil {
return err
}
_ = fs.client.SetMaster(context.Background(), tablet, parent, int64(timeCreatedNS), pos, false, false)
_ = fs.client.SetReplicationSource(context.Background(), tablet, parent, int64(timeCreatedNS), pos, false, false)
return nil
}

Expand Down Expand Up @@ -624,7 +602,7 @@ func (fs *fuzzStore) executeInRandomOrder() {
var err error
switch execInt % maxTargets {
case 0:
err = fs.callInitMaster()
err = fs.callInitPrimary()
case 1:
err = fs.callResetReplication()
case 2:
Expand All @@ -634,17 +612,13 @@ func (fs *fuzzStore) executeInRandomOrder() {
case 4:
err = fs.callStopReplication()
case 5:
err = fs.callMasterPosition()
case 6:
err = fs.callDemoteMaster()
err = fs.callPrimaryPosition()
case 7:
err = fs.callReplicationStatus()
case 8:
err = fs.callMasterStatus()
err = fs.callPrimaryStatus()
case 9:
err = fs.callDemotePrimary()
case 10:
err = fs.callUndoDemoteMaster()
case 11:
err = fs.callUndoDemotePrimary()
case 12:
Expand All @@ -666,7 +640,7 @@ func (fs *fuzzStore) executeInRandomOrder() {
case 20:
err = fs.callVReplicationWaitForPos()
case 21:
err = fs.callSetMaster()
err = fs.callSetReplicationSource()
case 22:
err = fs.callInitReplica()
case 23:
Expand Down
5 changes: 0 additions & 5 deletions go/vt/mysqlctl/fakemysqldaemon/fakemysqldaemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,6 @@ func (fmd *FakeMysqlDaemon) WaitForReparentJournal(ctx context.Context, timeCrea
return nil
}

// DemoteMaster is deprecated: use mysqld.DemotePrimary() instead
func (fmd *FakeMysqlDaemon) DemoteMaster() (mysql.Position, error) {
return fmd.CurrentPrimaryPosition, nil
}

// WaitSourcePos is part of the MysqlDaemon interface
func (fmd *FakeMysqlDaemon) WaitSourcePos(_ context.Context, pos mysql.Position) error {
if fmd.TimeoutHook != nil {
Expand Down
Loading