forked from mysql/mysql-server
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue#6]Lock-sys optimization (#49)
* Lock-sys optimization: sharded lock_sys mutex * Repair Lock-sys releated MTR * Use AArch64 word_add_fetch in rw_lock_lock_word_incr * FIX ASSERTION FAILURE: LOCK0LATCHES.CC:42:LOCK_SYS->REC_HASH->N_CELLS == LOCK_SYS->P * Issue#37 Add copyright and disclaimer information Co-authored-by: Winston-leon <[email protected]>
- Loading branch information
1 parent
7d10c82
commit bab0019
Showing
68 changed files
with
3,336 additions
and
1,570 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Bug #31329634 ASSERTION FAILURE: | ||
# LOCK0LATCHES.CC:42:LOCK_SYS->REC_HASH->N_CELLS == LOCK_SYS->P | ||
SELECT @@innodb_buffer_pool_size; | ||
@@innodb_buffer_pool_size | ||
17825792 | ||
SELECT @@innodb_buffer_pool_chunk_size; | ||
@@innodb_buffer_pool_chunk_size | ||
1048576 | ||
CREATE TABLE t1 (id INT PRIMARY KEY, val VARCHAR(1000)) ENGINE=INNODB; | ||
INSERT INTO t1 (id,val) VALUES (1,''),(2,''),(3,''),(4,''),(5,''); | ||
SET DEBUG_SYNC='lock_rec_restore_from_page_infimum_will_latch | ||
SIGNAL con1_will_latch | ||
WAIT_FOR con1_can_go'; | ||
UPDATE t1 SET val='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; | ||
SET DEBUG_SYNC='now WAIT_FOR con1_will_latch'; | ||
SET GLOBAL DEBUG='+d,syncpoint_after_lock_sys_resize_rec_hash'; | ||
SET GLOBAL innodb_buffer_pool_size= | ||
@@innodb_buffer_pool_size * 2 + @@innodb_buffer_pool_chunk_size; | ||
SET DEBUG_SYNC='now WAIT_FOR reached_after_lock_sys_resize_rec_hash'; | ||
SET DEBUG_SYNC='now SIGNAL con1_can_go'; | ||
SET GLOBAL DEBUG='-d,syncpoint_after_lock_sys_resize_rec_hash'; | ||
SET DEBUG_SYNC='now SIGNAL continue_after_lock_sys_resize_rec_hash'; | ||
DROP TABLE t1; | ||
SELECT @@innodb_buffer_pool_size; | ||
@@innodb_buffer_pool_size | ||
36700160 | ||
SET GLOBAL innodb_buffer_pool_size= | ||
(@@innodb_buffer_pool_size - @@innodb_buffer_pool_chunk_size) div 2; | ||
SELECT @@innodb_buffer_pool_size; | ||
@@innodb_buffer_pool_size | ||
17825792 |
68 changes: 68 additions & 0 deletions
68
mysql-test/suite/innodb/r/lock_trx_release_read_locks_in_x_mode.result
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,68 @@ | ||
CREATE TABLE t0 (id INT PRIMARY KEY) ENGINE=InnoDB; | ||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; | ||
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB; | ||
CREATE TABLE t3 (id INT PRIMARY KEY) ENGINE=InnoDB; | ||
CREATE TABLE t4 (id INT PRIMARY KEY) ENGINE=InnoDB; | ||
CREATE TABLE t5 (id INT PRIMARY KEY) ENGINE=InnoDB; | ||
INSERT INTO t0 (id) VALUES (1); | ||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
XA START 'x'; | ||
INSERT INTO t1 (id) VALUES (1);; | ||
INSERT INTO t2 (id) VALUES (1);; | ||
INSERT INTO t3 (id) VALUES (1);; | ||
INSERT INTO t4 (id) VALUES (1);; | ||
INSERT INTO t5 (id) VALUES (1);; | ||
SELECT * FROM t0 WHERE id=1 FOR UPDATE; | ||
id | ||
1 | ||
XA END 'x'; | ||
SET DEBUG_SYNC='lock_trx_release_read_locks_in_x_mode_will_release | ||
SIGNAL c0_releases_in_xmode'; | ||
SET DEBUG_SYNC='try_relatch_trx_and_shard_and_do_noted_expected_version | ||
SIGNAL c0_noted_expected_version | ||
WAIT_FOR c0_can_go | ||
EXECUTE 5'; | ||
XA PREPARE 'x'; | ||
BEGIN; | ||
SET DEBUG_SYNC = 'now WAIT_FOR c0_noted_expected_version'; | ||
SET DEBUG_SYNC='lock_wait_will_wait SIGNAL c0_can_go'; | ||
SELECT * FROM t1 FOR SHARE; | ||
BEGIN; | ||
SET DEBUG_SYNC = 'now WAIT_FOR c0_noted_expected_version'; | ||
SET DEBUG_SYNC='lock_wait_will_wait SIGNAL c0_can_go'; | ||
SELECT * FROM t2 FOR SHARE; | ||
BEGIN; | ||
SET DEBUG_SYNC = 'now WAIT_FOR c0_noted_expected_version'; | ||
SET DEBUG_SYNC='lock_wait_will_wait SIGNAL c0_can_go'; | ||
SELECT * FROM t3 FOR SHARE; | ||
BEGIN; | ||
SET DEBUG_SYNC = 'now WAIT_FOR c0_noted_expected_version'; | ||
SET DEBUG_SYNC='lock_wait_will_wait SIGNAL c0_can_go'; | ||
SELECT * FROM t4 FOR SHARE; | ||
BEGIN; | ||
SET DEBUG_SYNC = 'now WAIT_FOR c0_noted_expected_version'; | ||
SET DEBUG_SYNC='lock_wait_will_wait SIGNAL c0_can_go'; | ||
SELECT * FROM t5 FOR SHARE; | ||
SET DEBUG_SYNC='now WAIT_FOR c0_releases_in_xmode'; | ||
XA COMMIT 'x'; | ||
id | ||
1 | ||
COMMIT; | ||
id | ||
1 | ||
COMMIT; | ||
id | ||
1 | ||
COMMIT; | ||
id | ||
1 | ||
COMMIT; | ||
id | ||
1 | ||
COMMIT; | ||
DROP TABLE t0; | ||
DROP TABLE t1; | ||
DROP TABLE t2; | ||
DROP TABLE t3; | ||
DROP TABLE t4; | ||
DROP TABLE t5; |
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,20 @@ | ||
CREATE TABLE t ( | ||
id INT PRIMARY KEY, | ||
c0 INT, c1 INT, c2 INT, c3 INT, c4 INT, c5 INT, c6 INT, c7 INT, c8 INT, c9 INT, | ||
c10 INT, c11 INT, c12 INT, c13 INT, c14 INT, c15 INT, c16 INT, c17 INT, c18 INT, c19 INT, | ||
c20 INT, c21 INT, c22 INT, c23 INT, c24 INT, c25 INT, c26 INT, c27 INT, c28 INT, c29 INT, | ||
c30 INT, c31 INT, c32 INT, c33 INT, c34 INT, c35 INT, c36 INT, c37 INT, c38 INT, c39 INT, | ||
c40 INT, c41 INT, c42 INT, c43 INT, c44 INT, c45 INT, c46 INT, c47 INT, c48 INT, c49 INT, | ||
c50 INT, c51 INT, c52 INT, c53 INT, c54 INT, c55 INT, c56 INT, c57 INT, c58 INT, c59 INT, | ||
c60 INT, c61 INT, c62 INT, c63 INT, c64 INT, c65 INT, c66 INT, c67 INT, c68 INT, c69 INT, | ||
c70 INT, c71 INT, c72 INT, c73 INT, c74 INT, c75 INT, c76 INT, c77 INT, c78 INT, c79 INT, | ||
c80 INT, c81 INT, c82 INT, c83 INT, c84 INT, c85 INT, c86 INT, c87 INT, c88 INT, c89 INT, | ||
c90 INT, c91 INT, c92 INT, c93 INT, c94 INT, c95 INT, c96 INT, c97 INT, c98 INT, c99 INT, | ||
c100 INT UNIQUE KEY | ||
) ENGINE=InnoDB; | ||
BEGIN; | ||
INSERT INTO t (id,c100) VALUES (1,1); | ||
INSERT INTO t (id,c100) VALUES (2,1); | ||
ERROR 23000: Duplicate entry '1' for key 't.c100' | ||
COMMIT; | ||
DROP TABLE t; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--innodb_buffer-pool-size=17825792 | ||
--innodb-buffer-pool-chunk-size=1048576 |
Oops, something went wrong.