-
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
[e2e] vtctld init tablet and some output-based commands #15297
[e2e] vtctld init tablet and some output-based commands #15297
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
|
e0e7152
to
551a156
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15297 +/- ##
==========================================
- Coverage 67.41% 65.45% -1.96%
==========================================
Files 1560 1562 +2
Lines 192752 193911 +1159
==========================================
- Hits 129952 126933 -3019
- Misses 62800 66978 +4178 ☔ View full report in Codecov by Sentry. |
7394191
to
ef0aa74
Compare
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.
Nice! A couple of little things need fixing, rest LGTM.
@@ -246,6 +245,11 @@ func (cluster *LocalProcessCluster) StartTopo() (err error) { | |||
cluster.VtctlProcess.LogDir = cluster.TmpDirectory | |||
} | |||
|
|||
if err = cluster.TopoProcess.OpenServer(*topoFlavor, cluster.VtctlProcess.TopoGlobalRoot); err != nil { |
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 err = cluster.TopoProcess.OpenServer(*topoFlavor, cluster.VtctlProcess.TopoGlobalRoot); err != nil { | |
if err = cluster.TopoProcess.OpenServer(*topoFlavor, cluster.VtctldClientProcess.TopoGlobalRoot); err != nil { |
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 not exist (note the original was VtctlProcess
not VtctlclientProcess
)
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.
IMO we should replace the vtctl
client usage as well with the new vtctldclient
equivalent: https://github.com/vitessio/vitess/pull/14315/files
It offers additional testing of it and moves us away from that client as well so that we could potentially remove it as well (assuming we can use vtctldclient --server internal
instead of vtctl
when appropriate). Without also removing the vtctl
binary as well we can't get rid of any of the vtctlclient
related code so I think it's important. Unless you think I'm missing something?
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.
LGTM! I only had some minor comments. Let me know what you think and I'll come back to this quickly.
@@ -167,7 +167,7 @@ func firstBackupTest(t *testing.T, tabletType string) { | |||
mysqlctl.CompressionEngineName = "lz4" | |||
defer func() { mysqlctl.CompressionEngineName = "pgzip" }() | |||
// now bring up the other replica, letting it restore from backup. | |||
err = localCluster.VtctlclientProcess.InitTablet(replica2, cell, keyspaceName, hostname, shardName) | |||
err = localCluster.InitTablet(replica2, keyspaceName, 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.
AFAIK InitTablet is deprecated now for some time and thus not implemented in vtctldclient side. Can we take this opportunity to replace its usage? If not, does that mean InitTablet still has a valid use case and should be migrated to vtctldclient as well? Otherwise we're not actually getting rid of the usage, we're just moving it. It does have the nice benefit, however, of only having one place to change later on.
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.
as i understand it, InitTablet
as a user command is deprecated and (deliberately) not implemented in the new client, but it's still relevant for creating tablet records without actually starting a tablet process which is useful only for tests I wonder if we could use CreateTablet
instead like tabletmanager does?
@@ -246,6 +245,11 @@ func (cluster *LocalProcessCluster) StartTopo() (err error) { | |||
cluster.VtctlProcess.LogDir = cluster.TmpDirectory | |||
} | |||
|
|||
if err = cluster.TopoProcess.OpenServer(*topoFlavor, cluster.VtctlProcess.TopoGlobalRoot); err != nil { |
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.
IMO we should replace the vtctl
client usage as well with the new vtctldclient
equivalent: https://github.com/vitessio/vitess/pull/14315/files
It offers additional testing of it and moves us away from that client as well so that we could potentially remove it as well (assuming we can use vtctldclient --server internal
instead of vtctl
when appropriate). Without also removing the vtctl
binary as well we can't get rid of any of the vtctlclient
related code so I think it's important. Unless you think I'm missing something?
idk why it's not letting me reply inline to #15297 (comment) but
That's absolutely correct. Let me rework the GlobalRoot to set it somewhere in addition to |
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
80178ad
to
b1375de
Compare
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
@mattlord no rush at all, but this is ready for another review whenever you get some time :) |
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
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.
LGTM. Thank you for working on this, @ajm188 !
require.NoError(t, err) | ||
require.GreaterOrEqual(t, len(resp.Workflows), 1, "responce should have at least one workflow") |
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.
Not sure it's even worth a CI run, but response is misspelled.
} else { | ||
assertNodeCount(t, result, int(2)) | ||
result, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("GetShardReplication", cell1, KeyspaceShard) |
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't use vtctldclient ShardReplicationPositions
instead?
require.NoError(t, err) | ||
require.GreaterOrEqual(t, len(resp.Workflows), 1, "responce should have at least one workflow") |
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.
responce creeping around again :-)
err = clusterInstance.VtctldClientProcess.ChangeTabletType(rdOnlyTablet, topodata.TabletType_SPARE) | ||
require.NoError(t, err) | ||
// Change it back to RDONLY afterward as the cluster is re-used. | ||
defer func() { | ||
err = clusterInstance.VtctlclientChangeTabletType(rdOnlyTablet, topodata.TabletType_RDONLY) | ||
err = clusterInstance.VtctldClientProcess.ExecuteCommand("ChangeTabletType", rdOnlyTablet.Alias, "rdonly") |
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.
Curious why we're using .ChangeTabletType()
in one place and .ExecuteCommand()
in the other.
Description
This PR began as an attempt to remove the deprecated
InitTablet
with the underlying topo call, and then evolved to also migrate some of the output-based commands fromvtctlclient
tovtctldclient
Related Issue(s)
#15273
Checklist
Deployment Notes