diff --git a/go/test/endtoend/vreplication/global_routing_test.go b/go/test/endtoend/vreplication/global_routing_test.go index b4c4fc8dfa0..f1b9283387f 100644 --- a/go/test/endtoend/vreplication/global_routing_test.go +++ b/go/test/endtoend/vreplication/global_routing_test.go @@ -26,7 +26,6 @@ import ( "github.com/stretchr/testify/require" - "vitess.io/vitess/go/vt/log" vttablet "vitess.io/vitess/go/vt/vttablet/common" ) @@ -137,7 +136,6 @@ func (h *grHelpers) isNotGlobal(t *testing.T, tables []string) bool { _, err = vtgateConn.ExecuteFetch(fmt.Sprintf("use %s", target), 1, false) require.NoError(t, err) _, err := vtgateConn.ExecuteFetch(fmt.Sprintf("select * from %s", table), 1, false) - log.Infof("Got error %v, for table %s.%s", err, table, target) if err == nil || !strings.Contains(err.Error(), fmt.Sprintf("table %s not found", table)) { asExpected = false } @@ -278,7 +276,6 @@ func testGlobalRouting(t *testing.T, markAsGlobal, unshardedHasVSchema bool, fun h.insertData(t, config.ksU1, table, 1, config.ksU1) vtgateConn, cancel := getVTGateConn() waitForRowCount(t, vtgateConn, config.ksU1+"@replica", table, 1) - log.Infof("waitForRowCount succeeded for %s, %s", config.ksU1+"@replica", table) cancel() } keyspaces := []string{config.ksU1} @@ -294,7 +291,6 @@ func testGlobalRouting(t *testing.T, markAsGlobal, unshardedHasVSchema bool, fun h.insertData(t, config.ksU2, table, 1, config.ksU2) vtgateConn, cancel := getVTGateConn() waitForRowCount(t, vtgateConn, config.ksU2+"@replica", table, 1) - log.Infof("waitForRowCount succeeded for %s, %s", config.ksU2+"@replica", table) cancel() } keyspaces = append(keyspaces, config.ksU2) @@ -309,7 +305,6 @@ func testGlobalRouting(t *testing.T, markAsGlobal, unshardedHasVSchema bool, fun h.insertData(t, config.ksS1, table, 1, config.ksS1) vtgateConn, cancel := getVTGateConn() waitForRowCount(t, vtgateConn, config.ksS1+"@replica", table, 1) - log.Infof("waitForRowCount succeeded for %s, %s", config.ksS1+"@replica", table) cancel() } keyspaces = append(keyspaces, config.ksS1) diff --git a/go/vt/vtgate/vindexes/vschema_routing_test.go b/go/vt/vtgate/vindexes/vschema_routing_test.go index fb012e79aa5..6e713b186c7 100644 --- a/go/vt/vtgate/vindexes/vschema_routing_test.go +++ b/go/vt/vtgate/vindexes/vschema_routing_test.go @@ -62,27 +62,25 @@ func TestAutoGlobalRoutingExt(t *testing.T) { }, }, Tables: map[string]*vschemapb.Table{ - "table5": {}, // unique, should be added to global routing - "scommon1": {}, // common with unsharded1 and unsharded2, should be added to global routing because it's in the vschema - "scommon2": {}, // common with unsharded2, ambiguous because of sharded2 + "table5": {}, + "scommon1": {}, + "scommon2": {}, }, }, } sharded2 := &testKeySpace{ name: "sharded2", ks: &vschemapb.Keyspace{ - Sharded: true, - RequireExplicitRouting: true, + Sharded: true, Vindexes: map[string]*vschemapb.Vindex{ "xxhash": { Type: "xxhash", }, }, - // none should be considered for choice as global or ambiguous because of RequireExplicitRouting Tables: map[string]*vschemapb.Table{ - "table6": {}, // unique - "scommon2": {}, // common with sharded2, but has RequireExplicitRouting - "scommon3": {}, // common with sharded2 + "table6": {}, + "scommon2": {}, + "scommon3": {}, }, }, } @@ -171,6 +169,7 @@ func TestAutoGlobalRoutingExt(t *testing.T) { } for _, ks := range tc.keyspaces { source.Keyspaces[ks.name] = ks.ks + // set it false for all keyspaces here and later override for those requested in the test case ks.ks.RequireExplicitRouting = false for tname := range ks.ks.Tables { _, ok := allTables[tname] diff --git a/go/vt/vtgate/vschema_manager.go b/go/vt/vtgate/vschema_manager.go index 9f408cf56e2..6003ff9f0a1 100644 --- a/go/vt/vtgate/vschema_manager.go +++ b/go/vt/vtgate/vschema_manager.go @@ -198,7 +198,6 @@ func (vm *VSchemaManager) buildAndEnhanceVSchema(v *vschemapb.SrvVSchema) *vinde // We need to skip if already present, to handle the case where MoveTables has switched traffic // and removed the source vschema but not from the source database because user asked to --keep-data if MarkUniqueUnshardedTablesAsGlobal { - log.Infof(">>>>>>>> Marking unique unsharded tables as global") vindexes.AddAdditionalGlobalTables(v, vschema) } }