-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some VReplication e2e Refactoring #14735
Some VReplication e2e Refactoring #14735
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
bf361fd
to
46916a5
Compare
c7dad2a
to
3035407
Compare
The expected tests are due to the combining/renaming of workflows. At time of merge we will need to mark these Not Required, Merge and mark the new ones Required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I had some relatively minor comments, questions, suggestions. Let me know what you think -- I can come back to review/discuss quickly.
"vreplication_basic", | ||
"vreplication_cellalias", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one could also be merged IMO, but doesn't have to be here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do this later if the current set of workflows runs without flakiness.
if vtgateConn == nil { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel right to me. I think that we should either return the error and handle it, or we should use the test reference to fail the test within the function using e.g. require.NoError(t, err)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to race conditions this call is sometimes made after vtgates have shutdown. This is not an error.
return vc | ||
} | ||
|
||
func (vc *VitessCluster) setupVtctld() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have an non-obvious dependency on setupVtctl()
, because of the AddCell
parts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove setupVtctl()
we will need to add it to setupVtctld()
but not otherwise.
numRDOnly++ | ||
} | ||
} | ||
numReplicas-- // account for primary, which also has replica type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is really about the fact that the shard hasn't elected a primary yet? The comment is not clear to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we wait for n replicas, the primary is not counted as one, even though the Vitess tablet type is replica
.
|
||
err := vc.VtctlClient.ExecuteCommand("RebuildKeyspaceGraph", keyspace.Name) | ||
require.NoError(t, err) | ||
|
||
log.Infof("Waiting for throttler config to be applied on all shards") | ||
for _, shard := range keyspace.Shards { | ||
for _, shardName := range shardNames { | ||
shard := keyspace.Shards[shardName] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another place where a nil check is probably worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only add to the map when we have a valid shard.
@@ -810,6 +916,13 @@ func (vc *VitessCluster) GetVTGateConn(t *testing.T) *mysql.Conn { | |||
return getConnection(t, vc.ClusterConfig.hostname, vc.ClusterConfig.vtgateMySQLPort) | |||
} | |||
|
|||
func getVTGateConn() (*mysql.Conn, func()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick comment would be nice. Just so that it's easy to see w/o looking at the function that it returns a connection (obvious) and a function to close it in a defer.
cell := vc.Cells[fkextConfig.cell] | ||
vtgate := cell.Vtgates[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another place that IMO is worth a nil check. I'm thinking that tracking down issues when there's a panic will be much harder than a NotNil check with a helpful error message (with file and line number).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We error out right at cluster setup if we are unable to create a vtgate for a cell.
if err != nil { | ||
return nil | ||
} | ||
return conn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this. We have the t
reference here, why not use require.NoError(t, err)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is specifically to do this. Look at comment for insertRow()
above.
Added "Do Not Merge" so that we don't end up merging before the patch releases, since we need to change set of required tests on merging and that might need fresh pushes to open PRs. |
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
…mp columns are failing on e2e tests on Mac Signed-off-by: Rohit Nayak <[email protected]>
… Mac. We are not really testing case sensitiveness here Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
…variable Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
…Cell which has been deleted Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
a068cd6
to
4ffe54e
Compare
Signed-off-by: Rohit Nayak <[email protected]>
We merged these two PRs concurrently and thus ended up with a breakage: - vitessio#14735 - vitessio#14786 This PR addresses that issue by using a locally scoped vtgate connection according to the newly established model. Signed-off-by: Matt Lord <[email protected]>
We need to change the required tests before we merge, I will do that once it has reviews
Description
This PR contains some simplifications and improvements of the e2e test framework. Some of these are:
srcCharset
anddstCharset
tosrc_charset
anddst_charset
, since these were causing failures on Mac.Related Issue(s)
Partly fixes: #13224
Checklist