Skip to content

Commit

Permalink
Remove incorrect comments from unit tests. Delete log lines added for…
Browse files Browse the repository at this point in the history
… debugging

Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Dec 30, 2024
1 parent a3032db commit e029da1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
5 changes: 0 additions & 5 deletions go/test/endtoend/vreplication/global_routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (

"github.com/stretchr/testify/require"

"vitess.io/vitess/go/vt/log"
vttablet "vitess.io/vitess/go/vt/vttablet/common"
)

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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}
Expand All @@ -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)
Expand All @@ -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)
Expand Down
17 changes: 8 additions & 9 deletions go/vt/vtgate/vindexes/vschema_routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
},
},
}
Expand Down Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion go/vt/vtgate/vschema_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit e029da1

Please sign in to comment.