Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
  • Loading branch information
rohit-nayak-ps committed Mar 19, 2024
1 parent aacd101 commit e9b9ab2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtctldclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Usage:
Available Commands:
AddCellInfo Registers a local topology service in a new cell by creating the CellInfo.
AddCellsAlias Defines a group of cells that can be referenced by a single name (the alias).
ApplyKeyspaceRoutingRules Applies the provided keyspace routing rules.
ApplyRoutingRules Applies the VSchema routing rules.
ApplySchema Applies the schema change to the specified keyspace on every primary, running in parallel on all shards. The changes are then propagated to replicas via replication.
ApplyShardRoutingRules Applies the provided shard routing rules.
Expand Down Expand Up @@ -39,6 +40,7 @@ Available Commands:
GetCellsAliases Gets all CellsAlias objects in the cluster.
GetFullStatus Outputs a JSON structure that contains full status of MySQL including the replication information, semi-sync information, GTID information among others.
GetKeyspace Returns information about the given keyspace from the topology.
GetKeyspaceRoutingRules Displays the currently active keyspace routing rules.
GetKeyspaces Returns information about every keyspace in the topology.
GetPermissions Displays the permissions for a tablet.
GetRoutingRules Displays the VSchema routing rules.
Expand Down
6 changes: 3 additions & 3 deletions go/test/endtoend/vreplication/multi_tenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (mtm *multiTenantMigration) getLastID(tenantId int64) int64 {
}

func (mtm *multiTenantMigration) initTenantData(t *testing.T, tenantId int64, sourceAliasKeyspace string) {
mtm.insertSomeData(t, tenantId, sourceAliasKeyspace, numInitialRowsPerTenant)
mtm.insertSomeData(t, tenantId, getSourceKeyspace(tenantId), numInitialRowsPerTenant)
}

func getInitialTabletIdForTenant(tenantId int64) int {
Expand Down Expand Up @@ -200,7 +200,7 @@ func (mtm *multiTenantMigration) switchTraffic(tenantId int64) {
t := mtm.t
sourceAliasKeyspace := getSourceAliasKeyspace(tenantId)
sourceKeyspaceName := getSourceKeyspace(tenantId)
mt := mtm.activeMoveTables[tenantId]
mt := mtm.getActiveMoveTables(tenantId)
ksWorkflow := fmt.Sprintf("%s.%s", mtm.targetKeyspace, mt.workflowName)
waitForWorkflowState(t, vc, ksWorkflow, binlogdatapb.VReplicationWorkflowState_Running.String())
// we intentionally insert first into the source alias keyspace and then the source keyspace to test routing rules for both.
Expand All @@ -210,7 +210,7 @@ func (mtm *multiTenantMigration) switchTraffic(tenantId int64) {
}

func (mtm *multiTenantMigration) complete(tenantId int64) {
mt := mtm.activeMoveTables[tenantId]
mt := mtm.getActiveMoveTables(tenantId)
mt.Complete()
vtgateConn := vc.GetVTGateConn(mtm.t)
defer vtgateConn.Close()
Expand Down
1 change: 1 addition & 0 deletions go/vt/vtctl/workflow/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ func (s *Server) moveTablesCreate(ctx context.Context, req *vtctldatapb.MoveTabl
if multiTenantSpec == nil {
return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "multi-tenant spec not found for target keyspace %s", targetKeyspace)
}
// Validate that the tenant id matches the data type of the column provided in the multi-tenant spec of the vschema.
if err := validateTenantId(multiTenantSpec.TenantIdColumnType, req.WorkflowOptions.TenantId); err != nil {
return nil, err
}
Expand Down

0 comments on commit e9b9ab2

Please sign in to comment.