-
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
Workflow: List -> Show, and Expand Metadata #6544
Conversation
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 is forward progress. We still need to get the routing rules. But that can be a separate PR. I'm slightly hesitant about the MasterReplicationStatuses
, but understand why, and can't think of something better. I'll let @rohit-nayak-ps also take a look to make sure there are no better alternatives.
go/vt/wrangler/vexec.go
Outdated
@@ -331,8 +361,12 @@ func (wr *Wrangler) getStreams(ctx context.Context, workflow, keyspace string) ( | |||
if err != nil { | |||
return nil, err | |||
} | |||
|
|||
// We set a topo timeout since we contact topo for the shard record. | |||
ctx, cancel := context.WithTimeout(ctx, 10*time.Second) |
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'd recommend using an existing flag. *topo.RemoteOperationTimeout
looks appropriate.
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.
Good call, I'll swap it out.
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.
Swapped.
I've included an expanded |
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. The only remaining concern is whether we are allowed to change the command name options like this or we should be marking List
as deprecated and allowing it as a synonym for Show
.
@rohit-nayak-ps we did not explicitly mark VExec
and Workflow
as experimental in 7.0. What are your thoughts on rename vs deprecation?
…mmand, and changed the command from List to Show. Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2b789f0
to
1e51804
Compare
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
… it's a subcommand. Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
I built in accepting |
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 know this code well enough to approve, but the comments I made earlier are now resolved so I have no objections.
@@ -2967,7 +2971,7 @@ func commandWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag. | |||
if err != nil { | |||
return err | |||
} | |||
if action == "list" || action == "listall" { | |||
if action == "show" || action == "listall" { |
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.
Do we not print anything out for show
/ listall
?
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.
@rohit-nayak-ps this doesn't look right. However, it is unrelated to the changes in this PR so I'm going to move this forward.
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.
The printing happens internally actually. From what I can tell this is a way of handling split code paths from subcommands.
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 Peter replied, show/listall follows a separate path and outputs a json doc. Otherwise we just return rows affected (result of vexec for stop/start/delete workflow)
This PR renames the
List
subcommand toShow
and expands the metadata to also returnTabletControls
and whether the master of each shard is currently serving write traffic. This PR also changed thelistStreams
method to be namedShowWorkflow
to fit the new subcommand nomenclature, and makes it public sovitess-operator
can use this wrangler method, and expose replication status information in a k8s friendly way.