-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-20247 Replication hangs with "preparing" and never starts
- The commit ab6dd77 wrongly sets the condition inside innobase_srv_conc_enter_innodb(). Problem is that InnoDB makes the thread to sleep indefinitely if it is a replication slave thread. Thanks to Sujatha Sivakumar for contributing the replication test case.
- Loading branch information
1 parent
eef7540
commit 47f8a18
Showing
4 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.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,13 @@ | ||
include/master-slave.inc | ||
[connection master] | ||
SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; | ||
SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; | ||
SET GLOBAL innodb_thread_concurrency = 100; | ||
CREATE TABLE t(f INT) ENGINE=INNODB; | ||
INSERT INTO t VALUES (10); | ||
include/diff_tables.inc [master:t, slave:t] | ||
"===== Clean up=======" | ||
DROP TABLE t; | ||
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; | ||
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; | ||
include/rpl_end.inc |
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,41 @@ | ||
# ==== Purpose ==== | ||
# | ||
# Test verifies that replication shouldn't hang when number of active threads | ||
# on the slave server are less than the allowed innodb_thread_concurrency value. | ||
# | ||
# ==== Implementation ==== | ||
# | ||
# Steps: | ||
# 0 - Have master slave replication setup with engine being Innodb. | ||
# 1 - Configure innodb_thread_concurrency = 100. | ||
# 2 - Do some DML on master and sync the slave with master. | ||
# 3 - Ensure replication doesn't hang. | ||
# | ||
# ==== References ==== | ||
# | ||
# MDEV-20247: Replication hangs with "preparing" and never starts | ||
# | ||
|
||
--source include/master-slave.inc | ||
--source include/have_innodb.inc | ||
|
||
--connection slave | ||
SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; | ||
SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; | ||
SET GLOBAL innodb_thread_concurrency = 100; | ||
|
||
--connection master | ||
CREATE TABLE t(f INT) ENGINE=INNODB; | ||
INSERT INTO t VALUES (10); | ||
--sync_slave_with_master | ||
|
||
--let $diff_tables=master:t, slave:t | ||
--source include/diff_tables.inc | ||
|
||
--echo "===== Clean up=======" | ||
--connection master | ||
DROP TABLE t; | ||
--sync_slave_with_master | ||
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; | ||
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; | ||
--source include/rpl_end.inc |
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