-
Notifications
You must be signed in to change notification settings - Fork 411
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
Fix incorrect string value when doing int_handle.toNext #6724
Conversation
Signed-off-by: Wish <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
/release |
/build |
can you elaborate more about why this cause data lost in #6699? |
I updated the PR description, please take a look again, thanks! |
/run-all-tests |
EXPECT_EQ(v0, min(v0, v0_next)); | ||
|
||
EXPECT_EQ(v1, max(v0, v1)); | ||
EXPECT_EQ(v1, max(v0, v0_next)); |
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.
It's confusing. EXPECT_EQ(v1, v0_next)
is better ?
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
/merge |
@breezewish: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 97cc654
|
@breezewish: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/rebuild |
/run-integration-test |
close pingcap#6699 Signed-off-by: ywqzzy <[email protected]>
Signed-off-by: Wish [email protected]
What problem does this PR solve?
Issue Number: close #6699
Problem Summary:
Consider an Int Handle in variable
foo
which is 0xCCAB. It is encoded as{ 80 00 00 00 00 00 CC AB }
in bytes.In #6538:
The implementation of
toNext()
is incorrect because it violates the rule that the int_value and bytes_value should be matching.Let's see what will happen when this rule is not respected:
Consider we construct a new Int Handle in variable
bar
from int 0xCCAC. It will be built asint_value = 0xCCAC, bytes_value = { 80 00 00 00 00 00 CC AC }
. Nowbar
andfoo
'content are not identical any more.The
max
,min
and several other basic functions are implemented by comparing bytes values:As a result, buggy things happen, like
foo.toNext() != bar
. Everything related with equality or orders may have wrong results.What is changed and how it works?
Encode Int handle using
toPrefixNext()
intoNext()
, so that the int_value and bytes_value are still matching.Check List
Tests
Side effects
Documentation
Release note