-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
WIP(POC): Batch stats delta dumping #58331
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a475f23
to
cea998a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58331 +/- ##
================================================
+ Coverage 73.2097% 73.6755% +0.4658%
================================================
Files 1679 1711 +32
Lines 462339 490043 +27704
================================================
+ Hits 338477 361042 +22565
- Misses 103082 106982 +3900
- Partials 20780 22019 +1239
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
|
||
// Execute locked updates | ||
if len(lockedValues) > 0 { | ||
sql := fmt.Sprintf("insert into mysql.stats_table_locked (version, table_id, modify_count, count) values %s "+ |
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.
From the doc https://docs.pingcap.com/tidb/stable/pessimistic-transaction,
our autocommit is still the optimistic lock, which may be a problem when the number of tables is large and the writes of one table are not gathered into one TiDB.
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.
We used the pessimistic transaction here: https://github.com/Rustin170506/tidb/blob/7f015a4a99f2715f6e3a097a57457d47e8f88217/pkg/statistics/handle/util/util.go#L195
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.
Seems that ExecCtx
doesn't pass the WrapTxn
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.
/retest |
1 similar comment
/retest |
8b71846
to
d1b01ac
Compare
/retest |
c8c78ea
to
abec344
Compare
Signed-off-by: Rustin170506 <[email protected]>
75f0002
to
5d16aad
Compare
Signed-off-by: Rustin170506 <[email protected]>
@Rustin170506: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #57869
Problem Summary:
What changed and how does it work?
In this PR, I tried to dump the stats delta batch by batch to speed up the process.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.