1 |
commit: c50fef32cdf155707ff367f2990996be6c010b1f |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 7 16:53:24 2019 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 7 16:54:09 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c50fef32 |
7 |
|
8 |
dev-db/mariadb: Revbump for critical replication bug |
9 |
|
10 |
MDEV-20247 Replication hangs with "preparing" and never starts |
11 |
Include upstream fix |
12 |
|
13 |
Package-Manager: Portage-2.3.71, Repoman-2.3.17 |
14 |
Signed-off-by: Brian Evans <grknight <AT> gentoo.org> |
15 |
|
16 |
.../files/MDEV-20247-replication-10.2.patch | 108 ++++++++++++++++++ |
17 |
dev-db/mariadb/files/MDEV-20247-replication.patch | 121 +++++++++++++++++++++ |
18 |
...db-10.1.41.ebuild => mariadb-10.1.41-r1.ebuild} | 1 + |
19 |
...db-10.2.26.ebuild => mariadb-10.2.26-r1.ebuild} | 1 + |
20 |
...db-10.3.17.ebuild => mariadb-10.3.17-r1.ebuild} | 1 + |
21 |
...iadb-10.4.7.ebuild => mariadb-10.4.7-r1.ebuild} | 1 + |
22 |
6 files changed, 233 insertions(+) |
23 |
|
24 |
diff --git a/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch b/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch |
25 |
new file mode 100644 |
26 |
index 00000000000..193f2dd7750 |
27 |
--- /dev/null |
28 |
+++ b/dev-db/mariadb/files/MDEV-20247-replication-10.2.patch |
29 |
@@ -0,0 +1,108 @@ |
30 |
+From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001 |
31 |
+From: Thirunarayanan Balathandayuthapani <thiru@×××××××.com> |
32 |
+Date: Wed, 7 Aug 2019 12:35:04 +0530 |
33 |
+Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never |
34 |
+ starts |
35 |
+ |
36 |
+- The commit ab6dd774082c57f48d998e03655c06b672799b2d wrongly sets the |
37 |
+condition inside innobase_srv_conc_enter_innodb(). Problem is that |
38 |
+InnoDB makes the thread to sleep indefinitely if it is a replication |
39 |
+slave thread. |
40 |
+ |
41 |
+Thanks to Sujatha Sivakumar for contributing the replication test case. |
42 |
+--- |
43 |
+ .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++ |
44 |
+ .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++ |
45 |
+ storage/innobase/handler/ha_innodb.cc | 6 +-- |
46 |
+ 4 files changed, 60 insertions(+), 6 deletions(-) |
47 |
+ create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
48 |
+ create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
49 |
+ |
50 |
+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 |
51 |
+new file mode 100644 |
52 |
+index 000000000000..0ed894336a1c |
53 |
+--- /dev/null |
54 |
++++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
55 |
+@@ -0,0 +1,18 @@ |
56 |
++include/master-slave.inc |
57 |
++[connection master] |
58 |
++connection slave; |
59 |
++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
60 |
++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
61 |
++SET GLOBAL innodb_thread_concurrency = 100; |
62 |
++connection master; |
63 |
++CREATE TABLE t(f INT) ENGINE=INNODB; |
64 |
++INSERT INTO t VALUES (10); |
65 |
++connection slave; |
66 |
++include/diff_tables.inc [master:t, slave:t] |
67 |
++"===== Clean up=======" |
68 |
++connection master; |
69 |
++DROP TABLE t; |
70 |
++connection slave; |
71 |
++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
72 |
++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
73 |
++include/rpl_end.inc |
74 |
+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 |
75 |
+new file mode 100644 |
76 |
+index 000000000000..b4c2971d2fbc |
77 |
+--- /dev/null |
78 |
++++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
79 |
+@@ -0,0 +1,41 @@ |
80 |
++# ==== Purpose ==== |
81 |
++# |
82 |
++# Test verifies that replication shouldn't hang when number of active threads |
83 |
++# on the slave server are less than the allowed innodb_thread_concurrency value. |
84 |
++# |
85 |
++# ==== Implementation ==== |
86 |
++# |
87 |
++# Steps: |
88 |
++# 0 - Have master slave replication setup with engine being Innodb. |
89 |
++# 1 - Configure innodb_thread_concurrency = 100. |
90 |
++# 2 - Do some DML on master and sync the slave with master. |
91 |
++# 3 - Ensure replication doesn't hang. |
92 |
++# |
93 |
++# ==== References ==== |
94 |
++# |
95 |
++# MDEV-20247: Replication hangs with "preparing" and never starts |
96 |
++# |
97 |
++ |
98 |
++--source include/master-slave.inc |
99 |
++--source include/have_innodb.inc |
100 |
++ |
101 |
++--connection slave |
102 |
++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
103 |
++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
104 |
++SET GLOBAL innodb_thread_concurrency = 100; |
105 |
++ |
106 |
++--connection master |
107 |
++CREATE TABLE t(f INT) ENGINE=INNODB; |
108 |
++INSERT INTO t VALUES (10); |
109 |
++--sync_slave_with_master |
110 |
++ |
111 |
++--let $diff_tables=master:t, slave:t |
112 |
++--source include/diff_tables.inc |
113 |
++ |
114 |
++--echo "===== Clean up=======" |
115 |
++--connection master |
116 |
++DROP TABLE t; |
117 |
++--sync_slave_with_master |
118 |
++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
119 |
++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
120 |
++--source include/rpl_end.inc |
121 |
+diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc |
122 |
+index 081fcbd9c51e..5dfe240631b8 100644 |
123 |
+--- a/storage/innobase/handler/ha_innodb.cc |
124 |
++++ b/storage/innobase/handler/ha_innodb.cc |
125 |
+@@ -1686,9 +1686,9 @@ innobase_srv_conc_enter_innodb( |
126 |
+ && thd_is_replication_slave_thread(trx->mysql_thd)) { |
127 |
+ const ulonglong end = my_interval_timer() |
128 |
+ + ulonglong(srv_replication_delay) * 1000000; |
129 |
+- while (srv_conc_get_active_threads() |
130 |
+- >= srv_thread_concurrency |
131 |
+- || my_interval_timer() >= end) { |
132 |
++ while ((srv_conc_get_active_threads() |
133 |
++ >= srv_thread_concurrency) |
134 |
++ && my_interval_timer() < end) { |
135 |
+ os_thread_sleep(2000 /* 2 ms */); |
136 |
+ } |
137 |
+ } else { |
138 |
|
139 |
diff --git a/dev-db/mariadb/files/MDEV-20247-replication.patch b/dev-db/mariadb/files/MDEV-20247-replication.patch |
140 |
new file mode 100644 |
141 |
index 00000000000..92f8e0e1a67 |
142 |
--- /dev/null |
143 |
+++ b/dev-db/mariadb/files/MDEV-20247-replication.patch |
144 |
@@ -0,0 +1,121 @@ |
145 |
+From 47f8a18fec604983e47fdf7c822d94b26d85cade Mon Sep 17 00:00:00 2001 |
146 |
+From: Thirunarayanan Balathandayuthapani <thiru@×××××××.com> |
147 |
+Date: Wed, 7 Aug 2019 12:35:04 +0530 |
148 |
+Subject: [PATCH] MDEV-20247 Replication hangs with "preparing" and never |
149 |
+ starts |
150 |
+ |
151 |
+- The commit ab6dd774082c57f48d998e03655c06b672799b2d wrongly sets the |
152 |
+condition inside innobase_srv_conc_enter_innodb(). Problem is that |
153 |
+InnoDB makes the thread to sleep indefinitely if it is a replication |
154 |
+slave thread. |
155 |
+ |
156 |
+Thanks to Sujatha Sivakumar for contributing the replication test case. |
157 |
+--- |
158 |
+ .../r/rpl_sync_with_innodb_thd_conc.result | 13 ++++++ |
159 |
+ .../rpl/t/rpl_sync_with_innodb_thd_conc.test | 41 +++++++++++++++++++ |
160 |
+ storage/innobase/handler/ha_innodb.cc | 6 +-- |
161 |
+ storage/xtradb/handler/ha_innodb.cc | 6 +-- |
162 |
+ 4 files changed, 60 insertions(+), 6 deletions(-) |
163 |
+ create mode 100644 mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
164 |
+ create mode 100644 mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
165 |
+ |
166 |
+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 |
167 |
+new file mode 100644 |
168 |
+index 000000000000..0ed894336a1c |
169 |
+--- /dev/null |
170 |
++++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result |
171 |
+@@ -0,0 +1,13 @@ |
172 |
++include/master-slave.inc |
173 |
++[connection master] |
174 |
++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
175 |
++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
176 |
++SET GLOBAL innodb_thread_concurrency = 100; |
177 |
++CREATE TABLE t(f INT) ENGINE=INNODB; |
178 |
++INSERT INTO t VALUES (10); |
179 |
++include/diff_tables.inc [master:t, slave:t] |
180 |
++"===== Clean up=======" |
181 |
++DROP TABLE t; |
182 |
++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
183 |
++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
184 |
++include/rpl_end.inc |
185 |
+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 |
186 |
+new file mode 100644 |
187 |
+index 000000000000..b4c2971d2fbc |
188 |
+--- /dev/null |
189 |
++++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test |
190 |
+@@ -0,0 +1,41 @@ |
191 |
++# ==== Purpose ==== |
192 |
++# |
193 |
++# Test verifies that replication shouldn't hang when number of active threads |
194 |
++# on the slave server are less than the allowed innodb_thread_concurrency value. |
195 |
++# |
196 |
++# ==== Implementation ==== |
197 |
++# |
198 |
++# Steps: |
199 |
++# 0 - Have master slave replication setup with engine being Innodb. |
200 |
++# 1 - Configure innodb_thread_concurrency = 100. |
201 |
++# 2 - Do some DML on master and sync the slave with master. |
202 |
++# 3 - Ensure replication doesn't hang. |
203 |
++# |
204 |
++# ==== References ==== |
205 |
++# |
206 |
++# MDEV-20247: Replication hangs with "preparing" and never starts |
207 |
++# |
208 |
++ |
209 |
++--source include/master-slave.inc |
210 |
++--source include/have_innodb.inc |
211 |
++ |
212 |
++--connection slave |
213 |
++SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; |
214 |
++SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; |
215 |
++SET GLOBAL innodb_thread_concurrency = 100; |
216 |
++ |
217 |
++--connection master |
218 |
++CREATE TABLE t(f INT) ENGINE=INNODB; |
219 |
++INSERT INTO t VALUES (10); |
220 |
++--sync_slave_with_master |
221 |
++ |
222 |
++--let $diff_tables=master:t, slave:t |
223 |
++--source include/diff_tables.inc |
224 |
++ |
225 |
++--echo "===== Clean up=======" |
226 |
++--connection master |
227 |
++DROP TABLE t; |
228 |
++--sync_slave_with_master |
229 |
++SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; |
230 |
++SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; |
231 |
++--source include/rpl_end.inc |
232 |
+diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc |
233 |
+index 081fcbd9c51e..5dfe240631b8 100644 |
234 |
+--- a/storage/innobase/handler/ha_innodb.cc |
235 |
++++ b/storage/innobase/handler/ha_innodb.cc |
236 |
+@@ -1686,9 +1686,9 @@ innobase_srv_conc_enter_innodb( |
237 |
+ && thd_is_replication_slave_thread(trx->mysql_thd)) { |
238 |
+ const ulonglong end = my_interval_timer() |
239 |
+ + ulonglong(srv_replication_delay) * 1000000; |
240 |
+- while (srv_conc_get_active_threads() |
241 |
+- >= srv_thread_concurrency |
242 |
+- || my_interval_timer() >= end) { |
243 |
++ while ((srv_conc_get_active_threads() |
244 |
++ >= srv_thread_concurrency) |
245 |
++ && my_interval_timer() < end) { |
246 |
+ os_thread_sleep(2000 /* 2 ms */); |
247 |
+ } |
248 |
+ } else { |
249 |
+diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc |
250 |
+index 5e7482ff6bfa..b5002187e3b2 100644 |
251 |
+--- a/storage/xtradb/handler/ha_innodb.cc |
252 |
++++ b/storage/xtradb/handler/ha_innodb.cc |
253 |
+@@ -1949,9 +1949,9 @@ innobase_srv_conc_enter_innodb( |
254 |
+ && thd_is_replication_slave_thread(trx->mysql_thd)) { |
255 |
+ const ulonglong end = my_interval_timer() |
256 |
+ + ulonglong(srv_replication_delay) * 1000000; |
257 |
+- while (srv_conc_get_active_threads() |
258 |
+- >= srv_thread_concurrency |
259 |
+- || my_interval_timer() >= end) { |
260 |
++ while ((srv_conc_get_active_threads() |
261 |
++ >= srv_thread_concurrency) |
262 |
++ && my_interval_timer() < end) { |
263 |
+ os_thread_sleep(2000 /* 2 ms */); |
264 |
+ } |
265 |
+ } else { |
266 |
|
267 |
diff --git a/dev-db/mariadb/mariadb-10.1.41.ebuild b/dev-db/mariadb/mariadb-10.1.41-r1.ebuild |
268 |
similarity index 99% |
269 |
rename from dev-db/mariadb/mariadb-10.1.41.ebuild |
270 |
rename to dev-db/mariadb/mariadb-10.1.41-r1.ebuild |
271 |
index 40a3c6f6fd6..a94d8c0ce08 100644 |
272 |
--- a/dev-db/mariadb/mariadb-10.1.41.ebuild |
273 |
+++ b/dev-db/mariadb/mariadb-10.1.41-r1.ebuild |
274 |
@@ -64,6 +64,7 @@ PATCHES=( |
275 |
"${MY_PATCH_DIR}"/20025_all_mariadb-10.1.26-gssapi-detect.patch |
276 |
"${MY_PATCH_DIR}"/20029_all_mariadb-10.1.37-enable-numa.patch |
277 |
"${MY_PATCH_DIR}"/20035_all_mariadb-10.1-atomic-detection.patch |
278 |
+ "${FILESDIR}/MDEV-20247-replication.patch" |
279 |
) |
280 |
|
281 |
# Be warned, *DEPEND are version-dependant |
282 |
|
283 |
diff --git a/dev-db/mariadb/mariadb-10.2.26.ebuild b/dev-db/mariadb/mariadb-10.2.26-r1.ebuild |
284 |
similarity index 99% |
285 |
rename from dev-db/mariadb/mariadb-10.2.26.ebuild |
286 |
rename to dev-db/mariadb/mariadb-10.2.26-r1.ebuild |
287 |
index b43d53dfd0b..797d944ec89 100644 |
288 |
--- a/dev-db/mariadb/mariadb-10.2.26.ebuild |
289 |
+++ b/dev-db/mariadb/mariadb-10.2.26-r1.ebuild |
290 |
@@ -64,6 +64,7 @@ PATCHES=( |
291 |
"${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
292 |
"${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
293 |
"${MY_PATCH_DIR}"/20035_all_mariadb-10.2-atomic-detection.patch |
294 |
+ "${FILESDIR}/MDEV-20247-replication-10.2.patch" |
295 |
) |
296 |
|
297 |
# Be warned, *DEPEND are version-dependant |
298 |
|
299 |
diff --git a/dev-db/mariadb/mariadb-10.3.17.ebuild b/dev-db/mariadb/mariadb-10.3.17-r1.ebuild |
300 |
similarity index 99% |
301 |
rename from dev-db/mariadb/mariadb-10.3.17.ebuild |
302 |
rename to dev-db/mariadb/mariadb-10.3.17-r1.ebuild |
303 |
index d960aec7eba..0c288122d44 100644 |
304 |
--- a/dev-db/mariadb/mariadb-10.3.17.ebuild |
305 |
+++ b/dev-db/mariadb/mariadb-10.3.17-r1.ebuild |
306 |
@@ -64,6 +64,7 @@ PATCHES=( |
307 |
"${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
308 |
"${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
309 |
"${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch |
310 |
+ "${FILESDIR}/MDEV-20247-replication-10.2.patch" |
311 |
) |
312 |
|
313 |
# Be warned, *DEPEND are version-dependant |
314 |
|
315 |
diff --git a/dev-db/mariadb/mariadb-10.4.7.ebuild b/dev-db/mariadb/mariadb-10.4.7-r1.ebuild |
316 |
similarity index 99% |
317 |
rename from dev-db/mariadb/mariadb-10.4.7.ebuild |
318 |
rename to dev-db/mariadb/mariadb-10.4.7-r1.ebuild |
319 |
index 4ab8c38d372..5e4da733a88 100644 |
320 |
--- a/dev-db/mariadb/mariadb-10.4.7.ebuild |
321 |
+++ b/dev-db/mariadb/mariadb-10.4.7-r1.ebuild |
322 |
@@ -62,6 +62,7 @@ PATCHES=( |
323 |
"${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch |
324 |
"${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch |
325 |
"${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch |
326 |
+ "${FILESDIR}/MDEV-20247-replication-10.2.patch" |
327 |
) |
328 |
|
329 |
# Be warned, *DEPEND are version-dependant |