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

tidb_query: fix analyze column inconsistent behavior betwen TiDB and TiKV #6055

Merged
merged 2 commits into from Nov 27, 2019
Merged

tidb_query: fix analyze column inconsistent behavior betwen TiDB and TiKV #6055

merged 2 commits into from Nov 27, 2019

Conversation

lonng
Copy link
Member

@lonng lonng commented Nov 26, 2019

Signed-off-by: Lonng heng@lonng.org

What have you changed?

The TiKV has inconsistent behavior with TiDB about analyzing column. see:
https://github.com/pingcap/tidb/blob/eae41adc0cd4a617d792a8bb426033c433a70527/statistics/sample.go#L173

The TiDB assumes samples will keep order with the original data order if the samples count greater than the max_sample_count. But TiKV replaces the original data if the index conflict, which breaks the assumption.

According to the TiDB logic, we should remove the item which index conflected, and append the new item to the samples.

What is the type of the changes?

Pick one of the following and delete the others:

  • Bugfix (a change which fixes an issue)

How is the PR tested?

Please select the tests that you ran to verify your changes:

  • Unit test

Signed-off-by: Lonng <heng@lonng.org>
@breezewish
Copy link
Member

What does this PR do?

@lonng lonng changed the title tidb_query: fix analyze column tidb_query: fix analyze column inconsistent behavior betwen TiDB and TiKV Nov 27, 2019
@lonng lonng added the sig/coprocessor SIG: Coprocessor label Nov 27, 2019
@lonng
Copy link
Member Author

lonng commented Nov 27, 2019

@eurekaka PTAL

@lonng
Copy link
Member Author

lonng commented Nov 27, 2019

/merge

@sre-bot sre-bot added the status/can-merge Status: Can merge to base branch label Nov 27, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 27, 2019

Your auto merge job has been accepted, waiting for 5974

@sre-bot
Copy link
Contributor

sre-bot commented Nov 27, 2019

/run-all-tests

@sre-bot sre-bot merged commit 3e12ddc into tikv:master Nov 27, 2019
@eurekaka
Copy link
Contributor

Should this be cherry-picked to 3.0?

@lonng lonng deleted the fix-analyze-columnn branch November 28, 2019 12:11
@lonng lonng added needs-cherry-pick-release-3.0 Type: Need cherry pick to release 3.0 needs-cherry-pick-release-3.1 Type: Need cherry pick to release 3.1 labels Nov 28, 2019
@lonng
Copy link
Member Author

lonng commented Nov 28, 2019

/run-cherry-picker

@sre-bot
Copy link
Contributor

sre-bot commented Nov 28, 2019

cherry pick to release-3.1 in PR #6095

@sre-bot
Copy link
Contributor

sre-bot commented Nov 28, 2019

cherry pick to release-3.0 in PR #6096

sre-bot added a commit that referenced this pull request Nov 29, 2019
hawkingrei pushed a commit to hawkingrei/tikv that referenced this pull request Dec 1, 2019
zhang555 pushed a commit to zhang555/tikv that referenced this pull request Dec 16, 2019
sre-bot added a commit that referenced this pull request Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-3.0 Type: Need cherry pick to release 3.0 needs-cherry-pick-release-3.1 Type: Need cherry pick to release 3.1 sig/coprocessor SIG: Coprocessor status/can-merge Status: Can merge to base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants