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

exchange partition lead to inaccurate stats_meta #56062

Closed
hawkingrei opened this issue Sep 13, 2024 · 0 comments · Fixed by #56055
Closed

exchange partition lead to inaccurate stats_meta #56062

hawkingrei opened this issue Sep 13, 2024 · 0 comments · Fixed by #56055
Assignees
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. component/statistics severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

there might be an issue with transactions updating the row count and modify_count

when we exchange partition,

img_v3_02el_d0c39630-3a3f-45a3-807c-6aa0df7fdcbg

img_v3_02el_b8139eb2-1469-4e0c-9cf3-cd3b6a6af16g

We will read this value and then perform operations on it. However, the problem is that he forgot to use "FOR UPDATE" when reading it to lock the data. As a result, subsequent updates may corrupt the data, leading to incorrect statistical values.

In scenarios with frequent write and delete operations, this can potentially lead to significant discrepancies

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. component/statistics severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants