-
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
statistics: skip update global count and modify_count if only the partition is locked #47259
statistics: skip update global count and modify_count if only the partition is locked #47259
Conversation
Hi @hi-rustin. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #47259 +/- ##
================================================
- Coverage 72.9671% 72.6404% -0.3268%
================================================
Files 1340 1367 +27
Lines 400269 408804 +8535
================================================
+ Hits 292065 296957 +4892
- Misses 89270 93009 +3739
+ Partials 18934 18838 -96
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Test steps:
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 444517182499979273 | 103 | 1 | 1 | 0 |
| 444517182499979266 | 104 | 1 | 1 | 0 |
| 444517175068196868 | 105 | 0 | 0 | 0 |
| 444517182499979273 | 102 | 2 | 2 | 0 |
+--------------------+----------+--------------+-------+----------+
4 rows in set (0.01 sec)
mysql> lock stats pt partition p1;
Query OK, 0 rows affected (0.01 sec)
mysql> show stats_locked;
+---------+------------+----------------+--------+
| Db_name | Table_name | Partition_name | Status |
+---------+------------+----------------+--------+
| test | pt | p1 | locked |
+---------+------------+----------------+--------+
1 row in set (0.00 sec)
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 444517229685899274 | 103 | 2 | 2 | 0 |
| 444517182499979266 | 104 | 1 | 1 | 0 |
| 444517175068196868 | 105 | 0 | 0 | 0 |
| 444517229685899274 | 102 | 3 | 3 | 0 |
+--------------------+----------+--------------+-------+----------+
4 rows in set (0.00 sec
mysql> unlock stats pt partition p1;
Query OK, 0 rows affected (0.02 sec)
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 444517229685899274 | 103 | 2 | 2 | 0 |
| 444517229685899265 | 104 | 2 | 2 | 0 |
| 444517175068196868 | 105 | 0 | 0 | 0 |
| 444517229685899265 | 102 | 4 | 4 | 0 |
+--------------------+----------+--------------+-------+----------+
4 rows in set (0.01 sec)
mysql> select * from mysql.stats_meta;
+--------------------+----------+--------------+-------+----------+
| version | table_id | modify_count | count | snapshot |
+--------------------+----------+--------------+-------+----------+
| 444517229685899274 | 103 | 2 | 2 | 0 |
| 444517229685899265 | 104 | 2 | 2 | 0 |
| 444517175068196868 | 105 | 0 | 0 | 0 |
| 444517229685899265 | 102 | 4 | 4 | 0 |
+--------------------+----------+--------------+-------+----------+
4 rows in set (0.00 sec) |
/hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qw4990, time-and-fate, winoros The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
/unhold |
What problem does this PR solve?
Issue Number: ref #46351
Problem Summary:
What is changed and how it works?
skip update global count and modify_count if the table is locked.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.