-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
stats: fix panic when init stats for cm sketch #14421
Conversation
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
@@ -366,10 +378,8 @@ func (h *Handle) indexStatsFromStorage(row chunk.Row, table *statistics.Table, t | |||
errorRate := statistics.ErrorRate{} | |||
flag := row.GetInt64(8) | |||
lastAnalyzePos := row.GetDatum(10, types.NewFieldType(mysql.TypeBlob)) | |||
if statistics.IsAnalyzed(flag) { |
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.
This is another bug?
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.
Yes, the error rate should not be cleaned when using snapshot read.
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
/run-all-tests |
cherry pick to release-3.0 failed |
What problem does this PR solve?
Currently, when init stats, we use different txn to read stats for meta, histograms etc.
So it is possible that when init stats:
CMSketchFromProto
, and it panics because there is no rows in cm sketch.What is changed and how it works?
CMSketchFromProto
to avoid panic.Check List
Tests
Code changes
Side effects
Related changes
Release note