| 1 |
# ==== Purpose and Implementation ==== |
| 2 |
# Set binlog_group_commit_sync_delay to 1~9. |
| 3 |
# case1) Have binlog_group_commit_sync_no_delay_count > 1, and the number of |
| 4 |
# transaction commits less than binlog_group_commit_sync_no_delay_count, these |
| 5 |
# commits should not hang forever if no more commits come in; |
| 6 |
# case2) If binlog_group_commit_sync_no_delay_count = 0 transaction commits |
| 7 |
# should not hang forever; |
| 8 |
# |
| 9 |
# ==== References ==== |
| 10 |
# |
| 11 |
# Bug#22891628: BINARY GROUP COMMIT HANGS WHEN BINLOG_GROUP_COMMIT_SYNC_DELAY |
| 12 |
# IS SET TO 1~9 |
| 13 |
# |
| 14 |
############################################################################### |
| 15 |
--source include/have_log_bin.inc |
| 16 |
|
| 17 |
CREATE TABLE t(id INT PRIMARY KEY, v INT NOT NULL) ENGINE INNODB; |
| 18 |
|
| 19 |
INSERT INTO t VALUES(1, 100), (2, 100), (3, 100), (4, 100); |
| 20 |
--let $bgcd_saved=`SELECT @@GLOBAL.binlog_group_commit_sync_delay` |
| 21 |
##################### begin of case 1 ###################### |
| 22 |
SET GLOBAL binlog_group_commit_sync_delay = 8; |
| 23 |
SET GLOBAL binlog_group_commit_sync_no_delay_count = 2; |
| 24 |
|
| 25 |
BEGIN; |
| 26 |
UPDATE t set v = v + 100 WHERE id = 1; |
| 27 |
COMMIT; # hangs here forever if no more commits come in |
| 28 |
|
| 29 |
###################### end of case 1 ####################### |
| 30 |
|
| 31 |
##################### begin of case 2 ###################### |
| 32 |
SET GLOBAL binlog_group_commit_sync_delay = 8; |
| 33 |
SET GLOBAL binlog_group_commit_sync_no_delay_count = 0; |
| 34 |
|
| 35 |
BEGIN; |
| 36 |
UPDATE t set v = v + 100 WHERE id = 3; |
| 37 |
COMMIT; # hangs here forever |
| 38 |
|
| 39 |
###################### end of case 2 ####################### |
| 40 |
--eval SET GLOBAL binlog_group_commit_sync_delay=$bgcd_saved |
| 41 |
DROP TABLE t; |