-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PS-6113: If ANALYZE TABLE runs more than 600 seconds diagnostic query…
… may crash server https://jira.percona.com/browse/PS-6113 Locking of table statistics limited to the time when statistics related table members are changed. While calculation is done, statistics are not locked, so can be queried. Index analysis protected by new mutex as it cannot be done concurrently, because it shares the same index object which is modified during analysis.
- Loading branch information
1 parent
cf74174
commit afe0c60
Showing
12 changed files
with
162 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE t1(a int, index inda(a)) ENGINE=INNODB; | ||
INSERT INTO t1 VALUES(1); | ||
SET DEBUG_SYNC='innodb_dict_stats_update_persistent SIGNAL analyze.running WAIT_FOR analyze.finish'; | ||
ANALYZE TABLE t1; | ||
SET DEBUG_SYNC='now WAIT_FOR analyze.running'; | ||
SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql') AND ENGINE='InnoDB'; | ||
ENGINE SUM(DATA_LENGTH+INDEX_LENGTH) COUNT(ENGINE) SUM(DATA_LENGTH) SUM(INDEX_LENGTH) | ||
InnoDB 49152 2 32768 16384 | ||
SET DEBUG_SYNC='now SIGNAL analyze.finish'; | ||
Table Op Msg_type Msg_text | ||
test.t1 analyze status OK | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# | ||
# Bug #97828 | ||
# PS-6113: If ANALYZE TABLE runs more than 600 seconds diagnostic query may crash server | ||
# | ||
|
||
--source include/have_innodb.inc | ||
--source include/count_sessions.inc | ||
|
||
CREATE TABLE t1(a int, index inda(a)) ENGINE=INNODB; | ||
INSERT INTO t1 VALUES(1); | ||
|
||
SET DEBUG_SYNC='innodb_dict_stats_update_persistent SIGNAL analyze.running WAIT_FOR analyze.finish'; | ||
--send ANALYZE TABLE t1 | ||
|
||
# ANALYZE TABLE is running. Query for stats. | ||
|
||
--connect(con1, localhost, root) | ||
SET DEBUG_SYNC='now WAIT_FOR analyze.running'; | ||
|
||
SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql') AND ENGINE='InnoDB'; | ||
|
||
# let the ANALYZE TABLE to finish | ||
SET DEBUG_SYNC='now SIGNAL analyze.finish'; | ||
--disconnect con1 | ||
|
||
--connection default | ||
--reap | ||
DROP TABLE t1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters