Adds padding to keyrange comparison#8296
Merged
deepthi merged 3 commits intovitessio:mainfrom Jun 10, 2021
Merged
Conversation
added 2 commits
June 8, 2021 14:37
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
ajm188
approved these changes
Jun 10, 2021
| // This means that from a keyrange perspective -80 == 00-80 == 0000-8000 == 000000-800000 | ||
| // If we don't add this padding, we could run into issues when transitioning from keyranges | ||
| // that use 2 bytes to 4 bytes. | ||
| func addPadding(kr []byte) []byte { |
There was a problem hiding this comment.
This feels like it's converting a key from a "short" version into something normalized? It might make sense to expose this as a function on the KeyRange struct or as a (KeyRange) -> KeyRange then make that an exported function from the package.
I don't think this is a blocking comment; this PR seems safe/good to merge is.
There was a problem hiding this comment.
The (very reasonable) counterpoint here is that it's a bit late to start talking about a normalized keyrange format; i don't really know if it's worth trying to go down that road at this point unless this comes up again.
rafael
pushed a commit
to tinyspeck/vitess
that referenced
this pull request
Sep 23, 2021
* We ran into some issues related to padding. This is another form of the bug fixed in here: vitessio#8296 Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2 tasks
ajm188
pushed a commit
to tinyspeck/vitess
that referenced
this pull request
Sep 28, 2021
…ge-comparison Adds padding to keyrange comparison
33 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
-0080toff80-).0000-8000 == 000000-800000.Checklist