diff --git a/go/test/endtoend/tabletmanager/custom_rule_topo_test.go b/go/test/endtoend/tabletmanager/custom_rule_topo_test.go index 2e4bdefa36d..a2155ff33d0 100644 --- a/go/test/endtoend/tabletmanager/custom_rule_topo_test.go +++ b/go/test/endtoend/tabletmanager/custom_rule_topo_test.go @@ -61,7 +61,7 @@ func TestTopoCustomRule(t *testing.T) { } // Start a new Tablet - rTablet := clusterInstance.GetVttabletInstance("replica", replicaUID, "") + rTablet := clusterInstance.GetVttabletInstance("replica", 0, "") // Init Tablets err = clusterInstance.VtctlclientProcess.InitTablet(rTablet, cell, keyspaceName, hostname, shardName) diff --git a/go/test/endtoend/tabletmanager/main_test.go b/go/test/endtoend/tabletmanager/main_test.go index a3ff579335b..8dd433a9afc 100644 --- a/go/test/endtoend/tabletmanager/main_test.go +++ b/go/test/endtoend/tabletmanager/main_test.go @@ -42,8 +42,6 @@ var ( masterTablet cluster.Vttablet replicaTablet cluster.Vttablet rdonlyTablet cluster.Vttablet - replicaUID int - masterUID int hostname = "localhost" keyspaceName = "ks" shardName = "0" diff --git a/go/test/endtoend/tabletmanager/master/tablet_master_test.go b/go/test/endtoend/tabletmanager/master/tablet_master_test.go new file mode 100644 index 00000000000..ddae64d229e --- /dev/null +++ b/go/test/endtoend/tabletmanager/master/tablet_master_test.go @@ -0,0 +1,253 @@ +/* +Copyright 2019 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package master + +import ( + "encoding/json" + "flag" + "fmt" + "net/http" + "os" + "testing" + + "vitess.io/vitess/go/json2" + + "vitess.io/vitess/go/test/endtoend/cluster" + + "github.com/stretchr/testify/assert" + querypb "vitess.io/vitess/go/vt/proto/query" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" +) + +var ( + clusterInstance *cluster.LocalProcessCluster + masterTablet cluster.Vttablet + replicaTablet cluster.Vttablet + hostname = "localhost" + keyspaceName = "ks" + shardName = "0" + cell = "zone1" + sqlSchema = ` + create table t1( + id bigint, + value varchar(16), + primary key(id) + ) Engine=InnoDB; +` + + vSchema = ` + { + "sharded": true, + "vindexes": { + "hash": { + "type": "hash" + } + }, + "tables": { + "t1": { + "column_vindexes": [ + { + "column": "id", + "name": "hash" + } + ] + } + } + }` +) + +func TestMain(m *testing.M) { + flag.Parse() + + exitCode := func() int { + clusterInstance = cluster.NewCluster(cell, hostname) + defer clusterInstance.Teardown() + + // Start topo server + err := clusterInstance.StartTopo() + if err != nil { + return 1 + } + + // Set extra tablet args for lock timeout + clusterInstance.VtTabletExtraArgs = []string{ + "-lock_tables_timeout", "5s", + "-watch_replication_stream", + "-enable_replication_reporter", + } + // We do not need semiSync for this test case. + clusterInstance.EnableSemiSync = false + + // Start keyspace + keyspace := &cluster.Keyspace{ + Name: keyspaceName, + SchemaSQL: sqlSchema, + VSchema: vSchema, + } + + if err = clusterInstance.StartUnshardedKeyspace(*keyspace, 1, false); err != nil { + return 1 + } + + // Collect table paths and ports + tablets := clusterInstance.Keyspaces[0].Shards[0].Vttablets + for _, tablet := range tablets { + if tablet.Type == "master" { + masterTablet = *tablet + } else if tablet.Type != "rdonly" { + replicaTablet = *tablet + } + } + + return m.Run() + }() + os.Exit(exitCode) +} + +func TestRepeatedInitShardMaster(t *testing.T) { + // Test that using InitShardMaster can go back and forth between 2 hosts. + + // Make replica tablet as master + err := clusterInstance.VtctlclientProcess.InitShardMaster(keyspaceName, shardName, cell, replicaTablet.TabletUID) + assert.Nil(t, err) + + // Run health check on both, make sure they are both healthy. + // Also make sure the types are correct. + err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", masterTablet.Alias) + assert.Nil(t, err) + checkHealth(t, masterTablet.HTTPPort, false) + + err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", replicaTablet.Alias) + assert.Nil(t, err) + checkHealth(t, replicaTablet.HTTPPort, false) + + checkTabletType(t, masterTablet.Alias, "REPLICA") + checkTabletType(t, replicaTablet.Alias, "MASTER") + + // Come back to the original tablet. + err = clusterInstance.VtctlclientProcess.InitShardMaster(keyspaceName, shardName, cell, masterTablet.TabletUID) + assert.Nil(t, err) + + // Run health check on both, make sure they are both healthy. + // Also make sure the types are correct. + err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", masterTablet.Alias) + assert.Nil(t, err) + checkHealth(t, masterTablet.HTTPPort, false) + + err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", replicaTablet.Alias) + assert.Nil(t, err) + checkHealth(t, replicaTablet.HTTPPort, false) + + checkTabletType(t, masterTablet.Alias, "MASTER") + checkTabletType(t, replicaTablet.Alias, "REPLICA") +} + +func TestMasterRestartSetsTERTimestamp(t *testing.T) { + // Test that TER timestamp is set when we restart the MASTER vttablet. + // TER = TabletExternallyReparented. + // See StreamHealthResponse.tablet_externally_reparented_timestamp for details. + + // Make replica as master + err := clusterInstance.VtctlclientProcess.InitShardMaster(keyspaceName, shardName, cell, replicaTablet.TabletUID) + assert.Nil(t, err) + + err = replicaTablet.VttabletProcess.WaitForTabletType("SERVING") + assert.Nil(t, err) + + // Capture the current TER. + result, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput( + "VtTabletStreamHealth", "-count", "1", replicaTablet.Alias) + assert.Nil(t, err) + + var streamHealthRes1 querypb.StreamHealthResponse + err = json.Unmarshal([]byte(result), &streamHealthRes1) + assert.Nil(t, err) + actualType := streamHealthRes1.GetTarget().GetTabletType() + tabletType := topodatapb.TabletType_value["MASTER"] + got := fmt.Sprintf("%d", actualType) + want := fmt.Sprintf("%d", tabletType) + assert.Equal(t, want, got) + assert.NotNil(t, streamHealthRes1.GetTabletExternallyReparentedTimestamp()) + assert.True(t, streamHealthRes1.GetTabletExternallyReparentedTimestamp() > 0, + "TER on MASTER must be set after InitShardMaster") + + // Restart the MASTER vttablet and test again + + // kill the newly promoted master tablet + err = replicaTablet.VttabletProcess.TearDown() + assert.Nil(t, err) + + // Start Vttablet + err = clusterInstance.StartVttablet(&replicaTablet, "SERVING", false, cell, keyspaceName, hostname, shardName) + assert.Nil(t, err) + + // Make sure that the TER did not change + result, err = clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput( + "VtTabletStreamHealth", "-count", "1", replicaTablet.Alias) + assert.Nil(t, err) + + var streamHealthRes2 querypb.StreamHealthResponse + err = json.Unmarshal([]byte(result), &streamHealthRes2) + assert.Nil(t, err) + + actualType = streamHealthRes2.GetTarget().GetTabletType() + tabletType = topodatapb.TabletType_value["MASTER"] + got = fmt.Sprintf("%d", actualType) + want = fmt.Sprintf("%d", tabletType) + assert.Equal(t, want, got) + + assert.NotNil(t, streamHealthRes2.GetTabletExternallyReparentedTimestamp()) + assert.True(t, streamHealthRes2.GetTabletExternallyReparentedTimestamp() == streamHealthRes1.GetTabletExternallyReparentedTimestamp(), + fmt.Sprintf("When the MASTER vttablet was restarted, "+ + "the TER timestamp must be set by reading the old value from the tablet record. Old: %d, New: %d", + streamHealthRes1.GetTabletExternallyReparentedTimestamp(), + streamHealthRes2.GetTabletExternallyReparentedTimestamp())) + + // Reset master + err = clusterInstance.VtctlclientProcess.InitShardMaster(keyspaceName, shardName, cell, masterTablet.TabletUID) + assert.Nil(t, err) + err = masterTablet.VttabletProcess.WaitForTabletType("SERVING") + assert.Nil(t, err) + +} + +func checkHealth(t *testing.T, port int, shouldError bool) { + url := fmt.Sprintf("http://localhost:%d/healthz", port) + resp, err := http.Get(url) + assert.Nil(t, err) + if shouldError { + assert.True(t, resp.StatusCode > 400) + } else { + assert.Equal(t, 200, resp.StatusCode) + } +} + +func checkTabletType(t *testing.T, tabletAlias string, typeWant string) { + result, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("GetTablet", tabletAlias) + assert.Nil(t, err) + + var tablet topodatapb.Tablet + err = json2.Unmarshal([]byte(result), &tablet) + assert.Nil(t, err) + + actualType := tablet.GetType() + got := fmt.Sprintf("%d", actualType) + + tabletType := topodatapb.TabletType_value[typeWant] + want := fmt.Sprintf("%d", tabletType) + + assert.Equal(t, want, got) +} diff --git a/go/test/endtoend/tabletmanager/tablet_health_test.go b/go/test/endtoend/tabletmanager/tablet_health_test.go index 3c009567049..f6a6f180be2 100644 --- a/go/test/endtoend/tabletmanager/tablet_health_test.go +++ b/go/test/endtoend/tabletmanager/tablet_health_test.go @@ -121,7 +121,7 @@ func TestHealthCheck(t *testing.T) { err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", rTablet.Alias) assert.Nil(t, err) - checkHealth(t, replicaTablet.HTTPPort, false) + checkHealth(t, rTablet.HTTPPort, false) // Make sure the master is still master checkTabletType(t, masterTablet.Alias, "MASTER") @@ -143,7 +143,7 @@ func TestHealthCheck(t *testing.T) { assert.Nil(t, err) err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", rTablet.Alias) assert.Nil(t, err) - checkHealth(t, replicaTablet.HTTPPort, false) + checkHealth(t, rTablet.HTTPPort, false) // now test VtTabletStreamHealth returns the right thing result, err = clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("VtTabletStreamHealth", "-count", "2", rTablet.Alias) @@ -207,7 +207,8 @@ func TestHealthCheckDrainedStateDoesNotShutdownQueryService(t *testing.T) { // - the query service won't be shutdown //Wait if tablet is not in service state - waitForTabletStatus(rdonlyTablet, "SERVING") + err := rdonlyTablet.VttabletProcess.WaitForTabletType("SERVING") + assert.Nil(t, err) // Check tablet health checkHealth(t, rdonlyTablet.HTTPPort, false) @@ -217,7 +218,7 @@ func TestHealthCheckDrainedStateDoesNotShutdownQueryService(t *testing.T) { // actions are similar to the SplitClone vtworker command // implementation.) The tablet will stay healthy, and the // query service is still running. - err := clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", rdonlyTablet.Alias, "drained") + err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", rdonlyTablet.Alias, "drained") assert.Nil(t, err) // Trying to drain the same tablet again, should error err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", rdonlyTablet.Alias, "drained") @@ -232,7 +233,8 @@ func TestHealthCheckDrainedStateDoesNotShutdownQueryService(t *testing.T) { checkTabletType(t, rdonlyTablet.Alias, "DRAINED") // Query service is still running. - waitForTabletStatus(rdonlyTablet, "SERVING") + err = rdonlyTablet.VttabletProcess.WaitForTabletType("SERVING") + assert.Nil(t, err) // Restart replication. Tablet will become healthy again. err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", rdonlyTablet.Alias, "rdonly") @@ -244,55 +246,205 @@ func TestHealthCheckDrainedStateDoesNotShutdownQueryService(t *testing.T) { checkHealth(t, rdonlyTablet.HTTPPort, false) } -func waitForTabletStatus(tablet cluster.Vttablet, status string) error { - timeout := time.Now().Add(10 * time.Second) - for time.Now().Before(timeout) { - if tablet.VttabletProcess.WaitForStatus(status) { - return nil - } - time.Sleep(300 * time.Millisecond) +func TestIgnoreHealthError(t *testing.T) { + // This test verify the tablet health by Ignoring the error + // For this case we need a healthy tablet in a shard without any master. + // When we try to make a connection to such tablet we get "no slave status" error. + // We will then ignore this error and verify if the status report the tablet as Healthy. + + // Create a new shard + newShard := &cluster.Shard{ + Name: "1", } - return fmt.Errorf("Tablet status is not %s ", status) + + // Start mysql process + tablet := clusterInstance.GetVttabletInstance("replica", 0, "") + tablet.MysqlctlProcess = *cluster.MysqlCtlProcessInstance(tablet.TabletUID, tablet.MySQLPort, clusterInstance.TmpDirectory) + err := tablet.MysqlctlProcess.Start() + + // start vttablet process + tablet.VttabletProcess = cluster.VttabletProcessInstance(tablet.HTTPPort, + tablet.GrpcPort, + tablet.TabletUID, + clusterInstance.Cell, + newShard.Name, + clusterInstance.Keyspaces[0].Name, + clusterInstance.VtctldProcess.Port, + tablet.Type, + clusterInstance.TopoProcess.Port, + clusterInstance.Hostname, + clusterInstance.TmpDirectory, + clusterInstance.VtTabletExtraArgs, + clusterInstance.EnableSemiSync) + tablet.Alias = tablet.VttabletProcess.TabletPath + newShard.Vttablets = append(newShard.Vttablets, tablet) + + clusterInstance.Keyspaces[0].Shards = append(clusterInstance.Keyspaces[0].Shards, *newShard) + + // Init Tablet + err = clusterInstance.VtctlclientProcess.InitTablet(tablet, cell, keyspaceName, hostname, newShard.Name) + assert.Nil(t, err) + + // create database + err = tablet.VttabletProcess.CreateDB(keyspaceName) + assert.Nil(t, err) + + // Start Vttablet, it should be NOT_SERVING as there is no master + err = clusterInstance.StartVttablet(tablet, "NOT_SERVING", false, cell, keyspaceName, hostname, newShard.Name) + assert.Nil(t, err) + + // Force it healthy. + err = clusterInstance.VtctlclientProcess.ExecuteCommand("IgnoreHealthError", tablet.Alias, ".*no slave status.*") + assert.Nil(t, err) + err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", tablet.Alias) + assert.Nil(t, err) + err = tablet.VttabletProcess.WaitForTabletType("SERVING") + assert.Nil(t, err) + checkHealth(t, tablet.HTTPPort, false) + + // Turn off the force-healthy. + err = clusterInstance.VtctlclientProcess.ExecuteCommand("IgnoreHealthError", tablet.Alias, "") + assert.Nil(t, err) + err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", tablet.Alias) + assert.Nil(t, err) + err = tablet.VttabletProcess.WaitForTabletType("NOT_SERVING") + assert.Nil(t, err) + checkHealth(t, tablet.HTTPPort, true) + + // Tear down custom processes + killTablets(t, tablet) } -func TestIgnoreHealthError(t *testing.T) { +func TestNoMysqlHealthCheck(t *testing.T) { + // This test starts a vttablet with no mysql port, while mysql is down. + // It makes sure vttablet will start properly and be unhealthy. + // Then we start mysql, and make sure vttablet becomes healthy. ctx := context.Background() - mTablet := clusterInstance.GetVttabletInstance("replica", masterUID, "") - //Init Tablets - err := clusterInstance.VtctlclientProcess.InitTablet(mTablet, cell, keyspaceName, hostname, shardName) - assert.Nil(t, err) + rTablet := clusterInstance.GetVttabletInstance("replica", 0, "") + mTablet := clusterInstance.GetVttabletInstance("replica", 0, "") - // Start Mysql Processes + // Start Mysql Processes and return connection masterConn, err := cluster.StartMySQLAndGetConnection(ctx, mTablet, username, clusterInstance.TmpDirectory) assert.Nil(t, err) defer masterConn.Close() - mTablet.MysqlctlProcess.Stop() - // Clean dir for mysql files - mTablet.MysqlctlProcess.CleanupFiles(mTablet.TabletUID) + replicaConn, err := cluster.StartMySQLAndGetConnection(ctx, rTablet, username, clusterInstance.TmpDirectory) + assert.Nil(t, err) + defer replicaConn.Close() + + // Create database in mysql + exec(t, masterConn, fmt.Sprintf("create database vt_%s", keyspaceName)) + exec(t, replicaConn, fmt.Sprintf("create database vt_%s", keyspaceName)) + + //Get the gtid to ensure we bring master and slave at same position + qr := exec(t, masterConn, "SELECT @@GLOBAL.gtid_executed") + gtid := string(qr.Rows[0][0].Raw()) + + // Ensure master ans salve are at same position + exec(t, replicaConn, "STOP SLAVE") + exec(t, replicaConn, "RESET MASTER") + exec(t, replicaConn, "RESET SLAVE") + exec(t, replicaConn, fmt.Sprintf("SET GLOBAL gtid_purged='%s'", gtid)) + exec(t, replicaConn, fmt.Sprintf("CHANGE MASTER TO MASTER_HOST='%s', MASTER_PORT=%d, MASTER_USER='vt_repl', MASTER_AUTO_POSITION = 1", hostname, mTablet.MySQLPort)) + exec(t, replicaConn, "START SLAVE") + + // now shutdown all mysqld + err = rTablet.MysqlctlProcess.Stop() + assert.Nil(t, err) + err = mTablet.MysqlctlProcess.Stop() + assert.Nil(t, err) + + //Init Tablets + err = clusterInstance.VtctlclientProcess.InitTablet(mTablet, cell, keyspaceName, hostname, shardName) + assert.Nil(t, err) + err = clusterInstance.VtctlclientProcess.InitTablet(rTablet, cell, keyspaceName, hostname, shardName) + assert.Nil(t, err) - // Start Vttablet, it should be NOT_SERVING state as mysql is stopped + // Start vttablet process, should be in NOT_SERVING state as mysqld is not running err = clusterInstance.StartVttablet(mTablet, "NOT_SERVING", false, cell, keyspaceName, hostname, shardName) + assert.Nil(t, err, "error should be Nil") + err = clusterInstance.StartVttablet(rTablet, "NOT_SERVING", false, cell, keyspaceName, hostname, shardName) + assert.Nil(t, err, "error should be Nil") + + // Check Health should fail as Mysqld is not found + checkHealth(t, mTablet.HTTPPort, true) + checkHealth(t, rTablet.HTTPPort, true) + + // Tell slave to not try to repair replication in healthcheck. + // The StopSlave will ultimately fail because mysqld is not running, + // But vttablet should remember that it's not supposed to fix replication. + err = clusterInstance.VtctlclientProcess.ExecuteCommand("StopSlave", rTablet.Alias) + assert.Error(t, err, "Fail as mysqld not running") + + //The above notice to not fix replication should survive tablet restart. + err = rTablet.VttabletProcess.TearDown() + assert.Nil(t, err) + err = rTablet.VttabletProcess.Setup() assert.Nil(t, err) - // Force it healthy. - err = clusterInstance.VtctlclientProcess.ExecuteCommand("IgnoreHealthError", mTablet.Alias, ".*no slave status.*") + // restart mysqld + rTablet.MysqlctlProcess.InitMysql = false + err = rTablet.MysqlctlProcess.Start() + assert.Nil(t, err) + mTablet.MysqlctlProcess.InitMysql = false + err = mTablet.MysqlctlProcess.Start() assert.Nil(t, err) + + // the master should still be healthy err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", mTablet.Alias) assert.Nil(t, err) - waitForTabletStatus(*mTablet, "SERVING") + checkHealth(t, mTablet.HTTPPort, false) - // Turn off the force-healthy. - err = clusterInstance.VtctlclientProcess.ExecuteCommand("IgnoreHealthError", mTablet.Alias, "") + // the slave will now be healthy, but report a very high replication + // lag, because it can't figure out what it exactly is. + err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", rTablet.Alias) assert.Nil(t, err) - err = clusterInstance.VtctlclientProcess.ExecuteCommand("RunHealthCheck", mTablet.Alias) + assert.Equal(t, "SERVING", rTablet.VttabletProcess.GetTabletStatus()) + checkHealth(t, rTablet.HTTPPort, false) + + result, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("VtTabletStreamHealth", "-count", "1", rTablet.Alias) + assert.Nil(t, err) + var streamHealthResponse querypb.StreamHealthResponse + err = json2.Unmarshal([]byte(result), &streamHealthResponse) + assert.Nil(t, err) + realTimeStats := streamHealthResponse.GetRealtimeStats() + secondsBehindMaster := realTimeStats.GetSecondsBehindMaster() + assert.True(t, secondsBehindMaster == 7200) + + // restart replication, wait until health check goes small + // (a value of zero is default and won't be in structure) + err = clusterInstance.VtctlclientProcess.ExecuteCommand("StartSlave", rTablet.Alias) assert.Nil(t, err) - waitForTabletStatus(*mTablet, "NOT_SERVING") - checkHealth(t, mTablet.HTTPPort, true) + + timeout := time.Now().Add(10 * time.Second) + for time.Now().Before(timeout) { + result, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("VtTabletStreamHealth", "-count", "1", rTablet.Alias) + assert.Nil(t, err) + var streamHealthResponse querypb.StreamHealthResponse + err = json2.Unmarshal([]byte(result), &streamHealthResponse) + assert.Nil(t, err) + realTimeStats := streamHealthResponse.GetRealtimeStats() + secondsBehindMaster := realTimeStats.GetSecondsBehindMaster() + if secondsBehindMaster < 30 { + break + } else { + time.Sleep(100 * time.Millisecond) + } + } + + // wait for the tablet to fix its mysql port + result, err = clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("GetTablet", rTablet.Alias) + assert.Nil(t, err) + var tablet topodatapb.Tablet + err = json2.Unmarshal([]byte(result), &tablet) + assert.Nil(t, err) + portMap := tablet.GetPortMap() + mysqlPort := int(portMap["mysql"]) + assert.True(t, mysqlPort == rTablet.MySQLPort, "mysql port in tablet record") // Tear down custom processes - killTablets(t, mTablet) + killTablets(t, rTablet, mTablet) } func killTablets(t *testing.T, tablets ...*cluster.Vttablet) { @@ -302,6 +454,5 @@ func killTablets(t *testing.T, tablets ...*cluster.Vttablet) { //Tear down Tablet tablet.VttabletProcess.TearDown() - } } diff --git a/go/test/endtoend/tabletmanager/tablet_security_policy_test.go b/go/test/endtoend/tabletmanager/tablet_security_policy_test.go index 0a878300c26..8b705121956 100644 --- a/go/test/endtoend/tabletmanager/tablet_security_policy_test.go +++ b/go/test/endtoend/tabletmanager/tablet_security_policy_test.go @@ -28,7 +28,7 @@ import ( func TestFallbackSecurityPolicy(t *testing.T) { ctx := context.Background() - mTablet := clusterInstance.GetVttabletInstance("replica", masterUID, "") + mTablet := clusterInstance.GetVttabletInstance("replica", 0, "") //Init Tablets err := clusterInstance.VtctlclientProcess.InitTablet(mTablet, cell, keyspaceName, hostname, shardName) @@ -86,7 +86,7 @@ func assertAllowedURLTest(t *testing.T, url string) { func TestDenyAllSecurityPolicy(t *testing.T) { ctx := context.Background() - mTablet := clusterInstance.GetVttabletInstance("replica", masterUID, "") + mTablet := clusterInstance.GetVttabletInstance("replica", 0, "") //Init Tablets err := clusterInstance.VtctlclientProcess.InitTablet(mTablet, cell, keyspaceName, hostname, shardName)