Skip to content
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

executor: fix the wrong order by pk desc result and some corner cases for unsigned pk #10179

Merged
merged 5 commits into from
Apr 19, 2019

Conversation

winoros
Copy link
Member

@winoros winoros commented Apr 17, 2019

What problem does this PR solve?

fix #10178

What is changed and how it works?

When split ranges, we forget to check the DESC status and some corner case checking.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@birdstorm birdstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qw4990
Copy link
Contributor

qw4990 commented Apr 17, 2019

/run-all-tests

@winoros
Copy link
Member Author

winoros commented Apr 17, 2019

/run-all-tests

@winoros
Copy link
Member Author

winoros commented Apr 17, 2019

/run-common-test

@XuHuaiyu
Copy link
Contributor

/run-common-test
/run-integration-common-test

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments of

type tableResultHandler struct {
	// If the pk is unsigned and we have KeepOrder=true.
	// optionalResult handles the request whose range is in signed int range.
	// result handles the request whose range is exceed signed int range.
	// Otherwise, we just set optionalFinished true and the result handles the whole ranges.
	optionalResult distsql.SelectResult
	result         distsql.SelectResult

	optionalFinished bool
}

should be updated?

HighVal: ranges[idx].HighVal,
HighExclude: ranges[idx].HighExclude,
})
if !(ranges[idx].LowVal[0].GetUint64() == math.MaxInt64 && ranges[idx].LowExclude) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there can be cases like (maxInt64, maxInt64] and [maxInt64+1, maxInt64+1)`. And then error thrown when send requests.

@codecov
Copy link

codecov bot commented Apr 18, 2019

Codecov Report

Merging #10179 into master will decrease coverage by 0.0032%.
The diff coverage is 89.4736%.

@@               Coverage Diff                @@
##             master     #10179        +/-   ##
================================================
- Coverage   77.9301%   77.9269%   -0.0033%     
================================================
  Files           407        407                
  Lines         82964      82911        -53     
================================================
- Hits          64654      64610        -44     
+ Misses        13514      13510         -4     
+ Partials       4796       4791         -5

@winoros winoros requested a review from XuHuaiyu April 18, 2019 11:36
@XuHuaiyu
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason merged commit 33015e1 into pingcap:master Apr 19, 2019
@zz-jason zz-jason added sig/execution SIG execution status/all tests passed status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. labels Apr 19, 2019
@shenli
Copy link
Member

shenli commented Apr 21, 2019

Please cherry-pick this to the release-2.1 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max result incorrect when using Unsigned bigint as primary key.
6 participants