diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-08-07 12:35:04 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-08-07 12:35:04 +0530 |
commit | 47f8a18fec604983e47fdf7c822d94b26d85cade (patch) | |
tree | 967f7c9e38a88de2db6cc47dfd575129c89fed29 /storage | |
parent | eef7540405849287abf94c0332adfc50cf4f13c5 (diff) | |
download | mariadb-git-47f8a18fec604983e47fdf7c822d94b26d85cade.tar.gz |
MDEV-20247 Replication hangs with "preparing" and never startsbb-10.1-MDEV-20247
- The commit ab6dd774082c57f48d998e03655c06b672799b2d 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.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 6 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 081fcbd9c51..5dfe240631b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1686,9 +1686,9 @@ innobase_srv_conc_enter_innodb( && thd_is_replication_slave_thread(trx->mysql_thd)) { const ulonglong end = my_interval_timer() + ulonglong(srv_replication_delay) * 1000000; - while (srv_conc_get_active_threads() - >= srv_thread_concurrency - || my_interval_timer() >= end) { + while ((srv_conc_get_active_threads() + >= srv_thread_concurrency) + && my_interval_timer() < end) { os_thread_sleep(2000 /* 2 ms */); } } else { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 5e7482ff6bf..b5002187e3b 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -1949,9 +1949,9 @@ innobase_srv_conc_enter_innodb( && thd_is_replication_slave_thread(trx->mysql_thd)) { const ulonglong end = my_interval_timer() + ulonglong(srv_replication_delay) * 1000000; - while (srv_conc_get_active_threads() - >= srv_thread_concurrency - || my_interval_timer() >= end) { + while ((srv_conc_get_active_threads() + >= srv_thread_concurrency) + && my_interval_timer() < end) { os_thread_sleep(2000 /* 2 ms */); } } else { |