зеркало из https://github.com/github/vitess-gh.git
* feat: fix initialization code to also stop replication * feat: fix tests expectations * feat: fix wrangler tests --------- Signed-off-by: Manan Gupta <manan@planetscale.com>
This commit is contained in:
Родитель
f56e64a5a6
Коммит
d8c5160b4d
|
@ -169,3 +169,16 @@ func rowNumberFromPosition(pos string) int {
|
|||
rowNum, _ := strconv.Atoi(rowNumStr)
|
||||
return rowNum
|
||||
}
|
||||
|
||||
// TestTabletRestart tests that a running tablet can be restarted and everything is still fine
|
||||
func TestTabletRestart(t *testing.T) {
|
||||
defer cluster.PanicHandler(t)
|
||||
clusterInstance := utils.SetupReparentCluster(t, "semi_sync")
|
||||
defer utils.TeardownCluster(clusterInstance)
|
||||
tablets := clusterInstance.Keyspaces[0].Shards[0].Vttablets
|
||||
|
||||
utils.StopTablet(t, tablets[1], false)
|
||||
tablets[1].VttabletProcess.ServingStatus = "SERVING"
|
||||
err := tablets[1].VttabletProcess.Setup()
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ func TestInitShardPrimary(t *testing.T) {
|
|||
|
||||
tablet2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -76,6 +77,7 @@ func TestInitShardPrimary(t *testing.T) {
|
|||
tablet2.FakeMysqlDaemon.SetReplicationSourceInputs = append(tablet2.FakeMysqlDaemon.SetReplicationSourceInputs, fmt.Sprintf("%v:%v", tablet1.Tablet.Hostname, tablet1.Tablet.MysqlPort))
|
||||
|
||||
tablet3.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -919,7 +919,7 @@ func (tm *TabletManager) initializeReplication(ctx context.Context, tabletType t
|
|||
log.Warningf("primary tablet in the shard record doesn't have mysql hostname specified. probably because that tablet shutdown.")
|
||||
return nil, nil
|
||||
}
|
||||
if err := tm.MysqlDaemon.SetReplicationSource(ctx, currentPrimary.Tablet.MysqlHostname, int(currentPrimary.Tablet.MysqlPort), false /* stopReplicationBefore */, true /* startReplicationAfter */); err != nil {
|
||||
if err := tm.MysqlDaemon.SetReplicationSource(ctx, currentPrimary.Tablet.MysqlHostname, int(currentPrimary.Tablet.MysqlPort), true /* stopReplicationBefore */, true /* startReplicationAfter */); err != nil {
|
||||
return nil, vterrors.Wrap(err, "MysqlDaemon.SetReplicationSource failed")
|
||||
}
|
||||
|
||||
|
|
|
@ -382,6 +382,7 @@ func TestCheckPrimaryShip(t *testing.T) {
|
|||
fakeMysql := tm.MysqlDaemon.(*fakemysqldaemon.FakeMysqlDaemon)
|
||||
fakeMysql.SetReplicationSourceInputs = append(fakeMysql.SetReplicationSourceInputs, fmt.Sprintf("%v:%v", otherTablet.MysqlHostname, otherTablet.MysqlPort))
|
||||
fakeMysql.ExpectedExecuteSuperQueryList = []string{
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -182,7 +182,8 @@ func testBackupRestore(t *testing.T, cDetails *compressionDetails) error {
|
|||
},
|
||||
}
|
||||
sourceTablet.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -231,13 +232,15 @@ func testBackupRestore(t *testing.T, cDetails *compressionDetails) error {
|
|||
},
|
||||
}
|
||||
destTablet.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET SLAVE POSITION",
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -419,7 +422,8 @@ func TestBackupRestoreLagged(t *testing.T) {
|
|||
}
|
||||
sourceTablet.FakeMysqlDaemon.SetReplicationSourceInputs = []string{fmt.Sprintf("%s:%d", primary.Tablet.MysqlHostname, primary.Tablet.MysqlPort)}
|
||||
sourceTablet.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -489,13 +493,15 @@ func TestBackupRestoreLagged(t *testing.T) {
|
|||
},
|
||||
}
|
||||
destTablet.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET SLAVE POSITION",
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -642,7 +648,8 @@ func TestRestoreUnreachablePrimary(t *testing.T) {
|
|||
}
|
||||
sourceTablet.FakeMysqlDaemon.SetReplicationSourceInputs = []string{fmt.Sprintf("%s:%d", primary.Tablet.MysqlHostname, primary.Tablet.MysqlPort)}
|
||||
sourceTablet.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -684,13 +691,15 @@ func TestRestoreUnreachablePrimary(t *testing.T) {
|
|||
},
|
||||
}
|
||||
destTablet.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET SLAVE POSITION",
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -17,14 +17,13 @@ limitations under the License.
|
|||
package testlib
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"vitess.io/vitess/go/vt/discovery"
|
||||
|
||||
"context"
|
||||
|
||||
"vitess.io/vitess/go/mysql/fakesqldb"
|
||||
"vitess.io/vitess/go/sqltypes"
|
||||
"vitess.io/vitess/go/vt/logutil"
|
||||
|
@ -74,7 +73,8 @@ func copySchema(t *testing.T, useShardAsSource bool) {
|
|||
sourceRdonly := NewFakeTablet(t, wr, "cell1", 1,
|
||||
topodatapb.TabletType_RDONLY, sourceRdonlyDb, TabletKeyspaceShard(t, "ks", "-80"))
|
||||
sourceRdonly.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -137,7 +137,8 @@ func TestEmergencyReparentShard(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.WaitPrimaryPositions = append(goodReplica1.FakeMysqlDaemon.WaitPrimaryPositions, goodReplica1.FakeMysqlDaemon.CurrentSourceFilePosition)
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -169,7 +170,8 @@ func TestEmergencyReparentShard(t *testing.T) {
|
|||
goodReplica2.FakeMysqlDaemon.WaitPrimaryPositions = append(goodReplica2.FakeMysqlDaemon.WaitPrimaryPositions, goodReplica2.FakeMysqlDaemon.CurrentSourceFilePosition)
|
||||
goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -271,7 +273,8 @@ func TestEmergencyReparentShardPrimaryElectNotBest(t *testing.T) {
|
|||
moreAdvancedReplica.FakeMysqlDaemon.WaitPrimaryPositions = append(moreAdvancedReplica.FakeMysqlDaemon.WaitPrimaryPositions, moreAdvancedReplica.FakeMysqlDaemon.CurrentSourceFilePosition)
|
||||
newPrimary.FakeMysqlDaemon.WaitPrimaryPositions = append(newPrimary.FakeMysqlDaemon.WaitPrimaryPositions, moreAdvancedReplica.FakeMysqlDaemon.CurrentPrimaryPosition)
|
||||
moreAdvancedReplica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -17,14 +17,13 @@ limitations under the License.
|
|||
package testlib
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"vitess.io/vitess/go/vt/discovery"
|
||||
|
||||
"context"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"vitess.io/vitess/go/vt/logutil"
|
||||
|
@ -263,7 +262,8 @@ func TestTabletExternallyReparentedWithDifferentMysqlPort(t *testing.T) {
|
|||
// TabletActionReplicaWasRestarted and point to the new mysql port
|
||||
goodReplica.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -352,7 +352,8 @@ func TestTabletExternallyReparentedContinueOnUnexpectedPrimary(t *testing.T) {
|
|||
// TabletActionReplicaWasRestarted and point to a bad host
|
||||
goodReplica.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -437,7 +438,8 @@ func TestTabletExternallyReparentedRerun(t *testing.T) {
|
|||
// On the good replica, we will respond to
|
||||
// TabletActionReplicaWasRestarted.
|
||||
goodReplica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package testlib
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -24,8 +25,6 @@ import (
|
|||
"vitess.io/vitess/go/vt/discovery"
|
||||
"vitess.io/vitess/go/vt/topo/topoproto"
|
||||
|
||||
"context"
|
||||
|
||||
"vitess.io/vitess/go/sqltypes"
|
||||
"vitess.io/vitess/go/vt/logutil"
|
||||
"vitess.io/vitess/go/vt/topo"
|
||||
|
@ -564,7 +563,8 @@ func TestPermissions(t *testing.T) {
|
|||
}
|
||||
replica.FakeMysqlDaemon.SetReplicationSourceInputs = append(replica.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(primary.Tablet))
|
||||
replica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -117,7 +117,8 @@ func TestPlannedReparentShardNoPrimaryProvided(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.Replicating = true
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -236,7 +237,8 @@ func TestPlannedReparentShardNoError(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.Replicating = true
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -252,7 +254,8 @@ func TestPlannedReparentShardNoError(t *testing.T) {
|
|||
goodReplica2.FakeMysqlDaemon.ReadOnly = true
|
||||
goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -460,7 +463,8 @@ func TestPlannedReparentShardWaitForPositionFail(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.Replicating = true
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -476,7 +480,8 @@ func TestPlannedReparentShardWaitForPositionFail(t *testing.T) {
|
|||
goodReplica2.FakeMysqlDaemon.ReadOnly = true
|
||||
goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -573,7 +578,8 @@ func TestPlannedReparentShardWaitForPositionTimeout(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.Replicating = true
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -589,7 +595,8 @@ func TestPlannedReparentShardWaitForPositionTimeout(t *testing.T) {
|
|||
goodReplica2.FakeMysqlDaemon.ReadOnly = true
|
||||
goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -654,7 +661,8 @@ func TestPlannedReparentShardRelayLogError(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.Replicating = true
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(primary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -739,7 +747,8 @@ func TestPlannedReparentShardRelayLogErrorStartReplication(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.CurrentSourcePort = int(primary.Tablet.MysqlPort)
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// simulate error that will trigger a call to RestartReplication
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -852,7 +861,8 @@ func TestPlannedReparentShardPromoteReplicaFail(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.Replicating = true
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -868,7 +878,8 @@ func TestPlannedReparentShardPromoteReplicaFail(t *testing.T) {
|
|||
goodReplica2.FakeMysqlDaemon.ReadOnly = true
|
||||
goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(newPrimary.Tablet), topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -973,7 +984,8 @@ func TestPlannedReparentShardSamePrimary(t *testing.T) {
|
|||
goodReplica1.FakeMysqlDaemon.Replicating = true
|
||||
goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica1.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -989,7 +1001,8 @@ func TestPlannedReparentShardSamePrimary(t *testing.T) {
|
|||
goodReplica2.FakeMysqlDaemon.ReadOnly = true
|
||||
goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs = append(goodReplica2.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(oldPrimary.Tablet))
|
||||
goodReplica2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -91,7 +91,8 @@ func TestShardReplicationStatuses(t *testing.T) {
|
|||
replica.FakeMysqlDaemon.CurrentSourcePort = int(primary.Tablet.MysqlPort)
|
||||
replica.FakeMysqlDaemon.SetReplicationSourceInputs = append(replica.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(primary.Tablet))
|
||||
replica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
@ -160,7 +161,8 @@ func TestReparentTablet(t *testing.T) {
|
|||
replica.FakeMysqlDaemon.IOThreadRunning = true
|
||||
replica.FakeMysqlDaemon.SetReplicationSourceInputs = append(replica.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(primary.Tablet))
|
||||
replica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
|
@ -93,7 +93,8 @@ func TestVersion(t *testing.T) {
|
|||
sourceReplicaGitRev := "fake git rev"
|
||||
sourceReplica.FakeMysqlDaemon.SetReplicationSourceInputs = append(sourceReplica.FakeMysqlDaemon.SetReplicationSourceInputs, topoproto.MysqlAddr(sourcePrimary.Tablet))
|
||||
sourceReplica.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
|
||||
// These 3 statements come from tablet startup
|
||||
// These 4 statements come from tablet startup
|
||||
"STOP SLAVE",
|
||||
"RESET SLAVE ALL",
|
||||
"FAKE SET MASTER",
|
||||
"START SLAVE",
|
||||
|
|
Загрузка…
Ссылка в новой задаче