From: "Brian Evans" <grknight@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mariadb/files/, dev-db/mariadb/
Date: Wed, 7 Aug 2019 16:54:17 +0000 (UTC) [thread overview]
Message-ID: <1565196849.c50fef32cdf155707ff367f2990996be6c010b1f.grknight@gentoo> (raw)
commit: c50fef32cdf155707ff367f2990996be6c010b1f
Author: Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 7 16:53:24 2019 +0000
Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Wed Aug 7 16:54:09 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c50fef32
dev-db/mariadb: Revbump for critical replication bug
MDEV-20247 Replication hangs with "preparing" and never starts
Include upstream fix
Package-Manager: Portage-2.3.71, Repoman-2.3.17
Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
.../files/MDEV-20247-replication-10.2.patch | 108 ++++++++++++++++++
dev-db/mariadb/files/MDEV-20247-replication.patch | 121 +++++++++++++++++++++
...db-10.1.41.ebuild => mariadb-10.1.41-r1.ebuild} | 1 +
...db-10.2.26.ebuild => mariadb-10.2.26-r1.ebuild} | 1 +
...db-10.3.17.ebuild => mariadb-10.3.17-r1.ebuild} | 1 +
...iadb-10.4.7.ebuild => mariadb-10.4.7-r1.ebuild} | 1 +
6 files changed, 233 insertions(+)
diff --git a/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch b/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch
new file mode 100644
index 00000000000..193f2dd7750
--- /dev/null
+++ b/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch
@@ -0,0 +1,108 @@
+From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001
+From: Thirunarayanan Balathandayuthapani <thiru@mariadb.com>
+Date: Wed, 7 Aug 2019 12:35:04 +0530
+Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never
+ starts
+
+- 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.
+---
+ .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++
+ .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++
+ storage/innobase/handler/ha_innodb.cc | 6 +--
+ 4 files changed, 60 insertions(+), 6 deletions(-)
+ create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
+ create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
+
+diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
+new file mode 100644
+index 000000000000..0ed894336a1c
+--- /dev/null
++++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
+@@ -0,0 +1,18 @@
++include/master-slave.inc
++[connection master]
++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);
++connection slave;
++include/diff_tables.inc [master:t, slave:t]
++"===== Clean up======="
++connection master;
++DROP TABLE t;
++connection slave;
++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
++include/rpl_end.inc
+diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
+new file mode 100644
+index 000000000000..b4c2971d2fbc
+--- /dev/null
++++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
+@@ -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
+diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
+index 081fcbd9c51e..5dfe240631b8 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/dev-db/mariadb/files/MDEV-20247-replication.patch b/dev-db/mariadb/files/MDEV-20247-replication.patch
new file mode 100644
index 00000000000..92f8e0e1a67
--- /dev/null
+++ b/dev-db/mariadb/files/MDEV-20247-replication.patch
@@ -0,0 +1,121 @@
+From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001
+From: Thirunarayanan Balathandayuthapani <thiru@mariadb.com>
+Date: Wed, 7 Aug 2019 12:35:04 +0530
+Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never
+ starts
+
+- 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.
+---
+ .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++
+ .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++
+ storage/innobase/handler/ha_innodb.cc | 6 +--
+ storage/xtradb/handler/ha_innodb.cc | 6 +--
+ 4 files changed, 60 insertions(+), 6 deletions(-)
+ create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
+ create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
+
+diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
+new file mode 100644
+index 000000000000..0ed894336a1c
+--- /dev/null
++++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result
+@@ -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
+diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
+new file mode 100644
+index 000000000000..b4c2971d2fbc
+--- /dev/null
++++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test
+@@ -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
+diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
+index 081fcbd9c51e..5dfe240631b8 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 5e7482ff6bfa..b5002187e3b2 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 {
diff --git a/dev-db/mariadb/mariadb-10.1.41.ebuild b/dev-db/mariadb/mariadb-10.1.41-r1.ebuild
similarity index 99%
rename from dev-db/mariadb/mariadb-10.1.41.ebuild
rename to dev-db/mariadb/mariadb-10.1.41-r1.ebuild
index 40a3c6f6fd6..a94d8c0ce08 100644
--- a/dev-db/mariadb/mariadb-10.1.41.ebuild
+++ b/dev-db/mariadb/mariadb-10.1.41-r1.ebuild
@@ -64,6 +64,7 @@ PATCHES=(
"${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch
"${MY_PATCH_DIR}"/20029_all_mariadb-10.1.37-enable-numa.patch
"${MY_PATCH_DIR}"/20035_all_mariadb-10.1-atomic-detection.patch
+ "${FILESDIR}/MDEV-20247-replication.patch"
)
# Be warned, *DEPEND are version-dependant
diff --git a/dev-db/mariadb/mariadb-10.2.26.ebuild b/dev-db/mariadb/mariadb-10.2.26-r1.ebuild
similarity index 99%
rename from dev-db/mariadb/mariadb-10.2.26.ebuild
rename to dev-db/mariadb/mariadb-10.2.26-r1.ebuild
index b43d53dfd0b..797d944ec89 100644
--- a/dev-db/mariadb/mariadb-10.2.26.ebuild
+++ b/dev-db/mariadb/mariadb-10.2.26-r1.ebuild
@@ -64,6 +64,7 @@ PATCHES=(
"${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch
"${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch
"${MY_PATCH_DIR}"/20035_all_mariadb-10.2-atomic-detection.patch
+ "${FILESDIR}/MDEV-20247-replication-10.2.patch"
)
# Be warned, *DEPEND are version-dependant
diff --git a/dev-db/mariadb/mariadb-10.3.17.ebuild b/dev-db/mariadb/mariadb-10.3.17-r1.ebuild
similarity index 99%
rename from dev-db/mariadb/mariadb-10.3.17.ebuild
rename to dev-db/mariadb/mariadb-10.3.17-r1.ebuild
index d960aec7eba..0c288122d44 100644
--- a/dev-db/mariadb/mariadb-10.3.17.ebuild
+++ b/dev-db/mariadb/mariadb-10.3.17-r1.ebuild
@@ -64,6 +64,7 @@ PATCHES=(
"${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch
"${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch
"${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch
+ "${FILESDIR}/MDEV-20247-replication-10.2.patch"
)
# Be warned, *DEPEND are version-dependant
diff --git a/dev-db/mariadb/mariadb-10.4.7.ebuild b/dev-db/mariadb/mariadb-10.4.7-r1.ebuild
similarity index 99%
rename from dev-db/mariadb/mariadb-10.4.7.ebuild
rename to dev-db/mariadb/mariadb-10.4.7-r1.ebuild
index 4ab8c38d372..5e4da733a88 100644
--- a/dev-db/mariadb/mariadb-10.4.7.ebuild
+++ b/dev-db/mariadb/mariadb-10.4.7-r1.ebuild
@@ -62,6 +62,7 @@ PATCHES=(
"${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch
"${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch
"${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch
+ "${FILESDIR}/MDEV-20247-replication-10.2.patch"
)
# Be warned, *DEPEND are version-dependant
next reply other threads:[~2019-08-07 16:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 16:54 Brian Evans [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-03 8:08 [gentoo-commits] repo/gentoo:master commit in: dev-db/mariadb/files/, dev-db/mariadb/ Sam James
2023-04-14 4:00 Sam James
2022-06-06 0:37 Sam James
2020-10-07 22:30 Thomas Deutschmann
2019-11-08 19:58 Brian Evans
2019-11-06 18:12 Brian Evans
2018-06-21 12:39 Brian Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1565196849.c50fef32cdf155707ff367f2990996be6c010b1f.grknight@gentoo \
--to=grknight@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox