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) #6096

Merged
merged 3 commits into from Dec 20, 2019

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Nov 28, 2019

cherry-pick #6055 to release-3.0


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>
@sre-bot
Copy link
Contributor Author

sre-bot commented Nov 28, 2019

/run-all-tests

@iosmanthus
Copy link
Member

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Dec 2, 2019

Sorry @iosmanthus, you don't have permission to trigger auto merge event on this branch.

@breezewish breezewish added this to the v3.0.7 milestone Dec 4, 2019
@AndreMouche AndreMouche modified the milestones: v3.0.7, v3.0.8 Dec 20, 2019
Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

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

LGTM

@AndreMouche
Copy link
Member

/merge

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

sre-bot commented Dec 20, 2019

Your auto merge job has been accepted, waiting for 6244

@sre-bot
Copy link
Contributor Author

sre-bot commented Dec 20, 2019

/run-all-tests

@sre-bot sre-bot merged commit 4440438 into tikv:release-3.0 Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/coprocessor SIG: Coprocessor status/can-merge Status: Can merge to base branch type/cherry-pick Type: PR - Cherry pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants