-
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
VDiff: Fix vtctldclient limit bug #14778
VDiff: Fix vtctldclient limit bug #14778
Conversation
Signed-off-by: Matt Lord <[email protected]>
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
|
Signed-off-by: Matt Lord <[email protected]>
e4abb0a
to
bcef5b4
Compare
@@ -57,13 +57,13 @@ var ( | |||
TargetCells []string | |||
TabletTypes []topodatapb.TabletType | |||
Tables []string | |||
Limit uint32 // We only accept positive values but pass on an int64 | |||
Limit int64 |
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 want to accept only positive values, should this not be uint64
?? Either that, or we'll need to add validation.
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.
That was the idea initially, but vtctlclient allows it and 0 is equivalent to any negative value. We can't use uint64 as we'll then allow larger values than the backend supports. I was on the fence so left it. I can add a quick check for positive values though if you like that more.
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.
What does it mean that "0 is equivalent to any negative value"? What behavior do you get with a value of 0 for any of these flags?
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 an example: https://github.com/vitessio/vitess/blob/main/go/vt/vttablet/tabletmanager/vdiff/table_differ.go#L534-L538
But no matter as I added checks to prevent negative values from the client.
Signed-off-by: Matt Lord <[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, except for me being nit-picky about the error messages.
s/positive/non-negative
Or even better would be must be 0 or greater
or some variant of that.
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <[email protected]>
Description
This fixes the bug described in #14777. I also adjusted the other max related flag values as I noticed a difference from the
vtctlclient
implementation in that we were limiting the accepted values to 4,294,967,295 invtctldclient
vs 9,223,372,036,854,775,807 invtctlclient
.Related Issue(s)
Checklist