From 583b39811ce823abf9f6fe533bdee6aacde3e357 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 3 Feb 2025 15:00:35 +0400 Subject: [PATCH 01/65] MDEV-35620 UBSAN: runtime error: applying zero offset to null pointer in _ma_unique_hash, skip_trailing_space, my_hash_sort_mb_nopad_bin and my_strnncollsp_utf8mb4_bin UBSAN detected the nullptr-with-offset in a few places when handling empty blobs. Fix: - Adding DBUG_ASSERT(source_string) into all hash_sort() implementations to catch this problem in non-UBSAN debug builds. - Fixing mi_unique_hash(), mi_unique_comp(), _ma_unique_hash(), _ma_unique_comp() to replace NULL pointer to an empty string ponter.. Note, we should also add DBUG_ASSERT(source_string != NULL) into all implementations of strnncoll*(). But I'm afraid the patch is going to be too long and too dangerous for 10.5. --- mysql-test/main/long_unique.result | 22 ++++++++++++++++++++++ mysql-test/main/long_unique.test | 22 ++++++++++++++++++++++ plugin/versioning/versioning.cc | 1 - storage/maria/ma_unique.c | 6 ++++++ storage/myisam/mi_unique.c | 6 ++++++ strings/ctype-bin.c | 2 ++ strings/ctype-latin1.c | 3 ++- strings/ctype-mb.c | 2 ++ strings/ctype-simple.c | 2 ++ strings/ctype-uca.inl | 2 ++ strings/ctype-ucs2.c | 10 ++++++++++ strings/ctype-utf8.c | 4 ++++ strings/strings_def.h | 2 +- 13 files changed, 81 insertions(+), 3 deletions(-) diff --git a/mysql-test/main/long_unique.result b/mysql-test/main/long_unique.result index 7368b10fbbd..b4bd4a075c8 100644 --- a/mysql-test/main/long_unique.result +++ b/mysql-test/main/long_unique.result @@ -1451,4 +1451,26 @@ DROP TABLE t1, t2; # CREATE TABLE t1 (pk INT, a TEXT NOT NULL DEFAULT '', PRIMARY KEY (pk), b INT AUTO_INCREMENT, UNIQUE(b), UNIQUE (a,b)) ENGINE=myisam; ERROR HY000: AUTO_INCREMENT column `b` cannot be used in the UNIQUE index `a` +# +# MDEV-35620 UBSAN: runtime error: applying zero offset to null pointer in _ma_unique_hash, skip_trailing_space, my_hash_sort_mb_nopad_bin and my_strnncollsp_utf8mb4_bin +# +# Disable result log. The exact result is not important. +# We just need to make sure UBSAN nullptr-with-offset is not reported. +SELECT DISTINCT user,authentication_string FROM mysql.user; +SELECT DISTINCT USER,PASSWORD FROM mysql.user; +SELECT DISTINCT USER,plugin FROM mysql.user; +# Enabling result log again. +create or replace table t1 (t text) engine=aria; +insert into t1 values (''); +insert into t1 values (NULL); +select distinct t from t1; +t + +NULL +alter table t1 ENGINE=MyISAM; +select distinct t from t1; +t + +NULL +DROP TABLE t1; # End of 10.5 tests diff --git a/mysql-test/main/long_unique.test b/mysql-test/main/long_unique.test index fa49b6a5ad4..b3c1e8e9efc 100644 --- a/mysql-test/main/long_unique.test +++ b/mysql-test/main/long_unique.test @@ -551,4 +551,26 @@ DROP TABLE t1, t2; --error ER_NO_AUTOINCREMENT_WITH_UNIQUE CREATE TABLE t1 (pk INT, a TEXT NOT NULL DEFAULT '', PRIMARY KEY (pk), b INT AUTO_INCREMENT, UNIQUE(b), UNIQUE (a,b)) ENGINE=myisam; +--echo # +--echo # MDEV-35620 UBSAN: runtime error: applying zero offset to null pointer in _ma_unique_hash, skip_trailing_space, my_hash_sort_mb_nopad_bin and my_strnncollsp_utf8mb4_bin +--echo # + +--echo # Disable result log. The exact result is not important. +--echo # We just need to make sure UBSAN nullptr-with-offset is not reported. +--disable_result_log +SELECT DISTINCT user,authentication_string FROM mysql.user; +SELECT DISTINCT USER,PASSWORD FROM mysql.user; +SELECT DISTINCT USER,plugin FROM mysql.user; +--enable_result_log +--echo # Enabling result log again. + +create or replace table t1 (t text) engine=aria; +insert into t1 values (''); +insert into t1 values (NULL); +select distinct t from t1; +alter table t1 ENGINE=MyISAM; +select distinct t from t1; +DROP TABLE t1; + + --echo # End of 10.5 tests diff --git a/plugin/versioning/versioning.cc b/plugin/versioning/versioning.cc index 387dfa80ae9..9c6fad89f43 100644 --- a/plugin/versioning/versioning.cc +++ b/plugin/versioning/versioning.cc @@ -150,7 +150,6 @@ static const Native_func_registry func_array_vers[] = { { C_STRING_WITH_LEN("TRT_TRX_ID") }, BUILDER(Create_func_trt)}, { { C_STRING_WITH_LEN("TRT_TRX_SEES") }, BUILDER(Create_func_trt_trx_sees)}, { { C_STRING_WITH_LEN("TRT_TRX_SEES_EQ") }, BUILDER(Create_func_trt_trx_sees)}, - { {0, 0}, NULL} }; diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c index 5e7925b937c..215afc7e063 100644 --- a/storage/maria/ma_unique.c +++ b/storage/maria/ma_unique.c @@ -139,6 +139,8 @@ ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const uchar *record) { uint tmp_length= _ma_calc_blob_length(keyseg->bit_start,pos); memcpy((void*) &pos,pos+keyseg->bit_start,sizeof(char*)); + if (!pos) + pos= (const uchar*) ""; /* hash_sort does not support NULL ptr */ if (!length || length > tmp_length) length=tmp_length; /* The whole blob */ } @@ -236,6 +238,10 @@ my_bool _ma_unique_comp(MARIA_UNIQUEDEF *def, const uchar *a, const uchar *b, } memcpy((void*) &pos_a, pos_a+keyseg->bit_start, sizeof(char*)); memcpy((void*) &pos_b, pos_b+keyseg->bit_start, sizeof(char*)); + if (pos_a == 0) + pos_a= (const uchar *) ""; /* Avoid UBSAN nullptr-with-offset */ + if (pos_b == 0) + pos_b= (const uchar *) ""; /* Avoid UBSAN nullptr-with-offset */ } if (type == HA_KEYTYPE_TEXT/* the CHAR data type*/) { diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c index ecc2b354849..9c6ed4d80b1 100644 --- a/storage/myisam/mi_unique.c +++ b/storage/myisam/mi_unique.c @@ -115,6 +115,8 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record) { uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); memcpy((char**) &pos, pos+keyseg->bit_start, sizeof(char*)); + if (!pos) + pos= (const uchar*) ""; /* hash_sort does not support NULL ptr */ if (!length || length > tmp_length) length=tmp_length; /* The whole blob */ } @@ -211,6 +213,10 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, } memcpy((char**) &pos_a, pos_a+keyseg->bit_start, sizeof(char*)); memcpy((char**) &pos_b, pos_b+keyseg->bit_start, sizeof(char*)); + if (pos_a == 0) + pos_a= (const uchar *) ""; /* Avoid UBSAN nullptr-with-offset */ + if (pos_b == 0) + pos_b= (const uchar *) ""; /* Avoid UBSAN nullptr-with-offset */ } if (type == HA_KEYTYPE_TEXT/*The CHAR data type*/) { diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index a4b20ebd6d3..422606ed967 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -294,6 +294,7 @@ void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)), const uchar *end = key + len; ulong tmp1= *nr1; ulong tmp2= *nr2; + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ for (; key < end ; key++) { @@ -314,6 +315,7 @@ void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), 'A ' and 'A' as identical */ const uchar *end= skip_trailing_space(key, len); + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_bin(cs, key, end - key, nr1, nr2); } diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index d76a4928030..e639e24b91f 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -703,7 +703,8 @@ void my_hash_sort_latin1_de(CHARSET_INFO *cs __attribute__((unused)), { const uchar *end; register ulong m1= *nr1, m2= *nr2; - + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ + /* Remove end space. We have to do this to be able to compare 'AE' and 'Ä' as identical diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index f26c9fe10d2..d5764d5c8bf 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -618,6 +618,7 @@ my_hash_sort_mb_nopad_bin(CHARSET_INFO *cs __attribute__((unused)), { register ulong m1= *nr1, m2= *nr2; const uchar *end= key + len; + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ for (; key < end ; key++) { MY_HASH_ADD(m1, m2, (uint)*key); @@ -636,6 +637,7 @@ my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), 'A ' and 'A' as identical */ const uchar *end= skip_trailing_space(key, len); + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_mb_nopad_bin(cs, key, end - key, nr1, nr2); } diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index d40e3abdcc5..cc97ac741be 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -347,6 +347,7 @@ void my_hash_sort_simple_nopad(CHARSET_INFO *cs, register const uchar *sort_order=cs->sort_order; const uchar *end= key + len; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ for (; key < (uchar*) end ; key++) { MY_HASH_ADD(m1, m2, (uint) sort_order[(uint) *key]); @@ -363,6 +364,7 @@ void my_hash_sort_simple(CHARSET_INFO *cs, register const uchar *sort_order=cs->sort_order; const uchar *end; uint16 space_weight= sort_order[' ']; + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ /* Remove all trailing characters that are equal to space. diff --git a/strings/ctype-uca.inl b/strings/ctype-uca.inl index 70d2f180e15..3bad40e0f2b 100644 --- a/strings/ctype-uca.inl +++ b/strings/ctype-uca.inl @@ -537,6 +537,7 @@ MY_FUNCTION_NAME(hash_sort)(CHARSET_INFO *cs, my_uca_scanner scanner; int space_weight= my_space_weight(&cs->uca->level[0]); register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ my_uca_scanner_init_any(&scanner, cs, &cs->uca->level[0], s, slen); @@ -590,6 +591,7 @@ MY_FUNCTION_NAME(hash_sort_nopad)(CHARSET_INFO *cs, int s_res; my_uca_scanner scanner; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ my_uca_scanner_init_any(&scanner, cs, &cs->uca->level[0], s, slen); diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 99f4f73ff78..c8187fb3e63 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1359,6 +1359,7 @@ my_hash_sort_utf16_nopad(CHARSET_INFO *cs, const uchar *e= s + slen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ while ((s < e) && (res= mb_wc(cs, &wc, (uchar *) s, (uchar *) e)) > 0) { @@ -1376,6 +1377,7 @@ my_hash_sort_utf16(CHARSET_INFO *cs, const uchar *s, size_t slen, ulong *nr1, ulong *nr2) { size_t lengthsp= my_ci_lengthsp(cs, (const char *) s, slen); + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_utf16_nopad(cs, s, lengthsp, nr1, nr2); } @@ -1486,6 +1488,7 @@ my_hash_sort_utf16_nopad_bin(CHARSET_INFO *cs __attribute__((unused)), { const uchar *end= pos + len; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(pos); /* Avoid UBSAN nullptr-with-offset */ for ( ; pos < end ; pos++) { @@ -1501,6 +1504,7 @@ my_hash_sort_utf16_bin(CHARSET_INFO *cs, const uchar *pos, size_t len, ulong *nr1, ulong *nr2) { size_t lengthsp= my_ci_lengthsp(cs, (const char *) pos, len); + DBUG_ASSERT(pos); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_utf16_nopad_bin(cs, pos, lengthsp, nr1, nr2); } @@ -2250,6 +2254,7 @@ my_hash_sort_utf32_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *e= s + slen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ while ((res= my_utf32_uni(cs, &wc, (uchar*) s, (uchar*) e)) > 0) { @@ -2270,6 +2275,7 @@ my_hash_sort_utf32(CHARSET_INFO *cs, const uchar *s, size_t slen, ulong *nr1, ulong *nr2) { size_t lengthsp= my_lengthsp_utf32(cs, (const char *) s, slen); + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_utf32_nopad(cs, s, lengthsp, nr1, nr2); } @@ -3139,6 +3145,7 @@ my_hash_sort_ucs2_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *e=s+slen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e)) >0) { @@ -3155,6 +3162,7 @@ static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen, ulong *nr1, ulong *nr2) { size_t lengthsp= my_lengthsp_mb2(cs, (const char *) s, slen); + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_ucs2_nopad(cs, s, lengthsp, nr1, nr2); } @@ -3279,6 +3287,7 @@ my_hash_sort_ucs2_nopad_bin(CHARSET_INFO *cs __attribute__((unused)), { const uchar *end= key + len; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ for ( ; key < end ; key++) { MY_HASH_ADD(m1, m2, (uint)*key); @@ -3293,6 +3302,7 @@ my_hash_sort_ucs2_bin(CHARSET_INFO *cs, const uchar *key, size_t len, ulong *nr1, ulong *nr2) { size_t lengthsp= my_lengthsp_mb2(cs, (const char *) key, len); + DBUG_ASSERT(key); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_ucs2_nopad_bin(cs, key, lengthsp, nr1, nr2); } diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 88650e9611c..33d6d49a93a 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -4977,6 +4977,7 @@ static void my_hash_sort_utf8mb3_nopad(CHARSET_INFO *cs, const uchar *s, size_t const uchar *e= s+slen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ while ((s < e) && (res=my_utf8mb3_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 ) { @@ -4997,6 +4998,7 @@ static void my_hash_sort_utf8mb3(CHARSET_INFO *cs, const uchar *s, size_t slen, 'A ' and 'A' as identical */ const uchar *e= skip_trailing_space(s, slen); + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_utf8mb3_nopad(cs, s, e - s, nr1, nr2); } @@ -7414,6 +7416,7 @@ my_hash_sort_utf8mb4_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *e= s + slen; MY_UNICASE_INFO *uni_plane= cs->caseinfo; register ulong m1= *nr1, m2= *nr2; + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ while ((res= my_mb_wc_utf8mb4(cs, &wc, (uchar*) s, (uchar*) e)) > 0) { @@ -7446,6 +7449,7 @@ my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, 'A ' and 'A' as identical */ const uchar *e= skip_trailing_space(s, slen); + DBUG_ASSERT(s); /* Avoid UBSAN nullptr-with-offset */ my_hash_sort_utf8mb4_nopad(cs, s, e - s, nr1, nr2); } diff --git a/strings/strings_def.h b/strings/strings_def.h index f3602f390a2..55376c37c7f 100644 --- a/strings/strings_def.h +++ b/strings/strings_def.h @@ -81,7 +81,7 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) { const uchar *end= ptr + len; - + DBUG_ASSERT(ptr); /* Avoid UBSAN nullptr-with-offset */ if (len > 20) { const uchar *end_words= (const uchar *)(intptr) From 0ca98e834dbeb00a2dae5cb1406d0efc31ba6655 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 3 Feb 2025 19:52:50 +1100 Subject: [PATCH 02/65] MDEV-35959 Store the error message at the net layer when reading a packet from the server This ensures that the error message is populated when the reading fails with ER_NET_READ_INTERRUPTED, which at the client layer returns without storing any error message as there is no corresponding CR_ error code. Patch originally by Sergei Golubchik --- sql/net_serv.cc | 3 ++ .../spider/bugfix/r/mdev_35959.result | 25 +++++++++++++++++ .../spider/bugfix/t/mdev_35959.test | 28 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_35959.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 56757b96ee1..86d4de5980b 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -1065,6 +1065,9 @@ retry: net->last_errno= (vio_was_timeout(net->vio) ? ER_NET_READ_INTERRUPTED : ER_NET_READ_ERROR); +#ifdef MYSQL_SERVER + strmake_buf(net->last_error, ER(net->last_errno)); +#endif /* MYSQL_SERVER */ MYSQL_SERVER_my_error(net->last_errno, MYF(0)); goto end; } diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_35959.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_35959.result new file mode 100644 index 00000000000..6be0610b6d8 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_35959.result @@ -0,0 +1,25 @@ +# +# MDEV-35959 Assertion `*str != '\0'' failed in my_message_sql after a Spider error +# +for master_1 +for child2 +for child3 +SET spider_same_server_link=ON, spider_net_read_timeout=1; +CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +CREATE TABLE t_remote (a INT); +CREATE TABLE t (a INT) ENGINE=SPIDER COMMENT = 'wrapper "mysql", srv "srv", table "t_remote"'; +CREATE OR REPLACE TABLE t_remote LIKE t; +ERROR 08S01: Got timeout reading communication packets +SHOW WARNINGS; +Level Code Message +Error 1159 Got timeout reading communication packets +Error 1159 Got timeout reading communication packets +Error 1159 Got timeout reading communication packets +Error 1159 Got timeout reading communication packets +Error 1159 Got timeout reading communication packets +drop table t; +drop server srv; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test new file mode 100644 index 00000000000..9beebaa8c1d --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test @@ -0,0 +1,28 @@ +--echo # +--echo # MDEV-35959 Assertion `*str != '\0'' failed in my_message_sql after a Spider error +--echo # + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +SET spider_same_server_link=ON, spider_net_read_timeout=1; +evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); + +CREATE TABLE t_remote (a INT); +CREATE TABLE t (a INT) ENGINE=SPIDER COMMENT = 'wrapper "mysql", srv "srv", table "t_remote"'; +--error ER_NET_READ_INTERRUPTED +CREATE OR REPLACE TABLE t_remote LIKE t; +SHOW WARNINGS; + +drop table t; +drop server srv; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log From 3a1f9dfda98fd1b6bc577918267ee42b7e1469aa Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Tue, 4 Feb 2025 07:50:30 -0500 Subject: [PATCH 03/65] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 43c84795651..1bc6b594a5e 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=28 +MYSQL_VERSION_PATCH=29 SERVER_MATURITY=stable From fbb6b50499a258b0e015e5b5c5b1e4effededb25 Mon Sep 17 00:00:00 2001 From: Dave Gosselin Date: Wed, 18 Dec 2024 12:02:10 -0500 Subject: [PATCH 04/65] MDEV-35117 Improve error message on unexpected geometries for st_distance_sphere When invoking st_distance_sphere with unexpected geometries, the error message now given is: ERROR HY000: Internal error: Point or multipoint geometries expected This commit fixes a few formatting issues in the affected function. --- mysql-test/main/gis-precise.result | 8 ++++---- mysql-test/main/gis-precise.test | 8 ++++---- mysql-test/main/gis.result | 5 +++++ mysql-test/main/gis.test | 6 ++++++ sql/item_geofunc.cc | 17 +++++++++-------- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/mysql-test/main/gis-precise.result b/mysql-test/main/gis-precise.result index a75b71f4c8b..ca1fa666530 100644 --- a/mysql-test/main/gis-precise.result +++ b/mysql-test/main/gis-precise.result @@ -776,7 +776,7 @@ SELECT ST_DISTANCE_SPHERE(1, 1, NULL); ST_DISTANCE_SPHERE(1, 1, NULL) NULL SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)')) as result; -ERROR HY000: Internal error: st_distance_sphere +ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments. # Test Points and radius SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)')) as result; result @@ -788,9 +788,9 @@ SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT( result 0.024682056391766436 SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 0) as result; -ERROR HY000: Internal error: Radius must be greater than zero. +ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments. SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), -1) as result; -ERROR HY000: Internal error: Radius must be greater than zero. +ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments. # Test longitude/lattitude SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POINT(1 2)')), 10) as result; result @@ -843,7 +843,7 @@ SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_G result 0.04933028646581131 SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),0) as result; -ERROR HY000: Internal error: Radius must be greater than zero. +ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments. set @pt1 = ST_GeomFromText('POINT(190 -30)'); set @pt2 = ST_GeomFromText('POINT(-30 50)'); SELECT ST_Distance_Sphere(@pt1, @pt2); diff --git a/mysql-test/main/gis-precise.test b/mysql-test/main/gis-precise.test index 666c443e5fe..e135bedc38d 100644 --- a/mysql-test/main/gis-precise.test +++ b/mysql-test/main/gis-precise.test @@ -422,7 +422,7 @@ SELECT ST_DISTANCE_SPHERE(1, 1, 3); # Return NULL if radius is NULL SELECT ST_DISTANCE_SPHERE(1, 1, NULL); # Wrong geometry ---error ER_INTERNAL_ERROR +--error ER_GIS_UNSUPPORTED_ARGUMENT SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 0)'), ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1)')) as result; --echo # Test Points and radius @@ -430,9 +430,9 @@ SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT( # make bb x86 happy SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-1 -1)'), ST_GEOMFROMTEXT('POINT(-2 -2)')), 10) as result; SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 1) as result; ---error ER_INTERNAL_ERROR +--error ER_GIS_UNSUPPORTED_ARGUMENT SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), 0) as result; ---error ER_INTERNAL_ERROR +--error ER_GIS_UNSUPPORTED_ARGUMENT SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'), -1) as result; --echo # Test longitude/lattitude # make bb x86 happy @@ -456,7 +456,7 @@ SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_G SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )')), 10) as result; # make bb x86 happy SELECT TRUNCATE(ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),1), 17) as result; ---error ER_INTERNAL_ERROR +--error ER_GIS_UNSUPPORTED_ARGUMENT SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 2,1 1 )'), ST_GEOMFROMTEXT('MULTIPOINT(8 9,3 4 )'),0) as result; # Longitude out of range [-180,180] diff --git a/mysql-test/main/gis.result b/mysql-test/main/gis.result index 5fa310e93ed..cbae1745e21 100644 --- a/mysql-test/main/gis.result +++ b/mysql-test/main/gis.result @@ -5501,4 +5501,9 @@ MULTIPOLYGON(POLYGON(LINESTRING(POINT(4, 3), POINT(4, 4), POINT(3, 4), POINT(4, ) AS t; ST_SRID(g1) ST_SRID(ST_GeomFromWKB(g1, 4326)) ST_SRID(ST_GeomFromWKB(g1)) ST_AsText(g1) ST_SRID(ST_PointFromWKB(g2, 4326)) ST_SRID(g2) ST_SRID(ST_LineStringFromWKB(g3, 3)) ST_SRID(ST_PolygonFromWKB(g4, 4)) ST_SRID(ST_MultiPointFromWKB(g5, 5)) ST_SRID(ST_MultiLineStringFromWKB(g6, 6)) ST_SRID(ST_MultiPolygonFromWKB(g7, 7)) 0 4326 0 POINT(1 2) 4326 0 3 4 5 6 7 +# +# MDEV-35117 Error message "ERROR 1815 (HY000): Internal error: st_distance_sphere' could be improved +# +SELECT ST_DISTANCE_SPHERE(st_geomfromtext('linestring( 2 2, 2 8) '), ST_GeomFromText('POINT(18.413076 43.856258)')) ; +ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments. # End of 10.5 tests diff --git a/mysql-test/main/gis.test b/mysql-test/main/gis.test index 03c1df94d1f..a412cf7d690 100644 --- a/mysql-test/main/gis.test +++ b/mysql-test/main/gis.test @@ -3508,4 +3508,10 @@ FROM ( MULTIPOLYGON(POLYGON(LINESTRING(POINT(4, 3), POINT(4, 4), POINT(3, 4), POINT(4, 3)))) AS g7 ) AS t; +--echo # +--echo # MDEV-35117 Error message "ERROR 1815 (HY000): Internal error: st_distance_sphere' could be improved +--echo # +--error ER_GIS_UNSUPPORTED_ARGUMENT +SELECT ST_DISTANCE_SPHERE(st_geomfromtext('linestring( 2 2, 2 8) '), ST_GeomFromText('POINT(18.413076 43.856258)')) ; + --echo # End of 10.5 tests diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 81cd1268f64..5b1ed286146 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -2535,7 +2535,7 @@ double Item_func_sphere_distance::val_real() String *arg2= args[1]->val_str(&bak2); double distance= 0.0; double sphere_radius= 6370986.0; // Default radius equals Earth radius - + null_value= (args[0]->null_value || args[1]->null_value); if (null_value) { @@ -2553,7 +2553,7 @@ double Item_func_sphere_distance::val_real() } if (sphere_radius <= 0) { - my_error(ER_INTERNAL_ERROR, MYF(0), "Radius must be greater than zero."); + my_error(ER_GIS_UNSUPPORTED_ARGUMENT, MYF(0), func_name()); return 1; } } @@ -2565,26 +2565,27 @@ double Item_func_sphere_distance::val_real() my_error(ER_GIS_INVALID_DATA, MYF(0), "ST_Distance_Sphere"); goto handle_errors; } -// Method allowed for points and multipoints + // Method allowed for points and multipoints if (!(g1->get_class_info()->m_type_id == Geometry::wkb_point || g1->get_class_info()->m_type_id == Geometry::wkb_multipoint) || !(g2->get_class_info()->m_type_id == Geometry::wkb_point || g2->get_class_info()->m_type_id == Geometry::wkb_multipoint)) { - // Generate error message in case different geometry is used? - my_error(ER_INTERNAL_ERROR, MYF(0), func_name()); + // Generate error message in case of unexpected geometry. + my_error(ER_GIS_UNSUPPORTED_ARGUMENT, MYF(0), func_name()); return 0; } distance= spherical_distance_points(g1, g2, sphere_radius); if (distance < 0) { - my_error(ER_INTERNAL_ERROR, MYF(0), "Returned distance cannot be negative."); + my_error(ER_INTERNAL_ERROR, MYF(0), + "Returned distance cannot be negative."); return 1; } return distance; - handle_errors: - return 0; +handle_errors: + return 0; } From cd7513995dd67bf9376681c0986b8a5c484188c8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 10 Feb 2025 15:25:09 +0100 Subject: [PATCH 05/65] MDEV-36026 Problem with INSERT SELECT on NOT NULL columns while having BEFORE UPDATE trigger MDEV-8605 and MDEV-19761 didn't handle INSERT (columns) SELECT followup for a69da0c31e9 --- mysql-test/main/trigger_null.result | 15 +++++++++++++++ mysql-test/main/trigger_null.test | 11 +++++++++++ sql/sql_insert.cc | 1 + 3 files changed, 27 insertions(+) diff --git a/mysql-test/main/trigger_null.result b/mysql-test/main/trigger_null.result index 91bae7e3b0e..a99936bf2f3 100644 --- a/mysql-test/main/trigger_null.result +++ b/mysql-test/main/trigger_null.result @@ -399,4 +399,19 @@ Warnings: Warning 1364 Field 'c5' doesn't have a default value drop table t1; set sql_mode=default; +# +# MDEV-36026 Problem with INSERT SELECT on NOT NULL columns while having BEFORE UPDATE trigger +# +create table t1 (b int(11) not null); +create trigger t1bu before update on t1 for each row begin end; +insert t1 (b) select 1 union select 2; +create trigger trgi before insert on t1 for each row set new.b=ifnull(new.b,10); +insert t1 (b) select NULL union select 11; +select * from t1; +b +1 +2 +10 +11 +drop table t1; # End of 10.5 tests diff --git a/mysql-test/main/trigger_null.test b/mysql-test/main/trigger_null.test index d3b74af49b3..197e7cdf86a 100644 --- a/mysql-test/main/trigger_null.test +++ b/mysql-test/main/trigger_null.test @@ -425,4 +425,15 @@ insert into t1 (c) values (1); drop table t1; set sql_mode=default; +--echo # +--echo # MDEV-36026 Problem with INSERT SELECT on NOT NULL columns while having BEFORE UPDATE trigger +--echo # +create table t1 (b int(11) not null); +create trigger t1bu before update on t1 for each row begin end; +insert t1 (b) select 1 union select 2; +create trigger trgi before insert on t1 for each row set new.b=ifnull(new.b,10); +insert t1 (b) select NULL union select 11; +select * from t1; +drop table t1; + --echo # End of 10.5 tests diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 26adcf3d228..34b71fcabe3 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -4126,6 +4126,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) int select_insert::prepare2(JOIN *) { DBUG_ENTER("select_insert::prepare2"); + switch_to_nullable_trigger_fields(*fields, table); if (table->validate_default_values_of_unset_fields(thd)) DBUG_RETURN(1); if (thd->lex->describe) From feadfd9d9cc1614beba667e957f9428b1be245ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 11 Feb 2025 14:06:15 +0200 Subject: [PATCH 06/65] MDEV-27769 fixup: conditionally define a function --- sql/sql_base.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 149cd541341..95b650c33d3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -760,6 +760,7 @@ close_all_tables_for_name(THD *thd, TABLE_SHARE *share, } } +#ifdef DBUG_ASSERT_EXISTS static inline bool check_field_pointers(const TABLE *table) { for (Field **pf= table->field; *pf; pf++) @@ -775,6 +776,7 @@ static inline bool check_field_pointers(const TABLE *table) } return true; } +#endif /* From c43d0a015f974c5a0142e6779332089a7a979853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 29 Jan 2025 20:08:41 +0200 Subject: [PATCH 07/65] MDEV-35951 : Complete freeze during MW-329 test Rewrite test not to use infinite procedure, it is not necessary to test. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/MW-329.result | 1 + mysql-test/suite/galera/r/MW-329F.result | 25 ++++++ mysql-test/suite/galera/t/MW-329.cnf | 3 - mysql-test/suite/galera/t/MW-329.test | 12 ++- mysql-test/suite/galera/t/MW-329F.cnf | 6 ++ mysql-test/suite/galera/t/MW-329F.test | 105 +++++++++++++++++++++++ 6 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 mysql-test/suite/galera/r/MW-329F.result create mode 100644 mysql-test/suite/galera/t/MW-329F.cnf create mode 100644 mysql-test/suite/galera/t/MW-329F.test diff --git a/mysql-test/suite/galera/r/MW-329.result b/mysql-test/suite/galera/r/MW-329.result index 16afcc15996..37a97f57f98 100644 --- a/mysql-test/suite/galera/r/MW-329.result +++ b/mysql-test/suite/galera/r/MW-329.result @@ -18,5 +18,6 @@ connection node_1b; connection node_1; DROP PROCEDURE proc_insert; DROP TABLE t1; +disconnect node_1b; CALL mtr.add_suppression("WSREP: .* conflict state after post commit "); set global innodb_status_output=Default; diff --git a/mysql-test/suite/galera/r/MW-329F.result b/mysql-test/suite/galera/r/MW-329F.result new file mode 100644 index 00000000000..bdde55cba63 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-329F.result @@ -0,0 +1,25 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; +INSERT INTO t1 (f1) VALUES (1),(65535); +CREATE PROCEDURE proc_insert (repeat_count int) +BEGIN +DECLARE current_num int; +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +SET current_num = 0; +SET SESSION wsrep_sync_wait = 0; +WHILE current_num < repeat_count do +INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); +SELECT SLEEP(0.1); +SET current_num = current_num + 1; +END WHILE; +END| +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1b; +connection node_1b; +connection node_1; +DROP PROCEDURE proc_insert; +DROP TABLE t1; +disconnect node_1b; +CALL mtr.add_suppression("WSREP: .* conflict state after post commit "); +set global innodb_status_output=Default; diff --git a/mysql-test/suite/galera/t/MW-329.cnf b/mysql-test/suite/galera/t/MW-329.cnf index 10870a81547..b35f0a5cfe5 100644 --- a/mysql-test/suite/galera/t/MW-329.cnf +++ b/mysql-test/suite/galera/t/MW-329.cnf @@ -4,6 +4,3 @@ wsrep-retry-autocommit=0 [mysqld.2] - - - diff --git a/mysql-test/suite/galera/t/MW-329.test b/mysql-test/suite/galera/t/MW-329.test index 38f2007f6b6..7d132a7bfc0 100644 --- a/mysql-test/suite/galera/t/MW-329.test +++ b/mysql-test/suite/galera/t/MW-329.test @@ -1,5 +1,5 @@ # -# #MW-329 Fix incorrect affected rows count after replay +# MW-329 Fix incorrect affected rows count after replay. # --source include/galera_cluster.inc @@ -11,7 +11,7 @@ CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; INSERT INTO t1 (f1) VALUES (1),(65535); # -# Run concurrent INSERTs +# Run concurrent INSERTs # DELIMITER |; @@ -86,8 +86,12 @@ while ($count) --eval KILL CONNECTION $connection_id --enable_query_log +# +# getting execution results for --send +# + --connection node_1b ---error 0,2013,1317 +--error 0,1317,2013,2026 --reap --enable_query_log --enable_result_log @@ -96,6 +100,8 @@ while ($count) DROP PROCEDURE proc_insert; DROP TABLE t1; +--disconnect node_1b + # Due to MW-330, Multiple "conflict state 3 after post commit" warnings if table is dropped while SP is running CALL mtr.add_suppression("WSREP: .* conflict state after post commit "); diff --git a/mysql-test/suite/galera/t/MW-329F.cnf b/mysql-test/suite/galera/t/MW-329F.cnf new file mode 100644 index 00000000000..b35f0a5cfe5 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-329F.cnf @@ -0,0 +1,6 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep-retry-autocommit=0 + +[mysqld.2] diff --git a/mysql-test/suite/galera/t/MW-329F.test b/mysql-test/suite/galera/t/MW-329F.test new file mode 100644 index 00000000000..77370dabbe3 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-329F.test @@ -0,0 +1,105 @@ +# +# MW-329F Fix incorrect affected rows count after replay. +# +# This is a version of MW-329 without the infinite loop that +# in the original test is closed by killing the connection. +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB; + +# We start with a populated table +INSERT INTO t1 (f1) VALUES (1),(65535); + +# +# Run concurrent INSERTs +# + +DELIMITER |; +CREATE PROCEDURE proc_insert (repeat_count int) +BEGIN + DECLARE current_num int; + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; + SET current_num = 0; + SET SESSION wsrep_sync_wait = 0; + WHILE current_num < repeat_count do + INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 )); + SELECT SLEEP(0.1); + SET current_num = current_num + 1; + END WHILE; +END| +DELIMITER ;| + +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1b +--let $connection_id = `SELECT CONNECTION_ID()` +--disable_query_log +--disable_result_log +--send CALL proc_insert(500); + +# +# Run concurrent UPDATEs. We expect that each UPDATE will report that +# some rows were matched and updated +# + +--connection node_2 +--let $count = 2 +--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` + +while ($count) +{ + --let $signature = `SELECT LEFT(MD5(RAND()), 10)` + --disable_query_log + --error 0,ER_LOCK_DEADLOCK + --eval UPDATE t1 SET f2 = '$signature' + --enable_query_log + --let $row_count = `SELECT ROW_COUNT()` + if (`SELECT @@error_count = 0`) { + if (`SELECT $row_count = 0`) { + --die ROW_COUNT() = 0 + } + } + + # + # Ensure at least one replay happens + # + + --let $wsrep_replays = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` + --disable_query_log + if (`SELECT $wsrep_replays - $wsrep_local_replays_old > 0`) { + --dec $count + } + --enable_query_log +} + +# +# Confirm that some transaction replays occurred +# + +--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` +--disable_query_log +--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old > 0 AS wsrep_local_replays; +--enable_query_log + +# +# getting execution results for --send +# + +--connection node_1b +--error 0,1317,2013,2026 +--reap +--enable_query_log +--enable_result_log + +--connection node_1 +DROP PROCEDURE proc_insert; +DROP TABLE t1; + +--disconnect node_1b + +# Due to MW-330, Multiple "conflict state 3 after post commit" warnings if table is dropped while SP is running +CALL mtr.add_suppression("WSREP: .* conflict state after post commit "); + +set global innodb_status_output=Default; From 65545a3df20cf963429ae5522e319f1d15026c28 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 5 Dec 2023 01:24:09 +0100 Subject: [PATCH 08/65] galera: root certificate renewed --- .../std_data/galera_certs/galera.root.crt | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-test/std_data/galera_certs/galera.root.crt b/mysql-test/std_data/galera_certs/galera.root.crt index e965d5a26d6..70f1265426c 100644 --- a/mysql-test/std_data/galera_certs/galera.root.crt +++ b/mysql-test/std_data/galera_certs/galera.root.crt @@ -2,7 +2,7 @@ MIIFlTCCA32gAwIBAgIUKCF88W+48rZzdfgYpE2dXVMGSKgwDQYJKoZIhvcNAQEL BQAwWjELMAkGA1UEBhMCRkkxETAPBgNVBAgMCEhlbHNpbmtpMREwDwYDVQQHDAhI ZWxzaW5raTEPMA0GA1UECgwGR2FsZXJhMRQwEgYDVQQDDAtnYWxlcmEucm9vdDAe -Fw0yMTAyMDQxMzE3MDJaFw0yMzExMjUxMzE3MDJaMFoxCzAJBgNVBAYTAkZJMREw +Fw0yMzEyMDExMzQzNDBaFw0zMzExMjgxMzQzNDBaMFoxCzAJBgNVBAYTAkZJMREw DwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVsc2lua2kxDzANBgNVBAoMBkdh bGVyYTEUMBIGA1UEAwwLZ2FsZXJhLnJvb3QwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQDKqL45jbaq8RLOj+DeilPcEnBN5gn/y9V3IfZ0BQCd4bR09zLz @@ -18,15 +18,15 @@ dl5QYYMbmyNedNKdwV4idhGCy+Zq7VAX4lBXazI1rD9vQb+oTcPGQiy4i/Vi/g6i F+XZTdTiaOWPEmvFFGLLUQxKl4w872hJaupqfteqdiZ+3ICVIUI8qnXHmwIDAQAB o1MwUTAdBgNVHQ4EFgQUs75v/MgjJ5RHGE6+0qdiVo4BwlowHwYDVR0jBBgwFoAU s75v/MgjJ5RHGE6+0qdiVo4BwlowDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B -AQsFAAOCAgEAOVhBs28dwwvD5q2r7oVVcxLc+tb8zu4XxpXT1p6hiZYUyPguCh00 -GVdXCgR4JMI/NcyM5fBAbF3S8oK3+9rw2kW09afVV06Qf/8o3nIyOiDl7598tGIP -CCK4QsUW/dGajx5kvhtQ7qce+u9KfFTof6lq2xkYtFBBhmBdSv9A1jAZJMw2x3bc -nr99PS8XZMphS0MIExHKj6Ry5DdYm722zZHyIEiiEGyMViDm2m1iug5r/LPH5Z56 -BjQiH4VP+0y5mevBOUGuH8ID+J9Hu9BeoXLhkv+W2Ljs/S6wqzjinMBqVG+wwe0Y -a8F5pABkl5uX38nMQ7CikSbLxSbn7nRf+sux1sbzqjMldeCSqiv9mI5Ysq97+Ni1 -5qMxNxNc0u/wGRnrXH8fWfxBKPP5moA7DQfVcUWPgDGQwDpA8kn8RlJxFk3g4yaK -+NMwk5MORKyx3tz/A3Yhs9AUXk3okvmQCT2YVSHcKUB8PAU+TaKqbr3wk07Y/tL/ -jFPHS+t3eD91Y05KGUXjdtGi+33zpV0biHmTWAZT78VQowDNvEpTnXhkSx8HGHYR -nqSMU2m2LboHSatY113RYznx0LJ1azczRlJdGs8oyPWLPDD2JCesZaQqGZVRJoms -lK4EzYEb5mZTCRgtgoiO+iKcf6XifuOCrWZXoLm4FlLEfOQ3b8yAFlo= +AQsFAAOCAgEAKLV6mkWb88HEJXo1XlmAzznIYNfilrvvxwcjhceluDE8s8sPSpYM +Bz5ebWlHCgEkC/ezhA/PDtZsZlQKwv4jb++lAlFSlebT1GW77xKkdRBTKgkFAaOA +pF5eZao6IP8l76fA4OoI2Tttw5jeb23kOoklDp/8VS0JEAT3wm/hZiE20aUbAFC+ +kPiCucBztzaTHQud9CgtxRH/B3D9FaPuwae/H6FYrvQVNVjcaHTIUh9fTcyKRXYm +oYbvK7fIhCjZkG2LRWRU9Kirivb+ktO4POsuK4BgYrsFaOBf9HYsojA7llyGDopN +cfw9jtb27Qb/uMKJnClFg14u685CU5JAzY31E5OQPPUUx9PqP4Z9PgXRQ0xI6H/4 +sejlcQuqGCDKiL2lOzUjbT86EjO4ZfiKHR+lKOIuT5mXiR8cbS1JeyX3Mrv1Ds4r +UVcdtSXTy6/XYWFIzhu+MrsFon6VX0HkmSH1HjSoLMOZcHAZIFZZ/uAahLmMNaEG +lV15fD5+t5QRKwqmdFUW2ETiqSJxRs6Y++ptxpiiH38QVWPvBWeRgcPpf3A478Bl +iGO0xn0N57TnhFs3g0C0xyZgTBMozfVostYpps1Tqqz0VOhtmURxTZm9JZgTb7qv +nMURY0SIQKXpHCcJuNtxZcDSu8uxgUcMsLSSC7Zmk7/cSeUfmOgZVzU= -----END CERTIFICATE----- From c9a6adba1e60f874ea0ff4416dd112ee0240b428 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 20 Feb 2024 00:57:55 +0100 Subject: [PATCH 09/65] galera mtr tests: synchronization of tests between branches --- mysql-test/suite/galera/disabled.def | 3 ++ .../r/galera_binlog_stmt_autoinc.result | 4 +- .../suite/galera/r/galera_defaults.result | 4 +- .../r/galera_gcache_recover_manytrx.result | 14 ++--- .../r/galera_parallel_apply_lock_table.result | 34 ++++++------ .../galera/r/galera_sequence_engine.result | 8 ++- .../suite/galera/r/galera_sequences.result | 5 +- .../galera/r/galera_toi_ddl_fk_insert.result | 16 ++++++ mysql-test/suite/galera/r/galera_wan.result | 12 ++--- .../galera/r/galera_wan_restart_sst.result | 9 +++- ...alera_wsrep_provider_options_syntax.result | 4 +- .../r/galera_wsrep_schema_detached.result | 9 +++- .../suite/galera/r/mysql-wsrep#198.result | 3 ++ mysql-test/suite/galera/t/MDEV-18832.test | 1 + mysql-test/suite/galera/t/MDEV-27862.test | 1 + mysql-test/suite/galera/t/MDEV-32549.test | 1 + mysql-test/suite/galera/t/MDEV-33828.cnf | 9 ++++ mysql-test/suite/galera/t/MDEV-33828.test | 1 - mysql-test/suite/galera/t/MDEV-34647.cnf | 13 +++++ mysql-test/suite/galera/t/MDEV-34647.test | 4 +- mysql-test/suite/galera/t/MW-416.test | 23 ++++---- mysql-test/suite/galera/t/galera#500.test | 5 ++ mysql-test/suite/galera/t/galera_admin.test | 9 +--- .../suite/galera/t/galera_backup_stage.test | 6 +-- .../galera/t/galera_binlog_stmt_autoinc.test | 8 +-- .../suite/galera/t/galera_cache_index.test | 1 + .../suite/galera/t/galera_can_run_toi.test | 1 + .../suite/galera/t/galera_create_trigger.test | 1 - mysql-test/suite/galera/t/galera_ctas.test | 3 +- .../suite/galera/t/galera_defaults.test | 4 +- .../t/galera_gcache_recover_manytrx.test | 14 ++--- .../t/galera_parallel_apply_lock_table.test | 14 ++--- .../galera/t/galera_parallel_simple.test | 2 +- .../suite/galera/t/galera_pc_recovery.test | 4 +- .../suite/galera/t/galera_read_only.test | 1 - .../galera/t/galera_sequence_engine.test | 13 ++++- .../suite/galera/t/galera_sequences.test | 4 ++ .../galera/t/galera_toi_ddl_fk_insert.test | 14 +++-- .../galera/t/galera_var_reject_queries.test | 4 +- .../galera/t/galera_var_retry_autocommit.test | 1 + mysql-test/suite/galera/t/galera_wan.cnf | 1 - mysql-test/suite/galera/t/galera_wan.test | 12 ++--- .../suite/galera/t/galera_wan_restart_ist.cnf | 1 - .../galera/t/galera_wan_restart_sst.test | 39 ++++++++++++-- .../galera_wsrep_provider_options_syntax.test | 4 +- .../t/galera_wsrep_schema_detached.test | 13 ++++- .../suite/galera/t/mysql-wsrep#198.test | 5 ++ .../suite/galera/t/mysql_tzinfo_to_sql.test | 1 + .../suite/galera/t/wsrep_strict_ddl.test | 1 + mysql-test/suite/galera_3nodes/disabled.def | 1 - .../r/galera_safe_to_bootstrap.result | 4 +- .../galera_3nodes/t/galera_2_cluster.test | 2 +- .../galera_3nodes/t/galera_gtid_2_cluster.cnf | 1 + .../t/galera_ipv6_mysqldump.test | 1 - .../t/galera_safe_to_bootstrap.test | 4 +- .../suite/galera_3nodes_sr/r/GCF-832.result | 12 +++-- .../galera_sr_kill_slave_before_apply.result | 1 + .../suite/galera_3nodes_sr/t/GCF-832.test | 19 +++++-- .../t/galera_sr_kill_slave_before_apply.test | 3 ++ mysql-test/suite/galera_sr/disabled.def | 2 - mysql-test/suite/galera_sr/r/GCF-572.result | 5 +- .../suite/galera_sr/r/MDEV-18585.result | 38 ++++++------- .../suite/galera_sr/r/MDEV-27615.result | 2 +- mysql-test/suite/galera_sr/r/MENT-2042.result | 24 +++++++++ .../galera_sr/r/galera_sr_cc_master.result | 2 +- mysql-test/suite/galera_sr/t/GCF-572.test | 2 +- mysql-test/suite/galera_sr/t/MDEV-18585.test | 5 +- mysql-test/suite/galera_sr/t/MDEV-27615.test | 3 +- mysql-test/suite/galera_sr/t/MDEV-28971.test | 1 + mysql-test/suite/galera_sr/t/MENT-2042.test | 54 +++++++++++++++++++ .../galera_sr/t/galera_sr_cc_master.test | 2 +- .../galera_sr/t/galera_sr_mysqldump_sst.test | 1 - mysql-test/suite/wsrep/t/pool_of_threads.test | 1 + mysql-test/suite/wsrep/t/variables.test | 1 - mysql-test/suite/wsrep/t/variables_debug.test | 3 +- 75 files changed, 394 insertions(+), 164 deletions(-) create mode 100644 mysql-test/suite/galera/t/MDEV-34647.cnf create mode 100644 mysql-test/suite/galera_sr/r/MENT-2042.result create mode 100644 mysql-test/suite/galera_sr/t/MENT-2042.test diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 3d3ef86f04a..80dc730250b 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -11,3 +11,6 @@ ############################################################################## galera_sequences : MDEV-35934/MDEV-33850 For Galera, create sequence with low cache got signal 6 error: [ERROR] WSREP: FSM: no such a transition REPLICATING -> COMMITTED +galera_wan : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan +galera_bf_abort_lock_table : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock +mysql-wsrep#198 : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock diff --git a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result index 4fe33674701..78f3bd6f9d3 100644 --- a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result +++ b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result @@ -1,11 +1,11 @@ connection node_2; connection node_1; connection node_1; +connection node_2; +connection node_1; SET GLOBAL auto_increment_offset=1; connection node_2; SET GLOBAL auto_increment_offset=2; -connection node_1; -connection node_2; connection node_2; SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; connection node_1; diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result index e474c885473..ba153669ad9 100644 --- a/mysql-test/suite/galera/r/galera_defaults.result +++ b/mysql-test/suite/galera/r/galera_defaults.result @@ -1,8 +1,8 @@ connection node_2; connection node_1; # Correct Galera library found -SELECT COUNT(*) `expect 49` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; -expect 49 +SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; +expect 50 50 SELECT VARIABLE_NAME, VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result index 8c6da8f8f46..5338c096be8 100644 --- a/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result +++ b/mysql-test/suite/galera/r/galera_gcache_recover_manytrx.result @@ -99,19 +99,19 @@ Killing server ... connection node_1; Killing server ... connection node_1_insert_simple; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1_insert_multi; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1_insert_transaction; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1_update_simple; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1_insert_1k; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1_insert_1m; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1_insert_10m; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1; Performing --wsrep-recover ... Using --wsrep-start-position when starting mysqld ... diff --git a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result index 48625b3ba4a..a15b0c7df69 100644 --- a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result +++ b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result @@ -10,31 +10,31 @@ INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); connection node_2a; SET SESSION wsrep_sync_wait=0; -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%'; -COUNT(*) = 1 +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); +EXPECT_1 1 -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM t1; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM t2; -COUNT(*) = 0 +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; +EXPECT_1 1 +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_0 FROM t2; +EXPECT_0 +0 connection node_2; UNLOCK TABLES; connection node_2a; SET SESSION wsrep_sync_wait = 15;; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 1 -SELECT COUNT(*) = 1 FROM t2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%'; -COUNT(*) = 2 +SELECT COUNT(*) AS EXPECT_1 FROM t2; +EXPECT_1 1 +SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification'); +EXPECT_2 +2 SET GLOBAL wsrep_slave_threads = 1;; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera/r/galera_sequence_engine.result b/mysql-test/suite/galera/r/galera_sequence_engine.result index 93e6c46bd7a..4539d63621b 100644 --- a/mysql-test/suite/galera/r/galera_sequence_engine.result +++ b/mysql-test/suite/galera/r/galera_sequence_engine.result @@ -1,5 +1,10 @@ connection node_2; connection node_1; +connection node_2; +SET GLOBAL wsrep_ignore_apply_errors=0; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +SET SESSION wsrep_sync_wait=0; SET GLOBAL wsrep_ignore_apply_errors=0; SET SESSION AUTOCOMMIT=0; SET SESSION max_error_count=0; @@ -8,5 +13,4 @@ ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences i connection node_2; SHOW CREATE TABLE t0; ERROR 42S02: Table 'test.t0' doesn't exist -connection node_1; -SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; +disconnect node_2a; diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result index 1f6b2bd6637..b262ab6d1be 100644 --- a/mysql-test/suite/galera/r/galera_sequences.result +++ b/mysql-test/suite/galera/r/galera_sequences.result @@ -249,10 +249,13 @@ CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; ALTER TABLE t ENGINE=MYISAM; ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' ALTER SEQUENCE t INCREMENT BY 1 CACHE=10; -ERROR 42000: This version of MariaDB doesn't yet support 'CACHE without INCREMENT BY 0 in Galera cluster' +ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' ALTER SEQUENCE t INCREMENT BY 1 NOCACHE; +ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' ALTER SEQUENCE t INCREMENT BY 0 NOCACHE; +ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' ALTER SEQUENCE t INCREMENT BY 0 CACHE=10; +ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' DROP SEQUENCE t; CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result index 2493075b635..6e55c59ad15 100644 --- a/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result +++ b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result @@ -23,6 +23,22 @@ connection node_1a; connection node_1b; connection node_2; connection node_2a; +connection node_1; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) FROM parent; +COUNT(*) +20001 +SELECT COUNT(*) FROM child; +COUNT(*) +10000 +connection node_2; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) FROM parent; +COUNT(*) +20001 +SELECT COUNT(*) FROM child; +COUNT(*) +10000 DROP TABLE child; DROP TABLE parent; DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_wan.result b/mysql-test/suite/galera/r/galera_wan.result index 3904c1dc517..1fa36456c4d 100644 --- a/mysql-test/suite/galera/r/galera_wan.result +++ b/mysql-test/suite/galera/r/galera_wan.result @@ -1,9 +1,9 @@ connection node_2; connection node_1; -CALL mtr.add_suppression("WSREP: Stray state UUID msg:"); -CALL mtr.add_suppression("Sending JOIN failed: "); -CALL mtr.add_suppression("WSREP: .* sending install message failed: Socket is not connected"); -CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); +CALL mtr.add_suppression("WSREP: Stray state UUID msg: "); +CALL mtr.add_suppression("WSREP: .*Sending JOIN failed: "); +CALL mtr.add_suppression("WSREP: .*sending install message failed: Socket is not connected"); +CALL mtr.add_suppression("WSREP: .*There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 @@ -36,8 +36,8 @@ VARIABLE_VALUE LIKE '%gmcast.segment = 3%' 1 DROP TABLE t1; connection node_1; -call mtr.add_suppression("WSREP: read_completion_condition.*"); -call mtr.add_suppression("WSREP: read_handler.*"); +call mtr.add_suppression("WSREP: read_completion_condition"); +call mtr.add_suppression("WSREP: read_handler"); disconnect node_3; disconnect node_4; disconnect node_2; diff --git a/mysql-test/suite/galera/r/galera_wan_restart_sst.result b/mysql-test/suite/galera/r/galera_wan_restart_sst.result index 2433a1d9c48..edaefe0e563 100644 --- a/mysql-test/suite/galera/r/galera_wan_restart_sst.result +++ b/mysql-test/suite/galera/r/galera_wan_restart_sst.result @@ -10,7 +10,7 @@ SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA EXPECT_4 4 connection node_1; -CREATE TABLE t1 (f1 INTEGER); +CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=INNODB; INSERT INTO t1 VALUES (1); connection node_2; INSERT INTO t1 VALUES (2); @@ -20,6 +20,8 @@ connection node_4; INSERT INTO t1 VALUES (4); connection node_3; INSERT INTO t1 VALUES (13); +connection node_1; +connection node_3; Killing server ... connection node_1; INSERT INTO t1 VALUES (11); @@ -29,8 +31,11 @@ connection node_4; INSERT INTO t1 VALUES (14); connection node_3; INSERT INTO t1 VALUES (131); +connection node_1; connection node_2; INSERT INTO t1 VALUES (22); +connection node_1; +connection node_2; Killing server ... connection node_1; INSERT INTO t1 VALUES (21); @@ -42,6 +47,8 @@ connection node_2; INSERT INTO t1 VALUES (221); connection node_4; INSERT INTO t1 VALUES (34); +connection node_1; +connection node_4; Killing server ... connection node_1; INSERT INTO t1 VALUES (31); diff --git a/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result b/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result index 5b35bdcef10..36253c5fae9 100644 --- a/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result +++ b/mysql-test/suite/galera/r/galera_wsrep_provider_options_syntax.result @@ -1,7 +1,7 @@ connection node_2; connection node_1; -call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\\.segment'"); -call mtr.add_suppression("WSREP\: Set options returned 7"); +call mtr.add_suppression("WSREP: Unknown parameter 'gmcasts\\.segment'"); +call mtr.add_suppression("WSREP: Set options returned 7"); SET GLOBAL wsrep_provider_options="gmcasts.segment=1"; ERROR HY000: Incorrect arguments to SET Unhandled exceptions: 0 diff --git a/mysql-test/suite/galera/r/galera_wsrep_schema_detached.result b/mysql-test/suite/galera/r/galera_wsrep_schema_detached.result index 4667aa98ccc..fbdc7dd7631 100644 --- a/mysql-test/suite/galera/r/galera_wsrep_schema_detached.result +++ b/mysql-test/suite/galera/r/galera_wsrep_schema_detached.result @@ -3,10 +3,17 @@ connection node_1; connection node_1; connection node_2; connection node_1; -call mtr.add_suppression("WSREP:.*"); +call mtr.add_suppression("WSREP: async IST sender failed to serve"); +call mtr.add_suppression("WSREP: Failed to establish connection: Connection refused"); +call mtr.add_suppression("WSREP: IST failed: IST sender, failed to connect"); +call mtr.add_suppression("WSREP: .*State transfer.* failed: Protocol error"); SET @wsrep_provider_options_orig = @@GLOBAL.wsrep_provider_options; SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2'; connection node_2; +call mtr.add_suppression("WSREP: async IST sender failed to serve"); +call mtr.add_suppression("WSREP: Failed to establish connection: Connection refused"); +call mtr.add_suppression("WSREP: IST failed: IST sender, failed to connect"); +call mtr.add_suppression("WSREP: .*State transfer.* failed: Protocol error"); SET @wsrep_cluster_address_orig = @@GLOBAL.wsrep_cluster_address; SET GLOBAL WSREP_ON=0; SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; diff --git a/mysql-test/suite/galera/r/mysql-wsrep#198.result b/mysql-test/suite/galera/r/mysql-wsrep#198.result index 5b569ffae27..7759c4f1982 100644 --- a/mysql-test/suite/galera/r/mysql-wsrep#198.result +++ b/mysql-test/suite/galera/r/mysql-wsrep#198.result @@ -31,3 +31,6 @@ test.t1 repair note The storage engine for the table doesn't support repair test.t2 repair note The storage engine for the table doesn't support repair DROP TABLE t1; DROP TABLE t2; +connection node_1; +disconnect node_2a; +disconnect node_2b; diff --git a/mysql-test/suite/galera/t/MDEV-18832.test b/mysql-test/suite/galera/t/MDEV-18832.test index d60be151142..eec8e7dc28a 100644 --- a/mysql-test/suite/galera/t/MDEV-18832.test +++ b/mysql-test/suite/galera/t/MDEV-18832.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_sequence.inc CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE; CREATE TABLE t1 (Id int(11) NOT NULL, PRIMARY KEY (Id)); diff --git a/mysql-test/suite/galera/t/MDEV-27862.test b/mysql-test/suite/galera/t/MDEV-27862.test index f19d6b5db42..f8dd8d0cff6 100644 --- a/mysql-test/suite/galera/t/MDEV-27862.test +++ b/mysql-test/suite/galera/t/MDEV-27862.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_sequence.inc --disable_ps2_protocol diff --git a/mysql-test/suite/galera/t/MDEV-32549.test b/mysql-test/suite/galera/t/MDEV-32549.test index a2faa46da5f..b8e58fa4ff9 100644 --- a/mysql-test/suite/galera/t/MDEV-32549.test +++ b/mysql-test/suite/galera/t/MDEV-32549.test @@ -3,6 +3,7 @@ # statement is rolled back # --source include/galera_cluster.inc +--source include/have_aria.inc CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) engine=innodb; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) engine=aria; diff --git a/mysql-test/suite/galera/t/MDEV-33828.cnf b/mysql-test/suite/galera/t/MDEV-33828.cnf index 4c62448fe3d..1b8791ae398 100644 --- a/mysql-test/suite/galera/t/MDEV-33828.cnf +++ b/mysql-test/suite/galera/t/MDEV-33828.cnf @@ -2,3 +2,12 @@ [mysqld] log-bin +log-slave-updates + +[mysqld.1] +auto-increment-increment=2 +auto-increment-offset=1 + +[mysqld.2] +auto-increment-increment=2 +auto-increment-offset=2 diff --git a/mysql-test/suite/galera/t/MDEV-33828.test b/mysql-test/suite/galera/t/MDEV-33828.test index 8e30481beee..b7eb2ee7d02 100644 --- a/mysql-test/suite/galera/t/MDEV-33828.test +++ b/mysql-test/suite/galera/t/MDEV-33828.test @@ -1,6 +1,5 @@ --source include/galera_cluster.inc --source include/have_innodb.inc ---source include/have_aria.inc SET AUTOCOMMIT=ON; SELECT @@autocommit; diff --git a/mysql-test/suite/galera/t/MDEV-34647.cnf b/mysql-test/suite/galera/t/MDEV-34647.cnf new file mode 100644 index 00000000000..1b8791ae398 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-34647.cnf @@ -0,0 +1,13 @@ +!include ../galera_2nodes.cnf + +[mysqld] +log-bin +log-slave-updates + +[mysqld.1] +auto-increment-increment=2 +auto-increment-offset=1 + +[mysqld.2] +auto-increment-increment=2 +auto-increment-offset=2 diff --git a/mysql-test/suite/galera/t/MDEV-34647.test b/mysql-test/suite/galera/t/MDEV-34647.test index 1697bf05f28..31488b1a4d1 100644 --- a/mysql-test/suite/galera/t/MDEV-34647.test +++ b/mysql-test/suite/galera/t/MDEV-34647.test @@ -1,4 +1,5 @@ --source include/galera_cluster.inc +--source include/have_innodb.inc --source include/have_aria.inc create table t1(id serial, val varchar(100)) engine=myisam; @@ -38,7 +39,6 @@ insert into t5 select null, 'c'; insert into t5 select null, 'd' from t5; select * from t2; - --connection node_2 select * from t1; select * from t2; @@ -46,8 +46,6 @@ select * from t3; select * from t4; select * from t5; - --connection node_1 drop table t1,t2,t3,t4,t5; set global wsrep_replicate_myisam=default; - diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test index f9a1b47e2ff..9d876233eb4 100644 --- a/mysql-test/suite/galera/t/MW-416.test +++ b/mysql-test/suite/galera/t/MW-416.test @@ -17,30 +17,30 @@ ALTER DATABASE db CHARACTER SET = utf8; ALTER EVENT ev1 RENAME TO ev2; --error 1370 ALTER FUNCTION fun1 COMMENT 'foo'; -#--error 1044,1227 +#--error 1044,1142,1227,1370 #ALTER INSTANCE ROTATE INNODB MASTER KEY; ---error 1044,1227 +--error 1044,1142,1227,1370 ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB; ---error 1044,1227,1370 +--error 1044,1142,1227,1370 ALTER PROCEDURE proc1 COMMENT 'foo'; ---error 1044,1227,1370 +--error 1044,1142,1227,1370 ALTER SERVER srv OPTIONS (USER 'sally'); --error 1044,1142,1227,1370 ALTER TABLE tbl DROP COLUMN col; ---error 1044,1227,1370 +--error 1044,1142,1227,1370 ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb; --error 1044,1142,1227,1370 ALTER VIEW vw AS SELECT 1; ---error 1044,1227,1370 +--error 1044,1142,1227,1370 CREATE DATABASE db; ---error 1044,1227,1370 +--error 1044,1142,1227,1370 CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1; ---error 1044,1227,1370 +--error 1044,1142,1227,1370 CREATE FUNCTION fun1() RETURNS int RETURN(1); ---error 1044,1227,1370 +--error 1044,1142,1227,1370 CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so'; ---error 1044,1227,1370 +--error 1044,1142,1227,1370 CREATE PROCEDURE proc1() BEGIN END; --error 1044,1142,1227,1370 CREATE INDEX idx ON tbl(id); @@ -57,8 +57,6 @@ CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END; --error 1044,1142,1227,1370 CREATE VIEW vw AS SELECT 1; - - --error 1044,1142,1227,1370 DROP DATABASE db; --error 1044,1142,1227,1370 @@ -129,4 +127,3 @@ UNINSTALL PLUGIN plg; --connection node_1 DROP USER 'userMW416'@'localhost'; SHOW DATABASES; - diff --git a/mysql-test/suite/galera/t/galera#500.test b/mysql-test/suite/galera/t/galera#500.test index c393b7fd056..cc814af6d31 100644 --- a/mysql-test/suite/galera/t/galera#500.test +++ b/mysql-test/suite/galera/t/galera#500.test @@ -3,7 +3,12 @@ # thrown from gcomm background thread, the provider terminates properly # and wsrep_ready becomes 0. # +# Not to be run with ASAN. Provider leaks memory when gcomm +# thread is aborted forcifully and ASAN crashes during leak report +# after provider is unloaded. +# +--source include/not_asan.inc --source include/have_innodb.inc --source include/galera_cluster.inc --source include/galera_have_debug_sync.inc diff --git a/mysql-test/suite/galera/t/galera_admin.test b/mysql-test/suite/galera/t/galera_admin.test index e3c43256ad5..114208aef3e 100644 --- a/mysql-test/suite/galera/t/galera_admin.test +++ b/mysql-test/suite/galera/t/galera_admin.test @@ -5,7 +5,6 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc --disable_warnings DROP TABLE IF EXISTS t1, t2; @@ -34,7 +33,6 @@ INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); --let $wait_condition = SELECT COUNT(*) = 10000 FROM t2; --source include/wait_condition.inc - --echo # ANALYZE test --connection node_2 --let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` @@ -46,8 +44,6 @@ ANALYZE TABLE t1, t2; --let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc - - --echo # OPTIMIZE test --connection node_2 --let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` @@ -59,8 +55,6 @@ OPTIMIZE TABLE t1, t2; --let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc - - --echo # REPAIR test --connection node_2 --let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` @@ -72,8 +66,6 @@ REPAIR TABLE x1, x2; --let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc - - --connection node_2 SELECT COUNT(*) = 10 FROM t1; SELECT COUNT(*) = 10 FROM x1; @@ -83,4 +75,5 @@ SELECT COUNT(*) = 10 FROM x2; --connection node_1 DROP TABLE t1, t2; DROP TABLE x1, x2; + SET GLOBAL wsrep_replicate_myisam = FALSE; diff --git a/mysql-test/suite/galera/t/galera_backup_stage.test b/mysql-test/suite/galera/t/galera_backup_stage.test index 31d76816355..ef0706f9ab1 100644 --- a/mysql-test/suite/galera/t/galera_backup_stage.test +++ b/mysql-test/suite/galera/t/galera_backup_stage.test @@ -56,7 +56,7 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10)); # reach commit stage. In the unlikely case the interleaving is different, the # result of the test should not change. --connection node_1c ---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id +--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id --source include/wait_condition.inc @@ -83,11 +83,11 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10)); # wait for insert to get blocked --connection node_1c ---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id +--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id --source include/wait_condition.inc ---let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND State = 'Commit' +--let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND (State='Commit' or State='Waiting for certification') --source include/wait_condition.inc # nothing after BLOCK_DDL is applied diff --git a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test index 994f7695fc6..81bf6738086 100644 --- a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test +++ b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test @@ -5,15 +5,15 @@ --source include/galera_cluster.inc --source include/force_restart.inc +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + --connection node_1 SET GLOBAL auto_increment_offset=1; --connection node_2 SET GLOBAL auto_increment_offset=2; ---let $node_1=node_1 ---let $node_2=node_2 ---source include/auto_increment_offset_save.inc - ## ## Verify the correct operation of the auto-increment when the binlog ## format artificially set to the 'STATEMENT' (although this mode is diff --git a/mysql-test/suite/galera/t/galera_cache_index.test b/mysql-test/suite/galera/t/galera_cache_index.test index b373a173894..294a13295c4 100644 --- a/mysql-test/suite/galera/t/galera_cache_index.test +++ b/mysql-test/suite/galera/t/galera_cache_index.test @@ -1,4 +1,5 @@ --source include/galera_cluster.inc +--source include/have_innodb.inc CREATE TABLE t1 (c1 int, UNIQUE INDEX (c1)) engine=innodb; INSERT INTO t1 VALUES (1),(2),(3),(4),(5); diff --git a/mysql-test/suite/galera/t/galera_can_run_toi.test b/mysql-test/suite/galera/t/galera_can_run_toi.test index a0087be4304..ea6a34dae30 100644 --- a/mysql-test/suite/galera/t/galera_can_run_toi.test +++ b/mysql-test/suite/galera/t/galera_can_run_toi.test @@ -1,4 +1,5 @@ --source include/galera_cluster.inc +--source include/have_innodb.inc # # MDEV-24833 : Signal 11 on wsrep_can_run_in_toi at wsrep_mysqld.cc:1994 # diff --git a/mysql-test/suite/galera/t/galera_create_trigger.test b/mysql-test/suite/galera/t/galera_create_trigger.test index 6708e30bf0f..1d0d0f846fc 100644 --- a/mysql-test/suite/galera/t/galera_create_trigger.test +++ b/mysql-test/suite/galera/t/galera_create_trigger.test @@ -40,4 +40,3 @@ DROP TABLE definer_root; DROP TABLE definer_default; DROP USER 'user1'; - diff --git a/mysql-test/suite/galera/t/galera_ctas.test b/mysql-test/suite/galera/t/galera_ctas.test index 8b9ad9c4a20..05561204123 100644 --- a/mysql-test/suite/galera/t/galera_ctas.test +++ b/mysql-test/suite/galera/t/galera_ctas.test @@ -1,4 +1,6 @@ --source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_aria.inc --connection node_1 create table t1_Aria(a int, count int, b int, key(b)) engine=Aria; @@ -36,4 +38,3 @@ SHOW CREATE TABLE t4; DROP TABLE t2, t3,t4; DROP TABLE t1_MyISAM, t1_Aria,t1_InnoDB; - diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test index 74022a40b3a..c43dbe7a705 100644 --- a/mysql-test/suite/galera/t/galera_defaults.test +++ b/mysql-test/suite/galera/t/galera_defaults.test @@ -13,12 +13,12 @@ --source include/force_restart.inc # Make sure that the test is operating on the right version of galera library. ---let $galera_version=26.4.8 +--let $galera_version=26.4.11 source ../wsrep/include/check_galera_version.inc; # Global Variables -SELECT COUNT(*) `expect 49` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; +SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; SELECT VARIABLE_NAME, VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test index 532de6d5d10..3834607ce86 100644 --- a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test +++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test @@ -141,31 +141,31 @@ SET SESSION wsrep_sync_wait = 0; --source include/kill_galera.inc --connection node_1_insert_simple ---error 2013 +--error 2013, 2026 --reap --connection node_1_insert_multi ---error 2013 +--error 2013, 2026 --reap --connection node_1_insert_transaction ---error 2013 +--error 2013, 2026 --reap --connection node_1_update_simple ---error 2013 +--error 2013, 2026 --reap --connection node_1_insert_1k ---error 2013 +--error 2013, 2026 --reap --connection node_1_insert_1m ---error 2013 +--error 2013, 2026 --reap --connection node_1_insert_10m ---error 2013 +--error 2013, 2026 --reap --connection node_1 diff --git a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test index 5a33c16c86e..2e9f05cb4af 100644 --- a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test +++ b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test @@ -32,19 +32,19 @@ INSERT INTO t2 VALUES (1); --connection node_2a --sleep 1 SET SESSION wsrep_sync_wait=0; -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%'; -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; -SELECT COUNT(*) = 0 FROM t1; -SELECT COUNT(*) = 0 FROM t2; +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +SELECT COUNT(*) AS EXPECT_0 FROM t2; --connection node_2 UNLOCK TABLES; --connection node_2a --eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig; -SELECT COUNT(*) = 1 FROM t1; -SELECT COUNT(*) = 1 FROM t2; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%'; +SELECT COUNT(*) AS EXPECT_1 FROM t1; +SELECT COUNT(*) AS EXPECT_1 FROM t2; +SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification'); --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_parallel_simple.test b/mysql-test/suite/galera/t/galera_parallel_simple.test index d49dc0ae876..a305473dbbb 100644 --- a/mysql-test/suite/galera/t/galera_parallel_simple.test +++ b/mysql-test/suite/galera/t/galera_parallel_simple.test @@ -51,7 +51,7 @@ SET SESSION wsrep_sync_wait = 0; --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%'; --source include/wait_condition.inc ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committing%'; +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); --source include/wait_condition.inc UNLOCK TABLES; diff --git a/mysql-test/suite/galera/t/galera_pc_recovery.test b/mysql-test/suite/galera/t/galera_pc_recovery.test index 631054103a3..4489db63a91 100644 --- a/mysql-test/suite/galera/t/galera_pc_recovery.test +++ b/mysql-test/suite/galera/t/galera_pc_recovery.test @@ -33,8 +33,8 @@ SELECT COUNT(*) = 1 FROM t1; # Perform --wsrep-recover and preserve the positions into variables by placing them in $MYSQL_TMP_DIR/galera_wsrep_start_position.inc and then --source'ing it ---exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --innodb --wsrep-recover --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.1.log > $MYSQL_TMP_DIR/galera_wsrep_recover.1.log 2>&1 ---exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --innodb --wsrep-recover --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.2.log > $MYSQL_TMP_DIR/galera_wsrep_recover.2.log 2>&1 +--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-recover --loose-innodb --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.1.log > $MYSQL_TMP_DIR/galera_wsrep_recover.1.log 2>&1 +--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-recover --loose-innodb --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.2.log > $MYSQL_TMP_DIR/galera_wsrep_recover.2.log 2>&1 --perl use strict; diff --git a/mysql-test/suite/galera/t/galera_read_only.test b/mysql-test/suite/galera/t/galera_read_only.test index 56fe2fdd910..14d05322859 100644 --- a/mysql-test/suite/galera/t/galera_read_only.test +++ b/mysql-test/suite/galera/t/galera_read_only.test @@ -47,4 +47,3 @@ DROP TABLE t2; SET GLOBAL read_only=FALSE; DROP TABLE t1; DROP USER foo@localhost; - diff --git a/mysql-test/suite/galera/t/galera_sequence_engine.test b/mysql-test/suite/galera/t/galera_sequence_engine.test index 47107dcce84..affdfaa9d2a 100644 --- a/mysql-test/suite/galera/t/galera_sequence_engine.test +++ b/mysql-test/suite/galera/t/galera_sequence_engine.test @@ -1,6 +1,13 @@ --source include/galera_cluster.inc --source include/have_sequence.inc +--connection node_2 +let $restore_wsrep_ignore_apply_errors=`SELECT @@GLOBAL.wsrep_ignore_apply_errors`; +SET GLOBAL wsrep_ignore_apply_errors=0; + +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 +--connection node_2a +SET SESSION wsrep_sync_wait=0; SET GLOBAL wsrep_ignore_apply_errors=0; SET SESSION AUTOCOMMIT=0; SET SESSION max_error_count=0; @@ -11,6 +18,8 @@ CREATE TABLE t0 (id GEOMETRY,parent_id GEOMETRY)ENGINE=SEQUENCE; --error ER_NO_SUCH_TABLE SHOW CREATE TABLE t0; ---connection node_1 -SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; +--disable_query_log +--eval SET GLOBAL wsrep_ignore_apply_errors=$restore_wsrep_ignore_apply_errors +--enable_query_log +--disconnect node_2a diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test index 75a31b224b9..2c7929e15b2 100644 --- a/mysql-test/suite/galera/t/galera_sequences.test +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_sequence.inc # # MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster @@ -283,8 +284,11 @@ CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; ALTER TABLE t ENGINE=MYISAM; --error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 1 CACHE=10; +--error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 1 NOCACHE; +--error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 0 NOCACHE; +--error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 0 CACHE=10; DROP SEQUENCE t; diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test index 3b4b427f551..fadc94d78ff 100644 --- a/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test +++ b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test @@ -54,11 +54,15 @@ INSERT INTO parent VALUES (1, 0); --connection node_2a --reap -# -# ALTER TABLE could bf kill one or more of INSERTs to parent, so -# the actual number of rows in PARENT depends on whether -# the INSERT is committed before ALTER TABLE is executed -# +--connection node_1 +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) FROM parent; +SELECT COUNT(*) FROM child; + +--connection node_2 +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) FROM parent; +SELECT COUNT(*) FROM child; DROP TABLE child; DROP TABLE parent; diff --git a/mysql-test/suite/galera/t/galera_var_reject_queries.test b/mysql-test/suite/galera/t/galera_var_reject_queries.test index 60aabe9bc17..6584eb1f736 100644 --- a/mysql-test/suite/galera/t/galera_var_reject_queries.test +++ b/mysql-test/suite/galera/t/galera_var_reject_queries.test @@ -22,11 +22,11 @@ SELECT * FROM t1; # Original behavior was lost connection, # but since 10.1, we allow controlling connection to remain alive # ---error 0,2013 +--error 0,2013,2026 SET GLOBAL wsrep_reject_queries = ALL_KILL; --connection node_1a ---error ER_CONNECTION_KILLED,2013,2006 +--error ER_CONNECTION_KILLED,2013,2006,2026 SELECT * FROM t1; --connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test index c58eba1410e..8009fe88c65 100644 --- a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test +++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test @@ -64,6 +64,7 @@ SELECT COUNT(*) FROM t1; SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue'; --connection node_1 +--error 0,ER_LOCK_DEADLOCK --reap SELECT COUNT(*) FROM t1; diff --git a/mysql-test/suite/galera/t/galera_wan.cnf b/mysql-test/suite/galera/t/galera_wan.cnf index df1d55928dc..5f86e1cb61e 100644 --- a/mysql-test/suite/galera/t/galera_wan.cnf +++ b/mysql-test/suite/galera/t/galera_wan.cnf @@ -14,4 +14,3 @@ wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;gmcast. [mysqld.4] wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M;gmcast.segment=3' - diff --git a/mysql-test/suite/galera/t/galera_wan.test b/mysql-test/suite/galera/t/galera_wan.test index ab2346ebe94..d148569d2cc 100644 --- a/mysql-test/suite/galera/t/galera_wan.test +++ b/mysql-test/suite/galera/t/galera_wan.test @@ -10,10 +10,10 @@ --source include/have_innodb.inc --source include/force_restart.inc -CALL mtr.add_suppression("WSREP: Stray state UUID msg:"); -CALL mtr.add_suppression("Sending JOIN failed: "); -CALL mtr.add_suppression("WSREP: .* sending install message failed: Socket is not connected"); -CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); +CALL mtr.add_suppression("WSREP: Stray state UUID msg: "); +CALL mtr.add_suppression("WSREP: .*Sending JOIN failed: "); +CALL mtr.add_suppression("WSREP: .*sending install message failed: Socket is not connected"); +CALL mtr.add_suppression("WSREP: .*There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); --let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --source include/wait_condition.inc @@ -42,8 +42,8 @@ SELECT VARIABLE_VALUE LIKE '%gmcast.segment = 3%' FROM INFORMATION_SCHEMA.GLOBAL DROP TABLE t1; --connection node_1 -call mtr.add_suppression("WSREP: read_completion_condition.*"); -call mtr.add_suppression("WSREP: read_handler.*"); +call mtr.add_suppression("WSREP: read_completion_condition"); +call mtr.add_suppression("WSREP: read_handler"); --disconnect node_3 --disconnect node_4 diff --git a/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf b/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf index 0a230f5324f..941ce694f0b 100644 --- a/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf +++ b/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf @@ -14,4 +14,3 @@ wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2' [mysqld.4] wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2' - diff --git a/mysql-test/suite/galera/t/galera_wan_restart_sst.test b/mysql-test/suite/galera/t/galera_wan_restart_sst.test index 8485c0db2a7..eca59bd9165 100644 --- a/mysql-test/suite/galera/t/galera_wan_restart_sst.test +++ b/mysql-test/suite/galera/t/galera_wan_restart_sst.test @@ -29,7 +29,7 @@ SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --connection node_1 -CREATE TABLE t1 (f1 INTEGER); +CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=INNODB; INSERT INTO t1 VALUES (1); --connection node_2 @@ -47,10 +47,20 @@ INSERT INTO t1 VALUES (4); --connection node_3 INSERT INTO t1 VALUES (13); - ---source include/kill_galera.inc +--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; +--source include/wait_condition.inc --connection node_1 +--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; +--source include/wait_condition.inc + +--connection node_3 +--source include/kill_galera.inc +--remove_file $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc INSERT INTO t1 VALUES (11); --connection node_2 @@ -64,6 +74,10 @@ INSERT INTO t1 VALUES (14); INSERT INTO t1 VALUES (131); +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + # # Restart node #2 # @@ -71,9 +85,17 @@ INSERT INTO t1 VALUES (131); --connection node_2 INSERT INTO t1 VALUES (22); +--connection node_1 +--let $wait_condition = SELECT COUNT(*) = 10 FROM t1; +--source include/wait_condition.inc + +--connection node_2 --source include/kill_galera.inc +--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat --connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc INSERT INTO t1 VALUES (21); --connection node_3 @@ -92,11 +114,21 @@ INSERT INTO t1 VALUES (221); # --connection node_4 +--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc INSERT INTO t1 VALUES (34); +--connection node_1 +--let $wait_condition = SELECT COUNT(*) = 15 FROM t1; +--source include/wait_condition.inc + +--connection node_4 --source include/kill_galera.inc +--remove_file $MYSQLTEST_VARDIR/mysqld.4/data/grastate.dat --connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc INSERT INTO t1 VALUES (31); --connection node_2 @@ -107,6 +139,7 @@ INSERT INTO t1 VALUES (33); --connection node_4 --source include/start_mysqld.inc +--remove_file $MYSQLTEST_VARDIR/mysqld.4/data/grastate.dat INSERT INTO t1 VALUES (341); diff --git a/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test index 04d78a306a8..c70dede09a3 100644 --- a/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test +++ b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test @@ -5,8 +5,8 @@ --source include/have_innodb.inc --let LOGF=$MYSQLTEST_VARDIR/log/mysqld.1.err --disable_info -call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\\.segment'"); -call mtr.add_suppression("WSREP\: Set options returned 7"); +call mtr.add_suppression("WSREP: Unknown parameter 'gmcasts\\.segment'"); +call mtr.add_suppression("WSREP: Set options returned 7"); --error ER_WRONG_ARGUMENTS SET GLOBAL wsrep_provider_options="gmcasts.segment=1"; # Search for unhandled exception message. diff --git a/mysql-test/suite/galera/t/galera_wsrep_schema_detached.test b/mysql-test/suite/galera/t/galera_wsrep_schema_detached.test index cddf4d6315a..383931539da 100644 --- a/mysql-test/suite/galera/t/galera_wsrep_schema_detached.test +++ b/mysql-test/suite/galera/t/galera_wsrep_schema_detached.test @@ -6,11 +6,22 @@ --source include/auto_increment_offset_save.inc --connection node_1 -call mtr.add_suppression("WSREP:.*"); + +call mtr.add_suppression("WSREP: async IST sender failed to serve"); +call mtr.add_suppression("WSREP: Failed to establish connection: Connection refused"); +call mtr.add_suppression("WSREP: IST failed: IST sender, failed to connect"); +call mtr.add_suppression("WSREP: .*State transfer.* failed: Protocol error"); + SET @wsrep_provider_options_orig = @@GLOBAL.wsrep_provider_options; SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2'; --connection node_2 + +call mtr.add_suppression("WSREP: async IST sender failed to serve"); +call mtr.add_suppression("WSREP: Failed to establish connection: Connection refused"); +call mtr.add_suppression("WSREP: IST failed: IST sender, failed to connect"); +call mtr.add_suppression("WSREP: .*State transfer.* failed: Protocol error"); + SET @wsrep_cluster_address_orig = @@GLOBAL.wsrep_cluster_address; SET GLOBAL WSREP_ON=0; SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; diff --git a/mysql-test/suite/galera/t/mysql-wsrep#198.test b/mysql-test/suite/galera/t/mysql-wsrep#198.test index 2c89f859328..aba05ed8bf9 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#198.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#198.test @@ -39,3 +39,8 @@ UNLOCK TABLES; DROP TABLE t1; DROP TABLE t2; + +--connection node_1 + +--disconnect node_2a +--disconnect node_2b diff --git a/mysql-test/suite/galera/t/mysql_tzinfo_to_sql.test b/mysql-test/suite/galera/t/mysql_tzinfo_to_sql.test index 6bfad2f18b5..4ee07044c3d 100644 --- a/mysql-test/suite/galera/t/mysql_tzinfo_to_sql.test +++ b/mysql-test/suite/galera/t/mysql_tzinfo_to_sql.test @@ -9,6 +9,7 @@ --echo # MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases --echo # +--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo --exec mkdir $MYSQLTEST_VARDIR/zoneinfo --exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix --copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT diff --git a/mysql-test/suite/galera/t/wsrep_strict_ddl.test b/mysql-test/suite/galera/t/wsrep_strict_ddl.test index c0a0cd756ba..ecec23b8fa7 100644 --- a/mysql-test/suite/galera/t/wsrep_strict_ddl.test +++ b/mysql-test/suite/galera/t/wsrep_strict_ddl.test @@ -1,4 +1,5 @@ --source include/galera_cluster.inc +--source include/have_aria.inc call mtr.add_suppression("WSREP: ALTER TABLE isolation failure"); diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index bb9d7cbd7b8..6fbfda9a07f 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -11,4 +11,3 @@ ############################################################################## galera_2_cluster : MDEV-32631 galera_2_cluster: before_rollback(): Assertion `0' failed -galera_nbo_master_phase_two_crash : MENT-2215 Test failure on galera_3nodes.galera_nbo_master_non_prim_failure diff --git a/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result index e966a36fb79..f6468910992 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result +++ b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result @@ -47,7 +47,7 @@ CALL mtr.add_suppression("Plugin 'wsrep' init function returned error\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a STORAGE ENGINE failed\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a FUNCTION failed\\."); CALL mtr.add_suppression("Failed to initialize plugins\\."); -CALL mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\)"); +CALL mtr.add_suppression("WSREP: gcs/src/gcs_core\\.cpp:core_handle_uuid_msg\\(\\)"); connection node_3; CALL mtr.add_suppression("WSREP: no nodes coming from prim view, prim not possible"); CALL mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster from this node"); @@ -61,7 +61,7 @@ CALL mtr.add_suppression("Plugin 'wsrep' init function returned error\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a STORAGE ENGINE failed\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a FUNCTION failed\\."); CALL mtr.add_suppression("Failed to initialize plugins\\."); -CALL mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\)"); +CALL mtr.add_suppression("WSREP: gcs/src/gcs_core\\.cpp:core_handle_uuid_msg\\(\\)"); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test index 8fc9e492342..e59fcfb2100 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test @@ -11,8 +11,8 @@ --source include/have_innodb.inc --connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5 - --connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 + --connection node_4 --replace_result $NODE_MYPORT_1 NODE_MYPORT_1 diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf index bc64d114275..dc4f414d2c4 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf @@ -3,6 +3,7 @@ # following tests such as galera_3nodes.galera_var_dirty_reads2 !include ../galera_2x3nodes.cnf + [mysqld.1] wsrep_gtid_domain_id=1 server-id=11 diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test index 0e0112f86c7..12399840896 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test @@ -20,7 +20,6 @@ call mtr.add_suppression("Failed to load slave replication state from table mysq CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; ---let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth` SET GLOBAL wsrep_sst_auth = 'sst:'; --connection node_2 diff --git a/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test index eb41137b8b3..71ca82be1d5 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test +++ b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test @@ -195,7 +195,7 @@ CALL mtr.add_suppression("Plugin 'wsrep' init function returned error\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a STORAGE ENGINE failed\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a FUNCTION failed\\."); CALL mtr.add_suppression("Failed to initialize plugins\\."); -CALL mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\)"); +CALL mtr.add_suppression("WSREP: gcs/src/gcs_core\\.cpp:core_handle_uuid_msg\\(\\)"); --connection node_3 CALL mtr.add_suppression("WSREP: no nodes coming from prim view, prim not possible"); @@ -210,7 +210,7 @@ CALL mtr.add_suppression("Plugin 'wsrep' init function returned error\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a STORAGE ENGINE failed\\."); CALL mtr.add_suppression("Plugin 'wsrep' registration as a FUNCTION failed\\."); CALL mtr.add_suppression("Failed to initialize plugins\\."); -CALL mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg\\(\\)"); +CALL mtr.add_suppression("WSREP: gcs/src/gcs_core\\.cpp:core_handle_uuid_msg\\(\\)"); SHOW CREATE TABLE t1; diff --git a/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result b/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result index 8333fff98db..ef21e4ca347 100644 --- a/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result +++ b/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result @@ -6,20 +6,26 @@ connection node_2; connection node_3; connection node_2; SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal"; -CREATE TABLE t1 (f1 VARCHAR(30)) ENGINE=InnoDB; +CREATE TABLE t1 (f1 VARCHAR(30) not null primary key) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; SET SESSION wsrep_trx_fragment_size=1; START TRANSACTION; -INSERT INTO t1 VALUES ('primary'),('primary'),('primary'),('primary'),('primary'); +INSERT INTO t1 VALUES ('primary1'),('primary2'),('primary3'),('primary4'),('primary5'); COMMIT; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors +connection node_1; +connection node_2; # restart connection node_1; SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; COUNT(*) = 0 1 +SELECT * FROM t1; +f1 connection node_2; SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; COUNT(*) = 0 1 +SELECT * FROM t1; +f1 DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result b/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result index ef2bd7a45e1..08e3fc6c3e3 100644 --- a/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result +++ b/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result @@ -44,6 +44,7 @@ connection node_2; SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; EXPECT_0 0 +call mtr.add_suppression("WSREP: node uuid:.*"); connection node_1; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test index d18ec470c50..700b3c38b6b 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test +++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test @@ -4,6 +4,7 @@ # --source include/galera_cluster.inc --source include/have_debug_sync.inc +--source include/force_restart.inc --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 # Save original auto_increment_offset values. @@ -13,30 +14,42 @@ --source ../galera/include/auto_increment_offset_save.inc --connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal"; --let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --write_line wait $_expect_file_name -CREATE TABLE t1 (f1 VARCHAR(30)) ENGINE=InnoDB; +CREATE TABLE t1 (f1 VARCHAR(30) not null primary key) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; SET SESSION wsrep_trx_fragment_size=1; START TRANSACTION; -INSERT INTO t1 VALUES ('primary'),('primary'),('primary'),('primary'),('primary'); ---error 2013 +INSERT INTO t1 VALUES ('primary1'),('primary2'),('primary3'),('primary4'),('primary5'); +--error 2013,2026 COMMIT; +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_2 --source include/start_mysqld.inc --connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +SELECT * FROM t1; --connection node_2 --enable_reconnect SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test index 355db2de456..58d744e704d 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test +++ b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test @@ -6,6 +6,7 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/force_restart.inc --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 # Save original auto_increment_offset values. @@ -86,6 +87,8 @@ SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; --connection node_2 SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +# As noted above sometimes node delivers the same view twice +call mtr.add_suppression("WSREP: node uuid:.*"); --connection node_1 DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/disabled.def b/mysql-test/suite/galera_sr/disabled.def index 0371f0f589f..fcaf38a3d7b 100644 --- a/mysql-test/suite/galera_sr/disabled.def +++ b/mysql-test/suite/galera_sr/disabled.def @@ -9,5 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## - -GCF-1060 : MDEV-32160 GCF-1060 test failure due to wsrep MDL conflict diff --git a/mysql-test/suite/galera_sr/r/GCF-572.result b/mysql-test/suite/galera_sr/r/GCF-572.result index 41ae2378a3f..8bffe4fcc25 100644 --- a/mysql-test/suite/galera_sr/r/GCF-572.result +++ b/mysql-test/suite/galera_sr/r/GCF-572.result @@ -37,8 +37,9 @@ f1 f2 SET SESSION wsrep_trx_fragment_size = 10000; START TRANSACTION; INSERT INTO t1 VALUE (10, 'node1'); -SELECT * FROM mysql.wsrep_streaming_log; -node_uuid trx_id seqno flags frag +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 connection node_1a; INSERT INTO t1 VALUES(15, 'node2'); connection node_1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-18585.result b/mysql-test/suite/galera_sr/r/MDEV-18585.result index d30def1ea63..35a1e8d1d11 100644 --- a/mysql-test/suite/galera_sr/r/MDEV-18585.result +++ b/mysql-test/suite/galera_sr/r/MDEV-18585.result @@ -14,23 +14,23 @@ SET SESSION wsrep_trx_fragment_unit=default; SET SESSION wsrep_trx_fragment_size=default; SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 518; Log_name Pos Event_type Server_id End_log_pos Info -mysqld-bin.000002 518 Gtid 1 560 BEGIN GTID 0-1-2 -mysqld-bin.000002 560 Annotate_rows 1 613 INSERT INTO t1 VALUES (1), (2) -mysqld-bin.000002 613 Table_map 1 658 table_id: # (test.t1) -mysqld-bin.000002 658 Write_rows_v1 1 696 table_id: # flags: STMT_END_F -mysqld-bin.000002 696 Table_map 1 741 table_id: # (test.t1) -mysqld-bin.000002 741 Write_rows_v1 1 779 table_id: # flags: STMT_END_F -mysqld-bin.000002 779 Xid 1 810 COMMIT /* xid=# */ -mysqld-bin.000002 810 Gtid 1 852 BEGIN GTID 0-1-3 -mysqld-bin.000002 852 Annotate_rows 1 905 INSERT INTO t1 VALUES (3), (4) -mysqld-bin.000002 905 Table_map 1 950 table_id: # (test.t1) -mysqld-bin.000002 950 Write_rows_v1 1 988 table_id: # flags: STMT_END_F -mysqld-bin.000002 988 Table_map 1 1033 table_id: # (test.t1) -mysqld-bin.000002 1033 Write_rows_v1 1 1071 table_id: # flags: STMT_END_F -mysqld-bin.000002 1071 Xid 1 1102 COMMIT /* xid=# */ -mysqld-bin.000002 1102 Gtid 1 1144 BEGIN GTID 0-1-4 -mysqld-bin.000002 1144 Annotate_rows 1 1197 INSERT INTO t1 VALUES (5), (6) -mysqld-bin.000002 1197 Table_map 1 1242 table_id: # (test.t1) -mysqld-bin.000002 1242 Write_rows_v1 1 1285 table_id: # flags: STMT_END_F -mysqld-bin.000002 1285 Xid 1 1316 COMMIT /* xid=# */ +mysqld-bin.000002 # Gtid 1 # BEGIN GTID 0-1-2 +mysqld-bin.000002 # Annotate_rows 1 # INSERT INTO t1 VALUES (1), (2) +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Xid 1 # COMMIT /* xid=# */ +mysqld-bin.000002 # Gtid 1 # BEGIN GTID 0-1-3 +mysqld-bin.000002 # Annotate_rows 1 # INSERT INTO t1 VALUES (3), (4) +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Xid 1 # COMMIT /* xid=# */ +mysqld-bin.000002 # Gtid 1 # BEGIN GTID 0-1-4 +mysqld-bin.000002 # Annotate_rows 1 # INSERT INTO t1 VALUES (5), (6) +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Xid 1 # COMMIT /* xid=# */ DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-27615.result b/mysql-test/suite/galera_sr/r/MDEV-27615.result index a3475811285..8965cc8e99e 100644 --- a/mysql-test/suite/galera_sr/r/MDEV-27615.result +++ b/mysql-test/suite/galera_sr/r/MDEV-27615.result @@ -15,7 +15,7 @@ SET DEBUG_SYNC='now WAIT_FOR before_fragment'; SET GLOBAL wsrep_cluster_address = ''; SET DEBUG_SYNC = 'now SIGNAL continue'; connection node_2; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_2a; SELECT * FROM mysql.wsrep_streaming_log; node_uuid trx_id seqno flags frag diff --git a/mysql-test/suite/galera_sr/r/MENT-2042.result b/mysql-test/suite/galera_sr/r/MENT-2042.result new file mode 100644 index 00000000000..a2b63cc6fa6 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MENT-2042.result @@ -0,0 +1,24 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET DEBUG_SYNC='trans_xa_commit_after_acquire_commit_lock SIGNAL before_commit WAIT_FOR continue'; +XA START 'a'; +INSERT INTO t1 VALUES(1); +XA END 'a'; +XA PREPARE 'a'; +XA COMMIT 'a';; +connection node_1a; +SET DEBUG_SYNC='now WAIT_FOR before_commit'; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1; +ERROR 70100: Query execution was interrupted +Expect transaction 'a' in prepared state +XA RECOVER; +formatID gtrid_length bqual_length data +1 1 0 a +XA ROLLBACK 'a'; +DROP TABLE t1; +SET DEBUG_SYNC = 'RESET'; +disconnect node_1a; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result index 5d1416d3fa7..433cfa4e459 100644 --- a/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result +++ b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result @@ -27,7 +27,7 @@ SET GLOBAL wsrep_cluster_address = ''; SET SESSION wsrep_sync_wait = DEFAULT; connection node_2; INSERT INTO t1 VALUES (6); -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors connection node_1; SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; EXPECT_0 diff --git a/mysql-test/suite/galera_sr/t/GCF-572.test b/mysql-test/suite/galera_sr/t/GCF-572.test index be77451a332..bba68c1d822 100644 --- a/mysql-test/suite/galera_sr/t/GCF-572.test +++ b/mysql-test/suite/galera_sr/t/GCF-572.test @@ -61,7 +61,7 @@ SET SESSION wsrep_trx_fragment_size = 10000; START TRANSACTION; INSERT INTO t1 VALUE (10, 'node1'); -SELECT * FROM mysql.wsrep_streaming_log; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; --connection node_1a INSERT INTO t1 VALUES(15, 'node2'); diff --git a/mysql-test/suite/galera_sr/t/MDEV-18585.test b/mysql-test/suite/galera_sr/t/MDEV-18585.test index 18bbbe8f7e0..7535b524a6d 100644 --- a/mysql-test/suite/galera_sr/t/MDEV-18585.test +++ b/mysql-test/suite/galera_sr/t/MDEV-18585.test @@ -12,6 +12,8 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY); SET SESSION wsrep_trx_fragment_unit='ROWS'; SET SESSION wsrep_trx_fragment_size=1; +--let $start_pos= query_get_value(SHOW MASTER STATUS, Position, 1) + INSERT INTO t1 VALUES (1), (2); # @@ -37,6 +39,7 @@ SET SESSION wsrep_trx_fragment_unit=default; SET SESSION wsrep_trx_fragment_size=default; --replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 518; +--replace_column 2 # 5 # +--eval SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM $start_pos DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/t/MDEV-27615.test b/mysql-test/suite/galera_sr/t/MDEV-27615.test index 121a85fb20c..8cc425aa7e1 100644 --- a/mysql-test/suite/galera_sr/t/MDEV-27615.test +++ b/mysql-test/suite/galera_sr/t/MDEV-27615.test @@ -43,7 +43,8 @@ SET DEBUG_SYNC = 'now SIGNAL continue'; # Disconnect causes connection to node_2 to be closed # --connection node_2 ---error 2013 # CR_SERVER_LOST +# CR_SERVER_LOST, CR_SSL_CONNECTION_ERROR +--error 2013,2026 --reap diff --git a/mysql-test/suite/galera_sr/t/MDEV-28971.test b/mysql-test/suite/galera_sr/t/MDEV-28971.test index 81238f94b4a..8fdcf4aa780 100644 --- a/mysql-test/suite/galera_sr/t/MDEV-28971.test +++ b/mysql-test/suite/galera_sr/t/MDEV-28971.test @@ -4,6 +4,7 @@ # --source include/galera_cluster.inc +--source include/have_sequence.inc CREATE SEQUENCE SEQ NOCACHE ENGINE=InnoDB; SET SESSION wsrep_trx_fragment_size=1; diff --git a/mysql-test/suite/galera_sr/t/MENT-2042.test b/mysql-test/suite/galera_sr/t/MENT-2042.test new file mode 100644 index 00000000000..34e8ee45551 --- /dev/null +++ b/mysql-test/suite/galera_sr/t/MENT-2042.test @@ -0,0 +1,54 @@ +# +# MENT-2042 Assertion `bf_aborted()' failed in wsrep::transaction::xa_replay_common() +# + +--source include/galera_cluster.inc +--source include/have_debug_sync.inc + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 + +--connection node_1 +--let connection_id = `SELECT CONNECTION_ID()` + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); + +# +# Execute XA transaction up to COMMIT +# + +SET DEBUG_SYNC='trans_xa_commit_after_acquire_commit_lock SIGNAL before_commit WAIT_FOR continue'; +XA START 'a'; +INSERT INTO t1 VALUES(1); +XA END 'a'; +XA PREPARE 'a'; +--send XA COMMIT 'a'; + +# +# Kill the XA COMMIT statement. If bug is present the +# assertion fires. +# +--connection node_1a +SET DEBUG_SYNC='now WAIT_FOR before_commit'; +--disable_query_log +--eval KILL QUERY $connection_id +--enable_query_log +SET DEBUG_SYNC = 'now SIGNAL continue'; + +# +# Expect that the query is interrupted, and the transaction +# is still in prepared state +# +--connection node_1 +--error ER_QUERY_INTERRUPTED +--reap + +--echo Expect transaction 'a' in prepared state +XA RECOVER; + +# +# Cleanup +# +XA ROLLBACK 'a'; +DROP TABLE t1; +SET DEBUG_SYNC = 'RESET'; +--disconnect node_1a diff --git a/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test b/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test index 25cd8f3005b..563f115ecf1 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test +++ b/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test @@ -51,7 +51,7 @@ SET GLOBAL wsrep_cluster_address = ''; SET SESSION wsrep_sync_wait = DEFAULT; --connection node_2 ---error 2013 # CR_SERVER_LOST +--error 2013,2026 INSERT INTO t1 VALUES (6); --connection node_1 diff --git a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test index 50378b2a9bd..9df4392375a 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test +++ b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test @@ -85,4 +85,3 @@ SET SESSION wsrep_trx_fragment_size=0; # Restore original auto_increment_offset values. --source ../galera/include/auto_increment_offset_restore.inc - diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.test b/mysql-test/suite/wsrep/t/pool_of_threads.test index 8e95d0ca495..f035236da0e 100644 --- a/mysql-test/suite/wsrep/t/pool_of_threads.test +++ b/mysql-test/suite/wsrep/t/pool_of_threads.test @@ -1,3 +1,4 @@ +--source include/have_innodb.inc --source include/have_wsrep_enabled.inc --source include/have_binlog_format_row.inc diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test index 3f3363d8f26..762d783a09c 100644 --- a/mysql-test/suite/wsrep/t/variables.test +++ b/mysql-test/suite/wsrep/t/variables.test @@ -23,4 +23,3 @@ SHOW STATUS LIKE 'wsrep_thread_count'; --echo # variables SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; - diff --git a/mysql-test/suite/wsrep/t/variables_debug.test b/mysql-test/suite/wsrep/t/variables_debug.test index 4d0de10ed0a..e55dbd4fa1f 100644 --- a/mysql-test/suite/wsrep/t/variables_debug.test +++ b/mysql-test/suite/wsrep/t/variables_debug.test @@ -8,7 +8,7 @@ --let $galera_version=26.4.21 source include/check_galera_version.inc; -source include/galera_variables_ok.inc; +source include/galera_variables_ok_debug.inc; --replace_column 2 # SHOW GLOBAL STATUS LIKE 'wsrep%'; @@ -25,4 +25,3 @@ SHOW STATUS LIKE 'wsrep_thread_count'; --echo # variables SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; - From 96040fbd5314bd7942933472f06d64f983248a90 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Sat, 25 Jan 2025 17:16:13 +0100 Subject: [PATCH 10/65] galera: correction for MENT-2042 test Removed major part of test because XA transactions are not supported in galera on 10.5 branch. --- mysql-test/suite/galera_sr/r/MENT-2042.result | 17 +--------- mysql-test/suite/galera_sr/t/MENT-2042.test | 33 +------------------ 2 files changed, 2 insertions(+), 48 deletions(-) diff --git a/mysql-test/suite/galera_sr/r/MENT-2042.result b/mysql-test/suite/galera_sr/r/MENT-2042.result index a2b63cc6fa6..297ad808356 100644 --- a/mysql-test/suite/galera_sr/r/MENT-2042.result +++ b/mysql-test/suite/galera_sr/r/MENT-2042.result @@ -3,22 +3,7 @@ connection node_1; connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); -SET DEBUG_SYNC='trans_xa_commit_after_acquire_commit_lock SIGNAL before_commit WAIT_FOR continue'; XA START 'a'; -INSERT INTO t1 VALUES(1); -XA END 'a'; -XA PREPARE 'a'; -XA COMMIT 'a';; -connection node_1a; -SET DEBUG_SYNC='now WAIT_FOR before_commit'; -SET DEBUG_SYNC = 'now SIGNAL continue'; -connection node_1; -ERROR 70100: Query execution was interrupted -Expect transaction 'a' in prepared state -XA RECOVER; -formatID gtrid_length bqual_length data -1 1 0 a -XA ROLLBACK 'a'; +ERROR 42000: This version of MariaDB doesn't yet support 'XA transactions with Galera replication' DROP TABLE t1; -SET DEBUG_SYNC = 'RESET'; disconnect node_1a; diff --git a/mysql-test/suite/galera_sr/t/MENT-2042.test b/mysql-test/suite/galera_sr/t/MENT-2042.test index 34e8ee45551..fc047ba33ef 100644 --- a/mysql-test/suite/galera_sr/t/MENT-2042.test +++ b/mysql-test/suite/galera_sr/t/MENT-2042.test @@ -16,39 +16,8 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); # Execute XA transaction up to COMMIT # -SET DEBUG_SYNC='trans_xa_commit_after_acquire_commit_lock SIGNAL before_commit WAIT_FOR continue'; +--error ER_NOT_SUPPORTED_YET XA START 'a'; -INSERT INTO t1 VALUES(1); -XA END 'a'; -XA PREPARE 'a'; ---send XA COMMIT 'a'; -# -# Kill the XA COMMIT statement. If bug is present the -# assertion fires. -# ---connection node_1a -SET DEBUG_SYNC='now WAIT_FOR before_commit'; ---disable_query_log ---eval KILL QUERY $connection_id ---enable_query_log -SET DEBUG_SYNC = 'now SIGNAL continue'; - -# -# Expect that the query is interrupted, and the transaction -# is still in prepared state -# ---connection node_1 ---error ER_QUERY_INTERRUPTED ---reap - ---echo Expect transaction 'a' in prepared state -XA RECOVER; - -# -# Cleanup -# -XA ROLLBACK 'a'; DROP TABLE t1; -SET DEBUG_SYNC = 'RESET'; --disconnect node_1a From a7e59c8a5497a3600c93a7013d6d66e6ad328714 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Mon, 27 Jan 2025 14:35:14 +0100 Subject: [PATCH 11/65] galera mtr tests: remove unused .result file --- .../r/galera_bf_abort_group_commit.result | 685 ------------------ 1 file changed, 685 deletions(-) delete mode 100644 mysql-test/suite/galera/r/galera_bf_abort_group_commit.result diff --git a/mysql-test/suite/galera/r/galera_bf_abort_group_commit.result b/mysql-test/suite/galera/r/galera_bf_abort_group_commit.result deleted file mode 100644 index 2a2ddd519f4..00000000000 --- a/mysql-test/suite/galera/r/galera_bf_abort_group_commit.result +++ /dev/null @@ -1,685 +0,0 @@ -SET SESSION wsrep_sync_wait = 0; -galera_sr_bf_abort_at_commit = 0 -after_replicate_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync'; -INSERT INTO t1 VALUES (3); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync'; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -local_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync'; -INSERT INTO t1 VALUES (3); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync'; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -apply_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_master_enter_sync'; -INSERT INTO t1 VALUES (3); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_master_enter_sync'; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -commit_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; -INSERT INTO t1 VALUES (3); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -galera_sr_bf_abort_at_commit = 1 -after_replicate_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -local_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -apply_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_master_enter_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_master_enter_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -commit_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 1; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -galera_sr_bf_abort_at_commit = 1 -after_replicate_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 0; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -local_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 0; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -apply_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 0; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_master_enter_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_master_enter_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -commit_monitor_master_enter_sync -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -SET SESSION wsrep_trx_fragment_size = 0; -SET AUTOCOMMIT=OFF; -INSERT INTO t1 VALUES (1); -SELECT * FROM t1 FOR UPDATE; -f1 -1 -SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; -SET AUTOCOMMIT=ON; -INSERT INTO t1 VALUES (2); -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; -COMMIT; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; -SET SESSION wsrep_on = 0; -SET SESSION wsrep_on = 1; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; -ROLLBACK; -SET GLOBAL wsrep_provider_options = 'dbug='; -SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT * FROM t1; -f1 -1 -2 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; -COUNT(*) = 0 -1 -SET AUTOCOMMIT=ON; -SET SESSION wsrep_trx_fragment_size = 0; -DELETE FROM t1; -DROP TABLE t1; -CALL mtr.add_suppression("WSREP: fragment replication failed: 1"); From a382b695d2383ee304695dff0bc239569cd978db Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Mon, 27 Jan 2025 16:08:58 +0100 Subject: [PATCH 12/65] galera: disable problematic test (galera_vote_rejoin_ddl) --- mysql-test/suite/galera/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 80dc730250b..5f67258bf26 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -12,5 +12,6 @@ galera_sequences : MDEV-35934/MDEV-33850 For Galera, create sequence with low cache got signal 6 error: [ERROR] WSREP: FSM: no such a transition REPLICATING -> COMMITTED galera_wan : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan +galera_vote_rejoin_ddl : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan galera_bf_abort_lock_table : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock mysql-wsrep#198 : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock From 1456d9ea0a646c37237571df4abd9010cbb441c5 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 28 Jan 2025 03:43:41 +0100 Subject: [PATCH 13/65] galera: disable problematic test (MW-329) --- mysql-test/suite/galera/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 5f67258bf26..250cedced07 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -15,3 +15,4 @@ galera_wan : MDEV-35940 Unallowed state transition: donor -> synced in galera_wa galera_vote_rejoin_ddl : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan galera_bf_abort_lock_table : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock mysql-wsrep#198 : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock +MW-329 : MDEV-35951 Complete freeze during MW-329 test From eb1811c2ce007e380010b4c38bfa5c3f5b8ace5f Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Wed, 29 Jan 2025 01:49:44 +0100 Subject: [PATCH 14/65] galera: disable problematic test (galera_vote_rejoin_dml) --- mysql-test/suite/galera/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 250cedced07..72caea32867 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -16,3 +16,4 @@ galera_vote_rejoin_ddl : MDEV-35940 Unallowed state transition: donor -> synced galera_bf_abort_lock_table : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock mysql-wsrep#198 : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock MW-329 : MDEV-35951 Complete freeze during MW-329 test +galera_vote_rejoin_dml : MDEV-35964 Assertion `ist_seqno >= cc_seqno' failed in galera_vote_rejoin_dml From dd5dc92a198a128c7ee306366d29bebbd362131d Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 28 Jan 2025 03:29:16 +0100 Subject: [PATCH 15/65] galera_sequences test: post-fix after MDEV-33245 --- mysql-test/suite/galera/r/galera_sequences.result | 5 +---- mysql-test/suite/galera/t/galera_sequences.test | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result index b262ab6d1be..1f6b2bd6637 100644 --- a/mysql-test/suite/galera/r/galera_sequences.result +++ b/mysql-test/suite/galera/r/galera_sequences.result @@ -249,13 +249,10 @@ CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; ALTER TABLE t ENGINE=MYISAM; ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' ALTER SEQUENCE t INCREMENT BY 1 CACHE=10; -ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' +ERROR 42000: This version of MariaDB doesn't yet support 'CACHE without INCREMENT BY 0 in Galera cluster' ALTER SEQUENCE t INCREMENT BY 1 NOCACHE; -ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' ALTER SEQUENCE t INCREMENT BY 0 NOCACHE; -ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' ALTER SEQUENCE t INCREMENT BY 0 CACHE=10; -ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster' DROP SEQUENCE t; CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test index 2c7929e15b2..f99796264b6 100644 --- a/mysql-test/suite/galera/t/galera_sequences.test +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -284,11 +284,8 @@ CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; ALTER TABLE t ENGINE=MYISAM; --error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 1 CACHE=10; ---error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 1 NOCACHE; ---error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 0 NOCACHE; ---error ER_NOT_SUPPORTED_YET ALTER SEQUENCE t INCREMENT BY 0 CACHE=10; DROP SEQUENCE t; From 1b146e8220fc6cae845502e656959ffc48fbdd1d Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Sun, 26 Feb 2023 12:44:49 +0200 Subject: [PATCH 16/65] galera fix: Donor in non-Primary causes assertion in wsrep-lib Constructed a test which makes donor to go into non-Primary configuration before `sst_sent()` is called, causing an assertion in wsrep-lib if the bug is present. Updated wsrep-lib to version which contains the fix. Signed-off-by: Julius Goryavsky --- .../suite/galera_3nodes/galera_3nodes.cnf | 3 + .../r/galera_sst_donor_non_prim.result | 26 ++++++++ .../t/galera_sst_donor_non_prim.cnf | 4 ++ .../t/galera_sst_donor_non_prim.test | 64 +++++++++++++++++++ sql/wsrep_sst.cc | 9 +++ 5 files changed, 106 insertions(+) create mode 100644 mysql-test/suite/galera_3nodes/r/galera_sst_donor_non_prim.result create mode 100644 mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.cnf create mode 100644 mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.test diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf index f23e1c65008..12ddc8621d1 100644 --- a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf +++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf @@ -23,6 +23,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#gale wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' +wsrep_node_name=node1 [mysqld.2] wsrep-on=1 @@ -34,6 +35,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#gale wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' +wsrep_node_name=node2 [mysqld.3] wsrep-on=1 @@ -45,6 +47,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#gale wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port' +wsrep_node_name=node3 [sst] sst-log-archive-dir=@ENV.MYSQLTEST_VARDIR/log diff --git a/mysql-test/suite/galera_3nodes/r/galera_sst_donor_non_prim.result b/mysql-test/suite/galera_3nodes/r/galera_sst_donor_non_prim.result new file mode 100644 index 00000000000..6f372463b15 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_sst_donor_non_prim.result @@ -0,0 +1,26 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_3; +connection node_2; +connection node_1; +SET GLOBAL debug_dbug = '+d,sync.wsrep_sst_donor_after_donation'; +connection node_2; +# restart +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR sync.wsrep_sst_donor_after_donation_reached'; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; +SET SESSION wsrep_sync_wait=0; +SET DEBUG_SYNC = 'now SIGNAL signal.wsrep_sst_donor_after_donation_continue'; +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL debug_dbug = ''; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; +SET SESSION wsrep_sync_wait=15; +connection node_1; +connection node_2; +connection node_3; +connection node_1; +connection node_1; +CALL mtr.add_suppression("WSREP: sst sent called when not SST donor, state CONNECTED"); +CALL mtr.add_suppression("WSREP: .* returned an error: Not connected to Primary Component"); diff --git a/mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.cnf b/mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.cnf new file mode 100644 index 00000000000..ecb568672fe --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.cnf @@ -0,0 +1,4 @@ +!include ../galera_3nodes.cnf + +[mysqld.2] +wsrep_sst_donor=node1 diff --git a/mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.test b/mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.test new file mode 100644 index 00000000000..22c4f75b601 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_sst_donor_non_prim.test @@ -0,0 +1,64 @@ +# +# Construct a situation where Donor node partitions in the +# middle of SST. The Donor should stay in non-Primary state instead of +# crashing in assertion in wsrep-lib. +# +# In the test, node_2 is restarted and node_1 configured to be +# the donor. Node_1 execution is stopped before sst_sent() is +# called and node_1 is made to partition from the cluster. +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/big_test.inc + +--let $galera_connection_name = node_3 +--let $galera_server_number = 3 +--source include/galera_connect.inc + +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--source ../galera/include/auto_increment_offset_save.inc + +--connection node_2 +--source include/shutdown_mysqld.inc +--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat + +--connection node_1 +SET GLOBAL debug_dbug = '+d,sync.wsrep_sst_donor_after_donation'; + +--connection node_2 +--source include/start_mysqld.inc + +--connection node_1 +SET DEBUG_SYNC = 'now WAIT_FOR sync.wsrep_sst_donor_after_donation_reached'; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; +SET SESSION wsrep_sync_wait=0; +--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM information_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status' +--source include/wait_condition.inc + +SET DEBUG_SYNC = 'now SIGNAL signal.wsrep_sst_donor_after_donation_continue'; +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL debug_dbug = ''; + +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; +SET SESSION wsrep_sync_wait=15; + +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM information_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--connection node_1 +--source include/wait_condition.inc +--connection node_2 +--source include/wait_condition.inc +--connection node_3 + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM information_schema.global_status WHERE VARIABLE_NAME = 'wsrep_ready' +--source include/wait_condition.inc + +--source ../galera/include/auto_increment_offset_restore.inc + +--connection node_1 +CALL mtr.add_suppression("WSREP: sst sent called when not SST donor, state CONNECTED"); +CALL mtr.add_suppression("WSREP: .* returned an error: Not connected to Primary Component"); diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index cb2d61b7543..504510fbbf6 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -1874,6 +1874,15 @@ wait_signal: wsrep::seqno(err ? wsrep::seqno::undefined() : wsrep::seqno(ret_seqno))); +#ifdef ENABLED_DEBUG_SYNC + DBUG_EXECUTE_IF("sync.wsrep_sst_donor_after_donation", { + const char act[]= "now " + "SIGNAL sync.wsrep_sst_donor_after_donation_reached " + "WAIT_FOR signal.wsrep_sst_donor_after_donation_continue"; + DBUG_ASSERT(!debug_sync_set_action(thd.ptr, STRING_WITH_LEN(act))); + }); +#endif /* ENABLED_DEBUG_SYNC */ + Wsrep_server_state::instance().sst_sent(gtid, err); proc.wait(); From c35b6f133aa8c7c88d14a13593ac2a57d51aa137 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 28 Jan 2025 20:47:38 +0100 Subject: [PATCH 17/65] galera mtr tests: synchronization between editions/branches (10.5) --- mysql-test/suite/galera/r/MW-416.result | 5 +- .../suite/galera/r/galera_bf_kill,debug.rdiff | 4 +- .../r/galera_ist_MDEV-28423,debug.rdiff | 2 +- .../r/galera_ist_MDEV-28583,debug.rdiff | 2 +- .../r/galera_ist_mariabackup,debug.rdiff | 4 +- ..._mariabackup_innodb_flush_logs,debug.rdiff | 4 +- .../galera/r/galera_ist_mysqldump,debug.rdiff | 4 +- .../galera/r/galera_ist_rsync,debug.rdiff | 4 +- .../r/galera_sst_mariabackup,debug.rdiff | 2 +- ...alera_sst_mariabackup_data_dir,debug.rdiff | 4 +- ...sst_mariabackup_force_recovery,debug.rdiff | 4 +- ...era_sst_mariabackup_logarchive,debug.rdiff | 2 +- .../galera/r/galera_sst_mysqldump,debug.rdiff | 4 +- .../galera_sst_mysqldump_with_key,debug.rdiff | 4 +- .../galera/r/galera_sst_rsync,debug.rdiff | 2 +- .../galera/r/galera_sst_rsync2,debug.rdiff | 4 +- .../r/galera_sst_rsync_data_dir,debug.rdiff | 4 +- .../r/galera_sst_rsync_recv_auto,debug.rdiff | 2 + .../suite/galera/r/mysql-wsrep#33,debug.rdiff | 4 +- mysql-test/suite/galera/suite.pm | 30 +++--- mysql-test/suite/galera/t/MW-416.test | 94 ++++++++++--------- .../r/galera-features#115.result | 41 ++++++++ .../galera_3nodes/r/galera_2_cluster.result | 1 - .../r/galera_gtid_2_cluster.result | 8 +- mysql-test/suite/galera_3nodes/suite.pm | 32 ++++--- .../galera_3nodes/t/galera-features#115.cnf | 4 + .../galera_3nodes/t/galera-features#115.test | 89 ++++++++++++++++++ .../galera_3nodes/t/galera_2_cluster.test | 3 +- .../t/galera_gtid_2_cluster.test | 16 +++- mysql-test/suite/galera_3nodes_sr/suite.pm | 22 ++--- mysql-test/suite/galera_sr/suite.pm | 30 +++--- 31 files changed, 293 insertions(+), 142 deletions(-) create mode 100644 mysql-test/suite/galera_3nodes/r/galera-features#115.result create mode 100644 mysql-test/suite/galera_3nodes/t/galera-features#115.cnf create mode 100644 mysql-test/suite/galera_3nodes/t/galera-features#115.test diff --git a/mysql-test/suite/galera/r/MW-416.result b/mysql-test/suite/galera/r/MW-416.result index 68406c4dcf4..e5f69caa413 100644 --- a/mysql-test/suite/galera/r/MW-416.result +++ b/mysql-test/suite/galera/r/MW-416.result @@ -24,13 +24,13 @@ ALTER VIEW vw AS SELECT 1; Got one of the listed errors CREATE DATABASE db; Got one of the listed errors -CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1; +CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1; Got one of the listed errors CREATE FUNCTION fun1() RETURNS int RETURN(1); Got one of the listed errors CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so'; Got one of the listed errors -CREATE PROCEDURE proc1() BEGIN END; +CREATE PROCEDURE proc1() BEGIN END; Got one of the listed errors CREATE INDEX idx ON tbl(id); Got one of the listed errors @@ -111,3 +111,4 @@ mtr mysql performance_schema test +disconnect userMW416; diff --git a/mysql-test/suite/galera/r/galera_bf_kill,debug.rdiff b/mysql-test/suite/galera/r/galera_bf_kill,debug.rdiff index e02acc3de08..098ce2b28a1 100644 --- a/mysql-test/suite/galera/r/galera_bf_kill,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_bf_kill,debug.rdiff @@ -1,5 +1,5 @@ ---- a/home/panda/mariadb-10.5/mysql-test/suite/galera/r/galera_bf_kill.result -+++ b/home/panda/mariadb-10.5/mysql-test/suite/galera/r/galera_bf_kill.reject +--- r/galera_bf_kill.result ++++ r/galera_bf_kill,debug.reject @@ -77,4 +77,34 @@ a b 5 2 disconnect node_2a; diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff index 96e5def88ff..8c84321e774 100644 --- a/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff @@ -1,5 +1,5 @@ --- r/galera_ist_MDEV-28423.result -+++ r/galera_ist_MDEV-28423.reject ++++ r/galera_ist_MDEV-28423,debug.reject @@ -517,3 +517,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff index 9e6530aa9f7..51d2a6bf157 100644 --- a/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff @@ -1,5 +1,5 @@ --- r/galera_ist_MDEV-28583.result -+++ r/galera_ist_MDEV-28583.reject ++++ r/galera_ist_MDEV-28583,debug.reject @@ -517,3 +517,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff index adf12c23e4a..243b2a50b2a 100644 --- a/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_ist_mariabackup.result 2021-04-10 14:21:16.141724901 +0300 -+++ r/galera_ist_mariabackup,debug.reject 2021-04-10 14:49:04.455785652 +0300 +--- r/galera_ist_mariabackup.result ++++ r/galera_ist_mariabackup,debug.reject @@ -517,3 +517,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff index c9457d70812..b7a91b010fe 100644 --- a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_ist_mariabackup_innodb_flush_logs.result 2021-04-10 14:21:52.661886653 +0300 -+++ r/galera_ist_mariabackup_innodb_flush_logs,debug.reject 2021-04-10 14:49:56.740062774 +0300 +--- r/galera_ist_mariabackup_innodb_flush_logs.result ++++ r/galera_ist_mariabackup_innodb_flush_logs,debug.reject @@ -172,3 +172,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff index e4e255deea2..2ba60eff7b4 100644 --- a/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_mysqldump,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_ist_mysqldump.result 2021-04-10 14:23:23.158282307 +0300 -+++ r/galera_ist_mysqldump,debug.reject 2021-04-10 15:27:13.316299695 +0300 +--- r/galera_ist_mysqldump.result ++++ r/galera_ist_mysqldump,debug.reject @@ -354,6 +354,190 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff index e76b37838fb..f3df998be95 100644 --- a/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_ist_rsync.result 2021-04-10 14:24:05.942467091 +0300 -+++ r/galera_ist_rsync,debug.reject 2021-04-10 14:52:14.236776538 +0300 +--- r/galera_ist_rsync.result ++++ r/galera_ist_rsync,debug.reject @@ -517,3 +517,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff index 3aad611cacb..da294317c27 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff @@ -1,5 +1,5 @@ --- r/galera_sst_mariabackup.result -+++ r/galera_sst_mariabackup.reject ++++ r/galera_sst_mariabackup,debug.reject @@ -516,5 +516,189 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff index 870b12de3c9..875d53addd8 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_sst_mariabackup_data_dir.result 2021-04-10 14:26:02.798965488 +0300 -+++ r/galera_sst_mariabackup_data_dir,debug.reject 2021-04-10 14:54:44.825538224 +0300 +--- r/galera_sst_mariabackup_data_dir.result ++++ r/galera_sst_mariabackup_data_dir,debug.reject @@ -516,5 +516,189 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff index bad8355b514..b8469370b0d 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_sst_mariabackup.result 2021-04-10 14:25:04.142716409 +0300 -+++ r/galera_sst_mariabackup,debug.reject 2021-04-10 14:53:30.033162191 +0300 +--- r/galera_sst_mariabackup_force_recovery.result ++++ r/galera_sst_mariabackup_force_recovery,debug.reject @@ -516,5 +516,189 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_logarchive,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_logarchive,debug.rdiff index a9c796da607..0c08f38c138 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup_logarchive,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_logarchive,debug.rdiff @@ -1,5 +1,5 @@ --- r/galera_sst_mariabackup_logarchive.result -+++ r/galera_sst_mariabackup_logarchive.reject ++++ r/galera_sst_mariabackup_logarchive,debug.reject @@ -516,5 +516,189 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff index e73a27ad0ac..d43067b4be0 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_sst_mysqldump.result 2021-04-18 13:15:29.909314729 +0300 -+++ r/galera_sst_mysqldump.reject 2021-04-18 13:50:47.096965646 +0300 +--- r/galera_sst_mysqldump.result ++++ r/galera_sst_mysqldump,debug.reject @@ -698,6 +698,190 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff index 7d73f7a6ae6..2f18ca4772e 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_sst_mysqldump_with_key.result 2021-04-10 14:33:29.441606621 +0300 -+++ r/galera_sst_mysqldump_with_key,debug.reject 2021-04-10 15:02:45.367881573 +0300 +--- r/galera_sst_mysqldump_with_key.result ++++ r/galera_sst_mysqldump_with_key,debug.reject @@ -358,6 +358,190 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff index 87f8a463bd0..157a4db3204 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff @@ -1,5 +1,5 @@ --- galera_sst_rsync.result -+++ galera_sst_rsync.reject ++++ galera_sst_rsync,debug.reject @@ -516,3 +516,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff index 14f67770572..ae242e2b216 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_sst_rsync2.result 2021-04-10 14:34:48.646288119 +0300 -+++ r/galera_sst_rsync2,debug.reject 2021-04-10 15:04:10.276286996 +0300 +--- r/galera_sst_rsync2.result ++++ r/galera_sst_rsync2,debug.reject @@ -516,3 +516,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff index 00b42d53b51..558a8e7cd07 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff @@ -1,5 +1,5 @@ ---- r/galera_sst_rsync_data_dir.result 2021-04-10 14:35:28.090610315 +0300 -+++ r/galera_sst_rsync_data_dir,debug.reject 2021-04-10 15:50:26.945234998 +0300 +--- r/galera_sst_rsync_data_dir.result ++++ r/galera_sst_rsync_data_dir,debug.reject @@ -516,3 +516,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_recv_auto,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync_recv_auto,debug.rdiff index 5bc47c58303..0b1e2f2169c 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync_recv_auto,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync_recv_auto,debug.rdiff @@ -1,3 +1,5 @@ +--- r/galera_sst_rsync_recv_auto.result ++++ r/galera_sst_rsync_recv_auto,debug.reject @@ -516,3 +516,187 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff b/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff index 971f11bb8ec..f75f92a3d7d 100644 --- a/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff +++ b/mysql-test/suite/galera/r/mysql-wsrep#33,debug.rdiff @@ -1,5 +1,5 @@ ---- r/mysql-wsrep#33.result 2021-04-10 14:36:42.663191908 +0300 -+++ r/mysql-wsrep#33,debug.reject 2021-04-10 15:43:02.420168969 +0300 +--- r/mysql-wsrep#33.result ++++ r/mysql-wsrep#33,debug.reject @@ -698,6 +698,190 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index 4c4d26db4c5..825525765ca 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -10,20 +10,20 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( - qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1), + qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), qr(WSREP: Could not open saved state file for reading: .*), qr(WSREP: Could not open state file for reading: .*), - qr(WSREP: Gap in state sequence. Need state transfer.), + qr(WSREP: Gap in state sequence\. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), - qr(WSREP:.*down context.*), + qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.), + qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), qr|WSREP: discarding established \(time wait\) .*|, - qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.), + qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, qr(WSREP: no nodes coming from prim view, prim not possible), @@ -46,25 +46,25 @@ push @::global_suppressions, qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, - qr(WSREP: SYNC message from member .* in non-primary configuration. Ignored.), + qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), qr(WSREP: TO isolation failed for: .*), qr|WSREP: gcs_caused\(\) returned .*|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, - qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored\.|, + qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established .*), qr|WSREP: .*core_handle_uuid_msg.*|, - qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|, - qr|Query apply failed:*|, - qr(WSREP: Ignoring error*), + qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), + qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, + qr|WSREP: .*Query apply failed:.*|, + qr(WSREP: Ignoring error.*), qr(WSREP: Failed to remove page file .*), qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), - qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|, - qr|WSREP: Send action \{.* STATE_REQUEST} returned -107 \(Transport endpoint is not connected\)|, + qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, + qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, qr|WSREP: Trying to continue unpaused monitor|, qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|, qr|WSREP: Failed to report last committed|, diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test index 9d876233eb4..178c7760da7 100644 --- a/mysql-test/suite/galera/t/MW-416.test +++ b/mysql-test/suite/galera/t/MW-416.test @@ -17,87 +17,87 @@ ALTER DATABASE db CHARACTER SET = utf8; ALTER EVENT ev1 RENAME TO ev2; --error 1370 ALTER FUNCTION fun1 COMMENT 'foo'; -#--error 1044,1142,1227,1370 +#--error 1044,1227 #ALTER INSTANCE ROTATE INNODB MASTER KEY; ---error 1044,1142,1227,1370 +--error 1044,1227 ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB; ---error 1044,1142,1227,1370 +--error 1044,1227,1370 ALTER PROCEDURE proc1 COMMENT 'foo'; ---error 1044,1142,1227,1370 +--error 1044,1227 ALTER SERVER srv OPTIONS (USER 'sally'); ---error 1044,1142,1227,1370 +--error 1044,1142,1227 ALTER TABLE tbl DROP COLUMN col; ---error 1044,1142,1227,1370 +--error 1044,1227 ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 ALTER VIEW vw AS SELECT 1; ---error 1044,1142,1227,1370 +--error 1044,1227 CREATE DATABASE db; ---error 1044,1142,1227,1370 -CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1; ---error 1044,1142,1227,1370 +--error 1044,1227 +CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1; +--error 1044,1227,1370 CREATE FUNCTION fun1() RETURNS int RETURN(1); ---error 1044,1142,1227,1370 +--error 1044,1227,1370 CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so'; ---error 1044,1142,1227,1370 -CREATE PROCEDURE proc1() BEGIN END; ---error 1044,1142,1227,1370 +--error 1044,1227,1370 +CREATE PROCEDURE proc1() BEGIN END; +--error 1044,1142,1227 CREATE INDEX idx ON tbl(id); ---error 1044,1142,1227,1370 +--error 1044,1142,1227 CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb; ---error 1044,1142,1227,1370 +--error 1044,1227 CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user'); ---error 1044,1142,1227,1370 +--error 1044,1142,1227 CREATE TABLE t (i int); ---error 1044,1142,1227,1370 +--error 1044,1227 CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 CREATE VIEW vw AS SELECT 1; ---error 1044,1142,1227,1370 +--error 1044,1227 DROP DATABASE db; ---error 1044,1142,1227,1370 +--error 1044,1227 DROP EVENT ev; ---error 1044,1142,1227,1370 +--error 1044,1227,1370 DROP FUNCTION fun1; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 DROP INDEX idx ON t0; ---error 1044,1142,1227,1370,1064 +--error 1044,1227,1064 DROP LOGFILE GROUP lfg; ---error 1044,1142,1227,1370 +--error 1044,1227,1370 DROP PROCEDURE proc1; ---error 1044,1142,1227,1370 +--error 1044,1227 DROP SERVEr srv; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 DROP TABLE t0; ---error 1044,1142,1227,1370,1064 +--error 1044,1227,1064 DROP TABLESPACE tblspc; ---error 1044,1142,1227,1360,1370 +--error 1044,1227,1360 DROP TRIGGER trg; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 DROP VIEW vw; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 RENAME TABLE t0 TO t1; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 TRUNCATE TABLE t0; # DCL # account management ---error 1044,1142,1227,1370,1064 +--error 1044,1227,1064 ALTER USER myuser PASSWORD EXPIRE; ---error 1044,1142,1227,1370 +--error 1044,1227 CREATE USER myuser IDENTIFIED BY 'pass'; ---error 1044,1142,1227,1370 +--error 1044,1227 DROP USER myuser; ---error 1044,1045,1142,1227,1370 +--error 1044,1045,1227 GRANT ALL ON *.* TO 'myuser'; ---error 1044,1142,1227,1370 +--error 1044,1227 RENAME USER myuser TO mariauser; --error 1044,1142,1227,1370 REVOKE SELECT ON test FROM myuser; @@ -107,23 +107,25 @@ REVOKE ALL, GRANT OPTION FROM myuser; REVOKE PROXY ON myuser FROM myuser; # table maintenance ---error 1044,1142,1227,1370 +--error 1044,1142,1227 ANALYZE TABLE db.tbl; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 CHECK TABLE db.tbl; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 CHECKSUM TABLE db.tbl; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 OPTIMIZE TABLE db.tbl; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 REPAIR TABLE db.tbl; # plugin and user defined functions ---error 1044,1142,1227,1370 +--error 1044,1142,1227 INSTALL PLUGIN plg SONAME 'plg.so'; ---error 1044,1142,1227,1370 +--error 1044,1142,1227 UNINSTALL PLUGIN plg; --connection node_1 DROP USER 'userMW416'@'localhost'; SHOW DATABASES; + +--disconnect userMW416 diff --git a/mysql-test/suite/galera_3nodes/r/galera-features#115.result b/mysql-test/suite/galera_3nodes/r/galera-features#115.result new file mode 100644 index 00000000000..db965599d80 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera-features#115.result @@ -0,0 +1,41 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_3; +connection node_2; +SET GLOBAL wsrep_on=OFF; +DROP SCHEMA test; +connection node_3; +SET GLOBAL wsrep_on=OFF; +CREATE TABLE t1 (f1 INTEGER); +connection node_1; +CREATE TABLE t1 (f1 INTEGER); +connection node_1; +SET SESSION wsrep_sync_wait=0; +connection node_2; +SET SESSION wsrep_sync_wait=0; +connection node_3; +SET SESSION wsrep_sync_wait=0; +connection node_1; +SET GLOBAL wsrep_provider_options='pc.bootstrap=YES'; +connection node_2; +disconnect node_2; +connect node_2, 127.0.0.1, root, , mysql, $NODE_MYPORT_2; +# restart +connection node_3; +# restart +connection node_1; +DROP TABLE test.t1; +connection node_2; +CALL mtr.add_suppression("Inconsistent by consensus\\."); +CALL mtr.add_suppression("Error_code: 1049"); +CALL mtr.add_suppression("WSREP: Failed to apply trx: source: "); +CALL mtr.add_suppression("WSREP: Failed to apply app buffer"); +CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\."); +connection node_3; +CALL mtr.add_suppression("Inconsistent by consensus\\."); +CALL mtr.add_suppression("Error_code: 1050"); +CALL mtr.add_suppression("WSREP: Failed to apply trx: source: "); +CALL mtr.add_suppression("WSREP: Failed to apply app buffer"); +CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\."); diff --git a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result index bdd18ee2534..0a2be393d27 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result +++ b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result @@ -3,7 +3,6 @@ connection node_1; connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5; connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4; connection node_4; -CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos;; START SLAVE; include/wait_for_slave_to_start.inc connection node_1; diff --git a/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result index 1cb14cd3eff..f4929a22a06 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result +++ b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result @@ -35,7 +35,7 @@ SHOW STATUS LIKE 'wsrep_cluster_size'; Variable_name Value wsrep_cluster_size 3 connection node_1; -change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);; +--- ignore_server_ids=(12,13) start slave; include/wait_for_slave_to_start.inc select @@gtid_binlog_state; @@ -45,7 +45,7 @@ select @@gtid_slave_pos; @@gtid_slave_pos connection node_4; -change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);; +--- ignore_server_ids=(22,23) start slave; include/wait_for_slave_to_start.inc select @@gtid_binlog_state; @@ -258,7 +258,7 @@ set global wsrep_on=OFF; reset master; set global wsrep_on=ON; connection node_1; -change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);; +--- ignore_server_ids=(12,13) start slave; include/wait_for_slave_to_start.inc select @@gtid_binlog_state; @@ -268,7 +268,7 @@ select @@gtid_slave_pos; @@gtid_slave_pos connection node_4; -change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);; +--- ignore_server_ids=(22,23) start slave; include/wait_for_slave_to_start.inc select @@gtid_binlog_state; diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm index 49b93248a58..ff1ba0a566f 100644 --- a/mysql-test/suite/galera_3nodes/suite.pm +++ b/mysql-test/suite/galera_3nodes/suite.pm @@ -9,20 +9,20 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( - qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1), + qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), qr(WSREP: Could not open saved state file for reading: .*), qr(WSREP: Could not open state file for reading: .*), - qr(WSREP: Gap in state sequence. Need state transfer.), + qr(WSREP: Gap in state sequence\. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), - qr(WSREP:.*down context.*), + qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.), + qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), qr|WSREP: discarding established \(time wait\) .*|, - qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.), + qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, qr(WSREP: no nodes coming from prim view, prim not possible), @@ -45,33 +45,35 @@ push @::global_suppressions, qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, - qr(WSREP: SYNC message from member .* in non-primary configuration. Ignored.), + qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), qr(WSREP: TO isolation failed for: .*), qr|WSREP: gcs_caused\(\) returned .*|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, - qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored\.|, + qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established .*), qr|WSREP: .*core_handle_uuid_msg.*|, - qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|, - qr|Query apply failed:*|, - qr(WSREP: Ignoring error*), + qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), + qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, + qr|WSREP: .*Query apply failed:.*|, + qr(WSREP: Ignoring error.*), qr(WSREP: Failed to remove page file .*), qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), - qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|, + qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, + qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, qr|WSREP: Trying to continue unpaused monitor|, qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|, + qr|WSREP: Failed to report last committed|, ); sub which($) { return `sh -c "command -v $_[0]"` } sub skip_combinations { my %skip = (); - $skip{'include/have_mariabackup.inc'} = 'Need ss' + $skip{'include/have_mariabackup.inc'} = 'Need socket statistics utility' unless which("lsof") || which("sockstat") || which("ss"); %skip; } diff --git a/mysql-test/suite/galera_3nodes/t/galera-features#115.cnf b/mysql-test/suite/galera_3nodes/t/galera-features#115.cnf new file mode 100644 index 00000000000..e255e1d527e --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera-features#115.cnf @@ -0,0 +1,4 @@ +!include ../galera_3nodes.cnf + +[mysqld] +wsrep-ignore-apply-errors=0 diff --git a/mysql-test/suite/galera_3nodes/t/galera-features#115.test b/mysql-test/suite/galera_3nodes/t/galera-features#115.test new file mode 100644 index 00000000000..f045e7abe4b --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera-features#115.test @@ -0,0 +1,89 @@ +# +# This test tests that one successful node wins over two nodes that fail for +# different reasons +# +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--let $galera_connection_name = node_3 +--let $galera_server_number = 3 +--source include/galera_connect.inc + +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--source suite/galera/include/auto_increment_offset_save.inc + +# create inconsistency on node 2 +--connection node_2 +SET GLOBAL wsrep_on=OFF; +DROP SCHEMA test; + +# create inconsistency on node 3 +--connection node_3 +SET GLOBAL wsrep_on=OFF; +CREATE TABLE t1 (f1 INTEGER); + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER); + +# check that nodes 2 and 3 leave the cluster, and node_1 is Primary by itself + +--connection node_1 +SET SESSION wsrep_sync_wait=0; +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_2 +SET SESSION wsrep_sync_wait=0; +--let $wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +--connection node_3 +SET SESSION wsrep_sync_wait=0; +--let $wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +--connection node_1 +# this is a workaround for "sending install message failed" BUG: +# https://github.com/codership/galera/issues/174 +# When it happens, node_1 becomes non-prim +SET GLOBAL wsrep_provider_options='pc.bootstrap=YES'; +--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +# restart nodes 2 and 3, since they failed + +--connection node_2 +# need to reinitialize connection due to a "Bad handshake" bug. +# we reconnect using the 'mysql' database as 'test' was dropped. +--disconnect node_2 +--connect node_2, 127.0.0.1, root, , mysql, $NODE_MYPORT_2 + --source include/restart_mysqld.inc + +--connection node_3 + --source include/restart_mysqld.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +DROP TABLE test.t1; + +--source suite/galera/include/auto_increment_offset_restore.inc + +--connection node_2 +CALL mtr.add_suppression("Inconsistent by consensus\\."); +CALL mtr.add_suppression("Error_code: 1049"); +CALL mtr.add_suppression("WSREP: Failed to apply trx: source: "); +CALL mtr.add_suppression("WSREP: Failed to apply app buffer"); +CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\."); + +--connection node_3 +CALL mtr.add_suppression("Inconsistent by consensus\\."); +CALL mtr.add_suppression("Error_code: 1050"); +CALL mtr.add_suppression("WSREP: Failed to apply trx: source: "); +CALL mtr.add_suppression("WSREP: Failed to apply app buffer"); +CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\."); diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test index e59fcfb2100..86119bf7bcb 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test @@ -15,8 +15,9 @@ --connection node_4 ---replace_result $NODE_MYPORT_1 NODE_MYPORT_1 +--disable_query_log --eval CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos; +--enable_query_log START SLAVE; --source include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test index c8247f15aba..750f840c470 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test +++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test @@ -42,8 +42,10 @@ SHOW STATUS LIKE 'wsrep_cluster_size'; SHOW STATUS LIKE 'wsrep_cluster_size'; #--disable_parsing --connection node_1 ---replace_result $NODE_MYPORT_4 NODE_MYPORT_4 +--echo --- ignore_server_ids=(12,13) +--disable_query_log --eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13); +--enable_query_log start slave; --source include/wait_for_slave_to_start.inc select @@gtid_binlog_state; @@ -51,8 +53,10 @@ select @@gtid_slave_pos; #--query_vertical SHOW SLAVE STATUS; --connection node_4 ---replace_result $NODE_MYPORT_1 NODE_MYPORT_1 +--echo --- ignore_server_ids=(22,23) +--disable_query_log --eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23); +--enable_query_log start slave; --source include/wait_for_slave_to_start.inc select @@gtid_binlog_state; @@ -210,8 +214,10 @@ set global wsrep_on=ON; # Then we will kill node D and set up the replication between A and E # To see whether fail over works or not. --connection node_1 ---replace_result $NODE_MYPORT_6 NODE_MYPORT_6 +--echo --- ignore_server_ids=(12,13) +--disable_query_log --eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13); +--enable_query_log start slave; --source include/wait_for_slave_to_start.inc select @@gtid_binlog_state; @@ -219,8 +225,10 @@ select @@gtid_slave_pos; #--query_vertical SHOW SLAVE STATUS; --connection node_4 ---replace_result $NODE_MYPORT_3 NODE_MYPORT_3 +--echo --- ignore_server_ids=(22,23) +--disable_query_log --eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23); +--enable_query_log start slave; --source include/wait_for_slave_to_start.inc select @@gtid_binlog_state; diff --git a/mysql-test/suite/galera_3nodes_sr/suite.pm b/mysql-test/suite/galera_3nodes_sr/suite.pm index becc764733a..d2b31a0fbc7 100644 --- a/mysql-test/suite/galera_3nodes_sr/suite.pm +++ b/mysql-test/suite/galera_3nodes_sr/suite.pm @@ -9,21 +9,21 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( - qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1), + qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), qr(WSREP: Could not open saved state file for reading: .*), qr(WSREP: Could not open state file for reading: .*), - qr(WSREP: Gap in state sequence. Need state transfer.), + qr(WSREP: Gap in state sequence. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), - qr(WSREP:.*down context.*), + qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), qr(WSREP: SQL statement was ineffective), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.), + qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), - qr|WSREP: discarding established \(time wait\) .*|, - qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.), + qr|WSREP: discarding established \(time wait\).*|, + qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, qr(WSREP: no nodes coming from prim view, prim not possible), @@ -31,16 +31,16 @@ push @::global_suppressions, qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: Transport endpoint is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), - qr(WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.), + qr(WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.), qr(WSREP: Could not find peer:), qr|WSREP: gcs_caused\(\) returned .*|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr|WSREP: .*core_handle_uuid_msg.*|, - qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr(WSREP: JOIN message from member .* in non-primary configuration. Ignored.), + qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), + qr(WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.), ); bless { }; diff --git a/mysql-test/suite/galera_sr/suite.pm b/mysql-test/suite/galera_sr/suite.pm index a9665b5252c..1a0e9b28685 100644 --- a/mysql-test/suite/galera_sr/suite.pm +++ b/mysql-test/suite/galera_sr/suite.pm @@ -9,20 +9,20 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( - qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1), + qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), qr(WSREP: Could not open saved state file for reading: .*), qr(WSREP: Could not open state file for reading: .*), - qr(WSREP: Gap in state sequence. Need state transfer.), + qr(WSREP: Gap in state sequence\. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), - qr(WSREP:.*down context.*), + qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.), + qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), qr|WSREP: discarding established \(time wait\) .*|, - qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.), + qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, qr(WSREP: no nodes coming from prim view, prim not possible), @@ -45,26 +45,28 @@ push @::global_suppressions, qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, - qr(WSREP: SYNC message from member .* in non-primary configuration. Ignored.), + qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), qr(WSREP: TO isolation failed for: .*), qr|WSREP: gcs_caused\(\) returned .*|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|, - qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, - qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored\.|, + qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established .*), qr|WSREP: .*core_handle_uuid_msg.*|, - qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|, - qr|Query apply failed:*|, - qr(WSREP: Ignoring error*), + qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), + qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, + qr|WSREP: .*Query apply failed:.*|, + qr(WSREP: Ignoring error.*), qr(WSREP: Failed to remove page file .*), qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), - qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|, + qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, + qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, qr|WSREP: Trying to continue unpaused monitor|, qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|, + qr|WSREP: Failed to report last committed|, ); bless { }; From 7b040e53cc07bc7bd78d9c2029e1e714e19c2fec Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Thu, 6 Feb 2025 21:29:04 +0100 Subject: [PATCH 18/65] galera mtr tests: fixes for test failures, 'cosmetic' changes and unification between versions --- mysql-test/suite/galera/r/MDEV-20225.result | 2 +- mysql-test/suite/galera/r/MDEV-20793.result | 2 +- mysql-test/suite/galera/r/MDEV-25389.result | 1 + .../r/galera_applier_ftwrl_table_alter.result | 4 +- .../galera/r/galera_ddl_fk_conflict.result | 3 ++ .../r/galera_parallel_apply_lock_table.result | 7 ++- .../galera/r/galera_parallel_simple.result | 1 - .../galera/r/galera_var_slave_threads.result | 1 - .../suite/galera/r/wsrep_strict_ddl.result | 6 +-- mysql-test/suite/galera/suite.pm | 54 +++++++++---------- mysql-test/suite/galera/t/MDEV-10715.cnf | 4 +- mysql-test/suite/galera/t/MDEV-15443.cnf | 2 + mysql-test/suite/galera/t/MDEV-20225.test | 2 +- mysql-test/suite/galera/t/MDEV-20793.test | 2 +- mysql-test/suite/galera/t/MDEV-22227.test | 2 +- mysql-test/suite/galera/t/MDEV-22708.cnf | 2 +- mysql-test/suite/galera/t/MDEV-24143.test | 1 - mysql-test/suite/galera/t/MDEV-24327.cnf | 1 - mysql-test/suite/galera/t/MDEV-25389.test | 7 +++ mysql-test/suite/galera/t/MDEV-25731.test | 2 - mysql-test/suite/galera/t/MDEV-26597.test | 2 - mysql-test/suite/galera/t/MDEV-27123.opt | 1 - mysql-test/suite/galera/t/MDEV-29293.test | 1 - mysql-test/suite/galera/t/MDEV-29512.cnf | 2 - mysql-test/suite/galera/t/MDEV-6860.cnf | 5 +- mysql-test/suite/galera/t/MW-259.test | 1 - mysql-test/suite/galera/t/MW-313.cnf | 3 -- mysql-test/suite/galera/t/MW-360-master.opt | 1 - mysql-test/suite/galera/t/MW-369.inc | 2 - mysql-test/suite/galera/t/MW-86-wait8.cnf | 1 - mysql-test/suite/galera/t/create.test | 1 - .../suite/galera/t/galera_MDEV-29512.cnf | 2 - .../galera/t/galera_applier_ftwrl_table.test | 2 +- .../t/galera_applier_ftwrl_table_alter.cnf | 3 -- .../t/galera_applier_ftwrl_table_alter.test | 6 +-- .../suite/galera/t/galera_as_slave_ctas.test | 1 - .../suite/galera/t/galera_backup_stage.test | 6 +-- .../t/galera_bf_abort_at_after_statement.test | 1 - .../t/galera_bf_abort_flush_for_export.test | 4 +- .../galera/t/galera_bf_abort_lock_table.cnf | 4 -- .../galera/t/galera_bf_abort_lock_table.test | 5 +- .../suite/galera/t/galera_bf_abort_ps.cnf | 3 +- .../t/galera_bf_background_statistics.cnf | 2 - .../t/galera_bf_background_statistics.test | 1 - mysql-test/suite/galera/t/galera_bf_kill.test | 2 +- .../suite/galera/t/galera_bf_lock_wait.test | 1 - .../suite/galera/t/galera_binlog_checksum.cnf | 2 - .../t/galera_binlog_event_max_size_max.cnf | 3 -- .../t/galera_binlog_event_max_size_min.cnf | 3 -- .../t/galera_binlog_event_max_size_min.test | 1 - .../galera/t/galera_binlog_row_image.test | 4 -- .../suite/galera/t/galera_change_user.test | 1 - .../galera/t/galera_concurrent_ctas.test | 1 - .../suite/galera/t/galera_ddl_fk_conflict.cnf | 2 - .../galera/t/galera_ddl_fk_conflict.test | 1 - .../suite/galera/t/galera_ddl_multiline.test | 1 - .../galera/t/galera_encrypt_tmp_files.cnf | 2 +- .../galera/t/galera_forced_binlog_format.test | 1 - .../suite/galera/t/galera_gcs_fragment.cnf | 2 + .../galera/t/galera_gcs_max_packet_size.cnf | 2 + mysql-test/suite/galera/t/galera_gtid.cnf | 1 - .../suite/galera/t/galera_gtid_server_id.cnf | 1 - .../suite/galera/t/galera_gtid_slave.cnf | 3 ++ .../galera/t/galera_gtid_slave_sst_rsync.cnf | 4 +- .../galera/t/galera_gtid_trx_conflict.cnf | 2 + .../suite/galera/t/galera_insert_ignore.test | 1 - .../suite/galera/t/galera_insert_multi.test | 7 --- .../suite/galera/t/galera_ist_progress.cnf | 3 -- .../suite/galera/t/galera_ist_recv_bind.cnf | 1 - .../suite/galera/t/galera_kill_applier.cnf | 2 + .../suite/galera/t/galera_load_data.test | 1 - .../suite/galera/t/galera_mdev_13787.cnf | 2 - .../suite/galera/t/galera_mdev_13787.test | 1 + .../suite/galera/t/galera_mdev_15611.cnf | 1 + .../suite/galera/t/galera_mdl_race.test | 1 - .../suite/galera/t/galera_nonPK_and_PA.test | 1 + .../suite/galera/t/galera_nopk_unicode.test | 1 - .../t/galera_parallel_apply_lock_table.test | 11 ++-- .../t/galera_parallel_autoinc_largetrx.test | 1 - .../t/galera_parallel_autoinc_manytrx.test | 2 - .../galera/t/galera_parallel_simple.test | 6 ++- .../suite/galera/t/galera_pc_ignore_sb.cnf | 1 - .../suite/galera/t/galera_query_cache.cnf | 1 - .../galera/t/galera_query_cache_sync_wait.cnf | 1 - .../t/galera_repl_key_format_flat16.test | 1 - .../galera/t/galera_restart_nochanges.test | 1 - .../suite/galera/t/galera_restart_replica.cnf | 1 - .../galera/t/galera_savepoint_replay.test | 1 - mysql-test/suite/galera/t/galera_server.test | 1 - ...alera_set_position_after_cert_failure.test | 1 + .../suite/galera/t/galera_sp_bf_abort.inc | 1 - .../galera/t/galera_sql_log_bin_zero.test | 1 - .../suite/galera/t/galera_status_cluster.test | 2 - .../galera/t/galera_status_local_index.test | 1 - .../galera/t/galera_status_local_state.test | 4 -- .../suite/galera/t/galera_suspend_slave.test | 1 - .../galera/t/galera_sync_wait_upto-master.opt | 2 +- .../galera/t/galera_table_with_hyphen.inc | 1 - .../galera/t/galera_temporary_sequences.test | 1 - .../suite/galera/t/galera_threadpool.cnf | 2 - .../suite/galera/t/galera_toi_ftwrl.test | 1 - .../t/galera_transaction_read_only.test | 1 - mysql-test/suite/galera/t/galera_udf.cnf | 7 --- .../galera/t/galera_unicode_identifiers.test | 1 - .../suite/galera/t/galera_v1_row_events.cnf | 7 --- .../galera/t/galera_var_OSU_method2.test | 1 - .../t/galera_var_auto_inc_control_on.cnf | 6 --- .../galera/t/galera_var_slave_threads.test | 17 +++++- .../suite/galera/t/galera_wan_restart_sst.cnf | 1 - .../galera/t/galera_wsrep_log_conficts.cnf | 5 -- .../galera_wsrep_provider_options_syntax.test | 1 + mysql-test/suite/galera/t/mdev-31285.test | 2 - mysql-test/suite/galera/t/mysql-wsrep#198.cnf | 2 - .../suite/galera/t/mysql-wsrep#198.test | 3 +- mysql-test/suite/galera/t/mysql-wsrep#201.cnf | 2 - .../suite/galera/t/mysql-wsrep#247.test | 1 - mysql-test/suite/galera/t/mysql-wsrep#31.test | 2 - mysql-test/suite/galera/t/mysql-wsrep#33.cnf | 1 - .../suite/galera/t/mysql-wsrep#332.test | 1 - mysql-test/suite/galera/t/rename.test | 1 - mysql-test/suite/galera/t/view.test | 1 - .../r/galera_parallel_apply_3nodes.result | 2 +- mysql-test/suite/galera_3nodes/suite.pm | 54 +++++++++---------- .../galera_3nodes/t/galera-features#119.test | 1 - .../t/galera_certification_ccc.test | 1 - .../t/galera_evs_suspect_timeout.test | 1 + .../t/galera_parallel_apply_3nodes.test | 2 +- .../t/galera_wsrep_schema_init.test | 1 - .../t/inconsistency_shutdown.cnf | 3 +- .../galera_sr_kill_slave_before_apply.result | 2 +- mysql-test/suite/galera_3nodes_sr/suite.pm | 22 ++++---- .../suite/galera_3nodes_sr/t/GCF-606.test | 1 + ...a_sr_kill_slave_after_apply_rollback2.test | 1 + .../t/galera_sr_kill_slave_before_apply.test | 2 +- .../t/galera_sr_threeway_split.cnf | 1 - .../t/galera_vote_sr-master.opt | 1 - .../galera_sr/r/galera_sr_cc_master.result | 2 +- .../r/mysql-wsrep-features#148.result | 2 +- mysql-test/suite/galera_sr/suite.pm | 54 +++++++++---------- mysql-test/suite/galera_sr/t/MDEV-27615.test | 1 - .../galera_sr/t/galera_sr_cc_master.test | 2 +- .../galera_sr/t/galera_sr_gtid-master.opt | 2 +- .../galera_sr/t/galera_sr_mysqldump_sst.cnf | 1 - .../galera_sr/t/galera_sr_small_gcache.cnf | 3 +- .../galera_sr/t/mysql-wsrep-features#14.test | 1 - .../galera_sr/t/mysql-wsrep-features#148.test | 2 +- .../galera_sr/t/mysql-wsrep-features#22.test | 1 - .../galera_sr/t/mysql-wsrep-features#96.test | 4 -- mysql-test/suite/wsrep/r/plugin.result | 2 +- mysql-test/suite/wsrep/suite.pm | 6 +-- mysql-test/suite/wsrep/t/binlog_format.cnf | 1 - mysql-test/suite/wsrep/t/foreign_key.test | 1 - mysql-test/suite/wsrep/t/mdev_10186.test | 1 - mysql-test/suite/wsrep/t/mdev_7798.cnf | 1 - mysql-test/suite/wsrep/t/plugin.test | 2 +- mysql-test/suite/wsrep/t/wsrep-recover.cnf | 2 +- .../wsrep/t/wsrep_forced_binlog_format.test | 1 - mysql-test/suite/wsrep/t/wsrep_rpl.test | 1 - .../wsrep/t/wsrep_variables_sst_method.test | 1 - .../wsrep/t/wsrep_variables_wsrep_off.cnf | 1 - sql/wsrep_mysqld.cc | 9 ++-- 161 files changed, 215 insertions(+), 321 deletions(-) diff --git a/mysql-test/suite/galera/r/MDEV-20225.result b/mysql-test/suite/galera/r/MDEV-20225.result index 245051309d1..47c21249c8d 100644 --- a/mysql-test/suite/galera/r/MDEV-20225.result +++ b/mysql-test/suite/galera/r/MDEV-20225.result @@ -15,7 +15,7 @@ connection node_2a; SET GLOBAL debug_dbug = 'RESET'; SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue'; SET DEBUG_SYNC = 'RESET'; -SET GLOBAL wsrep_slave_threads = 1; +SET GLOBAL wsrep_slave_threads = DEFAULT; connection node_2; SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation diff --git a/mysql-test/suite/galera/r/MDEV-20793.result b/mysql-test/suite/galera/r/MDEV-20793.result index feb068f258f..d37c0b79165 100644 --- a/mysql-test/suite/galera/r/MDEV-20793.result +++ b/mysql-test/suite/galera/r/MDEV-20793.result @@ -41,4 +41,4 @@ connection node_1; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction SET debug_sync = "RESET"; DROP TABLE t1; -SET GLOBAL wsrep_slave_threads = 1; +SET GLOBAL wsrep_slave_threads = DEFAULT; diff --git a/mysql-test/suite/galera/r/MDEV-25389.result b/mysql-test/suite/galera/r/MDEV-25389.result index f369fe4dbae..fe3975fe163 100644 --- a/mysql-test/suite/galera/r/MDEV-25389.result +++ b/mysql-test/suite/galera/r/MDEV-25389.result @@ -15,3 +15,4 @@ SET GLOBAL wsrep_slave_threads=1; SELECT @@wsrep_slave_threads; @@wsrep_slave_threads 1 +connection node_2; diff --git a/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result b/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result index 451b2c80c2a..f0f67c28a28 100644 --- a/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result +++ b/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result @@ -13,7 +13,7 @@ connection node_1; SELECT 1 FROM DUAL; 1 1 -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'; +SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); COUNT(*) = 1 1 UNLOCK TABLES; @@ -25,7 +25,7 @@ t1 CREATE TABLE `t1` ( `f2` int(11) DEFAULT NULL, PRIMARY KEY (`f1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'; +SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); COUNT(*) = 0 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result b/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result index 226aebde69e..cf0f1bf8e24 100644 --- a/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result +++ b/mysql-test/suite/galera/r/galera_ddl_fk_conflict.result @@ -298,6 +298,7 @@ DROP TABLE p1, p2; ###################################################################### connection node_1; SET SESSION wsrep_sync_wait=0; +FLUSH STATUS; CREATE TABLE p1 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); INSERT INTO p1 VALUES (1, 'INITIAL VALUE'); CREATE TABLE p2 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); @@ -491,6 +492,7 @@ Note 1051 Unknown table 'test.tmp1,test.tmp2' ###################################################################### connection node_1; SET SESSION wsrep_sync_wait=0; +FLUSH STATUS; CREATE TABLE p1 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); INSERT INTO p1 VALUES (1, 'INITIAL VALUE'); CREATE TABLE p2 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); @@ -684,6 +686,7 @@ Note 1051 Unknown table 'test.tmp1,test.tmp2' ###################################################################### connection node_1; SET SESSION wsrep_sync_wait=0; +FLUSH STATUS; CREATE TABLE p1 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); INSERT INTO p1 VALUES (1, 'INITIAL VALUE'); CREATE TABLE p2 (pk INTEGER PRIMARY KEY, f2 CHAR(30)); diff --git a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result index a15b0c7df69..b1ba03a8391 100644 --- a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result +++ b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result @@ -10,10 +10,10 @@ INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); connection node_2a; SET SESSION wsrep_sync_wait=0; -SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE '%committing%' OR STATE LIKE 'Commit' OR STATE LIKE 'Waiting for certification'); EXPECT_1 1 -SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); EXPECT_1 1 SELECT COUNT(*) AS EXPECT_0 FROM t1; @@ -32,9 +32,8 @@ EXPECT_1 SELECT COUNT(*) AS EXPECT_1 FROM t2; EXPECT_1 1 -SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification'); +SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE '%committed%' OR STATE LIKE 'Waiting for certification'); EXPECT_2 2 -SET GLOBAL wsrep_slave_threads = 1;; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera/r/galera_parallel_simple.result b/mysql-test/suite/galera/r/galera_parallel_simple.result index cac784cd16f..46b00539fb1 100644 --- a/mysql-test/suite/galera/r/galera_parallel_simple.result +++ b/mysql-test/suite/galera/r/galera_parallel_simple.result @@ -34,6 +34,5 @@ expect_20 SELECT COUNT(*) as expect_20 FROM t2; expect_20 20 -SET GLOBAL wsrep_slave_threads = 1;; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera/r/galera_var_slave_threads.result b/mysql-test/suite/galera/r/galera_var_slave_threads.result index 936f58b89a0..a835cbf527e 100644 --- a/mysql-test/suite/galera/r/galera_var_slave_threads.result +++ b/mysql-test/suite/galera/r/galera_var_slave_threads.result @@ -33,7 +33,6 @@ connection node_2; SELECT COUNT(*) FROM t2; COUNT(*) 70 -SET GLOBAL wsrep_slave_threads = 1; DROP TABLE t1; DROP TABLE t2; # diff --git a/mysql-test/suite/galera/r/wsrep_strict_ddl.result b/mysql-test/suite/galera/r/wsrep_strict_ddl.result index 7b166f00bc3..37332fb19a3 100644 --- a/mysql-test/suite/galera/r/wsrep_strict_ddl.result +++ b/mysql-test/suite/galera/r/wsrep_strict_ddl.result @@ -20,7 +20,7 @@ ERROR HY000: DDL-statement is forbidden as table storage engine does not support SHOW WARNINGS; Level Code Message Error 4165 DDL-statement is forbidden as table storage engine does not support Galera replication -Warning 1031 WSREP: wsrep_strict_dll enabled. Storage engine Aria not supported. +Warning 1031 WSREP: wsrep_strict_ddl enabled. Storage engine Aria not supported. connection node_2; SHOW CREATE TABLE t1; ERROR 42S02: Table 'test.t1' doesn't exist @@ -31,9 +31,9 @@ ERROR HY000: DDL-statement is forbidden as table storage engine does not support SHOW WARNINGS; Level Code Message Error 4165 DDL-statement is forbidden as table storage engine does not support Galera replication -Warning 1031 WSREP: wsrep_strict_dll enabled. Storage engine MyISAM not supported. +Warning 1031 WSREP: wsrep_strict_ddl enabled. Storage engine MyISAM not supported. Error 4165 DDL-statement is forbidden as table storage engine does not support Galera replication -Warning 1031 WSREP: wsrep_strict_dll enabled. Storage engine MyISAM not supported. +Warning 1031 WSREP: wsrep_strict_ddl enabled. Storage engine MyISAM not supported. SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index 825525765ca..404025fb175 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -11,58 +11,58 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), - qr(WSREP: Could not open saved state file for reading: .*), - qr(WSREP: Could not open state file for reading: .*), + qr(WSREP: Could not open saved state file for reading: ), + qr(WSREP: Could not open state file for reading: ), qr(WSREP: Gap in state sequence\. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), - qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, + qr(WSREP: Releasing seqno [0-9]+ before [0-9]+ was assigned\.), + qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), - qr|WSREP: discarding established \(time wait\) .*|, + qr|WSREP: discarding established \(time wait\) |, qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), - qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, + qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: Transport endpoint is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), - qr(WSREP: Maximum writeset size exceeded by .*), - qr(WSREP: transaction size exceeded.*), - qr(WSREP: RBR event .*), - qr(WSREP: Ignoring error for TO isolated action: .*), - qr(WSREP: transaction size limit .*), - qr(WSREP: rbr write fail, .*), - qr(WSREP: .*Backend not supported: foo.*), - qr(WSREP: .*Failed to initialize backend using .*), - qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: Maximum writeset size exceeded by ), + qr(WSREP: transaction size exceeded), + qr(WSREP: RBR event ), + qr(WSREP: Ignoring error for TO isolated action: ), + qr(WSREP: transaction size limit ), + qr(WSREP: rbr write fail, ), + qr(WSREP: .*Backend not supported: foo), + qr(WSREP: .*Failed to initialize backend using ), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Socket type not supported), qr(WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 .*), - qr(WSREP: .*Failed to open backend connection: -110 .*), - qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: .*Failed to open backend connection: -110 ), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), - qr(WSREP: TO isolation failed for: .*), - qr|WSREP: gcs_caused\(\) returned .*|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored\.|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored\.|, + qr(WSREP: TO isolation failed for: ), + qr|WSREP: gcs_caused\(\) returned |, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), - qr(WSREP: discarding established .*), - qr|WSREP: .*core_handle_uuid_msg.*|, + qr(WSREP: discarding established ), + qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, - qr|WSREP: .*Query apply failed:.*|, - qr(WSREP: Ignoring error.*), - qr(WSREP: Failed to remove page file .*), - qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), + qr|WSREP: .*Query apply failed:|, + qr(WSREP: Ignoring error), + qr(WSREP: Failed to remove page file ), + qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to ), qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, qr|WSREP: Trying to continue unpaused monitor|, diff --git a/mysql-test/suite/galera/t/MDEV-10715.cnf b/mysql-test/suite/galera/t/MDEV-10715.cnf index 589514466ed..1422f977bf7 100644 --- a/mysql-test/suite/galera/t/MDEV-10715.cnf +++ b/mysql-test/suite/galera/t/MDEV-10715.cnf @@ -4,11 +4,13 @@ log-bin=mysqld-bin log-slave-updates binlog-format=ROW + [mysqld.1] gtid-domain-id=1 wsrep_gtid_mode=1 wsrep_gtid_domain_id=1 + [mysqld.2] gtid-domain-id=1 wsrep_gtid_mode=1 -wsrep_gtid_domain_id=1 \ No newline at end of file +wsrep_gtid_domain_id=1 diff --git a/mysql-test/suite/galera/t/MDEV-15443.cnf b/mysql-test/suite/galera/t/MDEV-15443.cnf index 88a08203d01..f8c6733de16 100644 --- a/mysql-test/suite/galera/t/MDEV-15443.cnf +++ b/mysql-test/suite/galera/t/MDEV-15443.cnf @@ -1,5 +1,7 @@ !include ../galera_2nodes.cnf + [mysqld.1] wsrep_auto_increment_control=OFF + [mysqld.2] wsrep_auto_increment_control=OFF diff --git a/mysql-test/suite/galera/t/MDEV-20225.test b/mysql-test/suite/galera/t/MDEV-20225.test index 60ab1c53e40..43c763e1d16 100644 --- a/mysql-test/suite/galera/t/MDEV-20225.test +++ b/mysql-test/suite/galera/t/MDEV-20225.test @@ -41,7 +41,7 @@ INSERT INTO t1 VALUES (NULL); SET GLOBAL debug_dbug = 'RESET'; SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue'; SET DEBUG_SYNC = 'RESET'; -SET GLOBAL wsrep_slave_threads = 1; +SET GLOBAL wsrep_slave_threads = DEFAULT; --connection node_2 # Trigger should now be dropped on node_2. diff --git a/mysql-test/suite/galera/t/MDEV-20793.test b/mysql-test/suite/galera/t/MDEV-20793.test index 6835a73a2a4..67140d06e71 100644 --- a/mysql-test/suite/galera/t/MDEV-20793.test +++ b/mysql-test/suite/galera/t/MDEV-20793.test @@ -99,4 +99,4 @@ SET SESSION debug_sync = "now SIGNAL continue"; SET debug_sync = "RESET"; DROP TABLE t1; -SET GLOBAL wsrep_slave_threads = 1; +SET GLOBAL wsrep_slave_threads = DEFAULT; diff --git a/mysql-test/suite/galera/t/MDEV-22227.test b/mysql-test/suite/galera/t/MDEV-22227.test index 0ee75b979e2..e3c4565958b 100644 --- a/mysql-test/suite/galera/t/MDEV-22227.test +++ b/mysql-test/suite/galera/t/MDEV-22227.test @@ -13,7 +13,7 @@ SET lock_wait_timeout= 1; --connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 --connection node_1b SET SESSION wsrep_sync_wait = 0; ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table level lock' +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table level lock' --source include/wait_condition.inc --connection node_1 diff --git a/mysql-test/suite/galera/t/MDEV-22708.cnf b/mysql-test/suite/galera/t/MDEV-22708.cnf index f7ac4f43082..4c62448fe3d 100644 --- a/mysql-test/suite/galera/t/MDEV-22708.cnf +++ b/mysql-test/suite/galera/t/MDEV-22708.cnf @@ -1,4 +1,4 @@ !include ../galera_2nodes.cnf [mysqld] -log-bin \ No newline at end of file +log-bin diff --git a/mysql-test/suite/galera/t/MDEV-24143.test b/mysql-test/suite/galera/t/MDEV-24143.test index 3aecac8cb07..391c93a875c 100644 --- a/mysql-test/suite/galera/t/MDEV-24143.test +++ b/mysql-test/suite/galera/t/MDEV-24143.test @@ -21,4 +21,3 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE; ALTER TABLE t1 DROP COLUMN c2; SELECT get_lock ('test', 1.5); DROP TABLE t1; - diff --git a/mysql-test/suite/galera/t/MDEV-24327.cnf b/mysql-test/suite/galera/t/MDEV-24327.cnf index 390a9aab0f4..d3e98435699 100644 --- a/mysql-test/suite/galera/t/MDEV-24327.cnf +++ b/mysql-test/suite/galera/t/MDEV-24327.cnf @@ -3,4 +3,3 @@ [mysqld.1] log-bin=mariadb-bin log-slave-updates=OFF - diff --git a/mysql-test/suite/galera/t/MDEV-25389.test b/mysql-test/suite/galera/t/MDEV-25389.test index fc523371918..0bc7d8de9d5 100644 --- a/mysql-test/suite/galera/t/MDEV-25389.test +++ b/mysql-test/suite/galera/t/MDEV-25389.test @@ -7,6 +7,8 @@ --source ../galera/include/auto_increment_offset_save.inc --connection node_2 +--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` + call mtr.add_suppression("WSREP: Failed to create/initialize system thread"); SET GLOBAL debug_dbug='+d,wsrep_simulate_failed_connection_1'; --error ER_WRONG_ARGUMENTS @@ -21,4 +23,9 @@ SELECT @@wsrep_slave_threads; # issue is fixed. --source include/restart_mysqld.inc +--connection node_2 +--disable_query_log +--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; +--enable_query_log + --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/MDEV-25731.test b/mysql-test/suite/galera/t/MDEV-25731.test index c26fad2fa6a..cf2a030d994 100644 --- a/mysql-test/suite/galera/t/MDEV-25731.test +++ b/mysql-test/suite/galera/t/MDEV-25731.test @@ -23,5 +23,3 @@ SELECT COUNT(*) AS EXPECT_12 FROM t1; DROP TABLE t1; SET GLOBAL wsrep_load_data_splitting=OFF; SET GLOBAL wsrep_replicate_myisam=OFF; - - diff --git a/mysql-test/suite/galera/t/MDEV-26597.test b/mysql-test/suite/galera/t/MDEV-26597.test index 465f1130443..7a57400c83d 100644 --- a/mysql-test/suite/galera/t/MDEV-26597.test +++ b/mysql-test/suite/galera/t/MDEV-26597.test @@ -28,5 +28,3 @@ SET SESSION wsrep_sync_wait = 0; --source ../../galera/include/auto_increment_offset_restore.inc --connection node_1 DROP TABLE t3; - - diff --git a/mysql-test/suite/galera/t/MDEV-27123.opt b/mysql-test/suite/galera/t/MDEV-27123.opt index 1c4accb816a..2a71a656039 100644 --- a/mysql-test/suite/galera/t/MDEV-27123.opt +++ b/mysql-test/suite/galera/t/MDEV-27123.opt @@ -1,2 +1 @@ --wsrep_auto_increment_control=OFF --auto_increment_increment=3 --auto_increment_offset=3 - diff --git a/mysql-test/suite/galera/t/MDEV-29293.test b/mysql-test/suite/galera/t/MDEV-29293.test index dacbf714c06..cf14a640035 100644 --- a/mysql-test/suite/galera/t/MDEV-29293.test +++ b/mysql-test/suite/galera/t/MDEV-29293.test @@ -38,4 +38,3 @@ set debug_sync= 'now SIGNAL continue'; --reap DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; - diff --git a/mysql-test/suite/galera/t/MDEV-29512.cnf b/mysql-test/suite/galera/t/MDEV-29512.cnf index bf8e0c37984..136a8842a56 100644 --- a/mysql-test/suite/galera/t/MDEV-29512.cnf +++ b/mysql-test/suite/galera/t/MDEV-29512.cnf @@ -10,6 +10,4 @@ log_slave_updates max-binlog-size=4096 expire-logs-days=1 - [mysqld.2] - diff --git a/mysql-test/suite/galera/t/MDEV-6860.cnf b/mysql-test/suite/galera/t/MDEV-6860.cnf index d8defd343ad..71934249b25 100644 --- a/mysql-test/suite/galera/t/MDEV-6860.cnf +++ b/mysql-test/suite/galera/t/MDEV-6860.cnf @@ -1,7 +1,8 @@ !include ../galera_2nodes_as_slave.cnf +[mysqld.1] +wsrep-slave-threads=10 + [mysqld.2] slave-parallel-threads=2 slave-parallel-mode=optimistic -[mysqld.1] -wsrep-slave-threads=10 diff --git a/mysql-test/suite/galera/t/MW-259.test b/mysql-test/suite/galera/t/MW-259.test index 7298285f6ff..61e0f19e5bb 100644 --- a/mysql-test/suite/galera/t/MW-259.test +++ b/mysql-test/suite/galera/t/MW-259.test @@ -39,4 +39,3 @@ SET GLOBAL wsrep_desync=0; # Cleanup SET DEBUG_SYNC= 'RESET'; - diff --git a/mysql-test/suite/galera/t/MW-313.cnf b/mysql-test/suite/galera/t/MW-313.cnf index 184900c58fd..98e724fb2d0 100644 --- a/mysql-test/suite/galera/t/MW-313.cnf +++ b/mysql-test/suite/galera/t/MW-313.cnf @@ -7,6 +7,3 @@ log-slave-updates [mysqld.2] log-bin log-slave-updates - - - diff --git a/mysql-test/suite/galera/t/MW-360-master.opt b/mysql-test/suite/galera/t/MW-360-master.opt index e51c49c3808..35922307c93 100644 --- a/mysql-test/suite/galera/t/MW-360-master.opt +++ b/mysql-test/suite/galera/t/MW-360-master.opt @@ -1,2 +1 @@ --gtid-domain-id=1 --log-bin --log-slave-updates - diff --git a/mysql-test/suite/galera/t/MW-369.inc b/mysql-test/suite/galera/t/MW-369.inc index 3b0a32bdd9d..f2d59245d7d 100644 --- a/mysql-test/suite/galera/t/MW-369.inc +++ b/mysql-test/suite/galera/t/MW-369.inc @@ -80,5 +80,3 @@ SET SESSION DEBUG_SYNC = 'now SIGNAL signal.wsrep_apply_cb'; SET GLOBAL DEBUG_DBUG = ""; SET DEBUG_SYNC = 'RESET'; - - diff --git a/mysql-test/suite/galera/t/MW-86-wait8.cnf b/mysql-test/suite/galera/t/MW-86-wait8.cnf index 8f6a760def0..98e724fb2d0 100644 --- a/mysql-test/suite/galera/t/MW-86-wait8.cnf +++ b/mysql-test/suite/galera/t/MW-86-wait8.cnf @@ -7,4 +7,3 @@ log-slave-updates [mysqld.2] log-bin log-slave-updates - diff --git a/mysql-test/suite/galera/t/create.test b/mysql-test/suite/galera/t/create.test index 96a6640c21f..01b78d1ff41 100644 --- a/mysql-test/suite/galera/t/create.test +++ b/mysql-test/suite/galera/t/create.test @@ -86,4 +86,3 @@ DROP TABLE t1, t2; --source include/galera_end.inc --echo # End of tests - diff --git a/mysql-test/suite/galera/t/galera_MDEV-29512.cnf b/mysql-test/suite/galera/t/galera_MDEV-29512.cnf index bf8e0c37984..136a8842a56 100644 --- a/mysql-test/suite/galera/t/galera_MDEV-29512.cnf +++ b/mysql-test/suite/galera/t/galera_MDEV-29512.cnf @@ -10,6 +10,4 @@ log_slave_updates max-binlog-size=4096 expire-logs-days=1 - [mysqld.2] - diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test b/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test index 97819384a75..4e17ddf2e4c 100644 --- a/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test +++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test @@ -20,7 +20,7 @@ INSERT INTO t1 VALUES (2); --connection node_1a SET SESSION wsrep_sync_wait = 0; ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock' +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --source include/wait_condition.inc SELECT COUNT(*) = 0 FROM t1; diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf index 4d93a1b2509..3b7a713c30c 100644 --- a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf +++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf @@ -9,6 +9,3 @@ wait_timeout=5 lock_wait_timeout=5 innodb_lock_wait_timeout=5 wait_timeout=5 - - - diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test index d62b6552973..9d9ec4bbee3 100644 --- a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test +++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test @@ -27,16 +27,16 @@ ALTER TABLE t1 ADD COLUMN f2 INTEGER; --connection node_1 SELECT 1 FROM DUAL; # Wait ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'; +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --source include/wait_condition.inc -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'; +SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); UNLOCK TABLES; SET SESSION wsrep_sync_wait = 15; SHOW CREATE TABLE t1; -SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock'; +SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_as_slave_ctas.test b/mysql-test/suite/galera/t/galera_as_slave_ctas.test index 32301a3d0d3..36d7f00ae87 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_ctas.test +++ b/mysql-test/suite/galera/t/galera_as_slave_ctas.test @@ -73,4 +73,3 @@ RESET SLAVE ALL; --connection node_3 RESET MASTER; - diff --git a/mysql-test/suite/galera/t/galera_backup_stage.test b/mysql-test/suite/galera/t/galera_backup_stage.test index ef0706f9ab1..2756ebcf719 100644 --- a/mysql-test/suite/galera/t/galera_backup_stage.test +++ b/mysql-test/suite/galera/t/galera_backup_stage.test @@ -56,7 +56,7 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10)); # reach commit stage. In the unlikely case the interleaving is different, the # result of the test should not change. --connection node_1c ---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id +--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (STATE LIKE '%committing%' OR STATE LIKE 'Commit' OR STATE LIKE 'Waiting for certification') AND ID=$insert_id --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id --source include/wait_condition.inc @@ -83,11 +83,11 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10)); # wait for insert to get blocked --connection node_1c ---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id +--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (STATE LIKE '%committing%' OR STATE LIKE 'Commit' OR STATE LIKE 'Waiting for certification') AND ID=$insert_id --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id --source include/wait_condition.inc ---let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND (State='Commit' or State='Waiting for certification') +--let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND (STATE LIKE '%committing%' OR STATE LIKE 'Commit' OR STATE LIKE 'Waiting for certification') --source include/wait_condition.inc # nothing after BLOCK_DDL is applied diff --git a/mysql-test/suite/galera/t/galera_bf_abort_at_after_statement.test b/mysql-test/suite/galera/t/galera_bf_abort_at_after_statement.test index 224db902569..5550c9a1c66 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort_at_after_statement.test +++ b/mysql-test/suite/galera/t/galera_bf_abort_at_after_statement.test @@ -55,4 +55,3 @@ DROP TABLE t1; --disconnect node_2a --disconnect node_2b - diff --git a/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test b/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test index fde783e2cef..1227abb10f6 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test +++ b/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test @@ -17,12 +17,12 @@ INSERT INTO t1 VALUES (2); --connection node_2 SET SESSION wsrep_sync_wait = 0; ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock' +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --source include/wait_condition.inc UNLOCK TABLES; ---let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock' +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --source include/wait_condition.inc COMMIT; diff --git a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf index 033e6f8b99a..fa33b09d739 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf +++ b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf @@ -1,5 +1 @@ !include ../galera_2nodes.cnf - -[mysqld.1] -wsrep-debug=1 -loose-galera-bf-abort-lock-table=1 diff --git a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test index 06009712c7b..652e89f8e57 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test +++ b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test @@ -1,6 +1,5 @@ --source include/galera_cluster.inc --source include/have_innodb.inc ---source include/force_restart.inc # # Test that a local LOCK TABLE will NOT be broken by an incoming remote transaction against that table @@ -18,13 +17,13 @@ INSERT INTO t1 VALUES (2); --connection node_2 SET SESSION wsrep_sync_wait = 0; ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock' +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST --source include/wait_condition_with_debug_and_kill.inc UNLOCK TABLES; ---let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock' +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST --source include/wait_condition_with_debug_and_kill.inc diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ps.cnf b/mysql-test/suite/galera/t/galera_bf_abort_ps.cnf index 34c1a8cc3cf..ee365a18340 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort_ps.cnf +++ b/mysql-test/suite/galera/t/galera_bf_abort_ps.cnf @@ -1,3 +1,4 @@ !include ../galera_2nodes.cnf + [mysqltest] -ps-protocol \ No newline at end of file +ps-protocol diff --git a/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf b/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf index 4101b4073ec..90f99fcdd21 100644 --- a/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf +++ b/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf @@ -5,5 +5,3 @@ innodb_stats_persistent=ON [mysqld.2] innodb_stats_persistent=ON - - diff --git a/mysql-test/suite/galera/t/galera_bf_background_statistics.test b/mysql-test/suite/galera/t/galera_bf_background_statistics.test index a9a98b1b567..0ffd4895f5b 100644 --- a/mysql-test/suite/galera/t/galera_bf_background_statistics.test +++ b/mysql-test/suite/galera/t/galera_bf_background_statistics.test @@ -46,4 +46,3 @@ ALTER TABLE t1 CHANGE f2 f2 INTEGER NOT NULL DEFAULT 1; --enable_query_log DROP TABLE t1; - diff --git a/mysql-test/suite/galera/t/galera_bf_kill.test b/mysql-test/suite/galera/t/galera_bf_kill.test index 1cb2e866cb4..6947733bb24 100644 --- a/mysql-test/suite/galera/t/galera_bf_kill.test +++ b/mysql-test/suite/galera/t/galera_bf_kill.test @@ -111,7 +111,7 @@ update t1 set a =5, b=2; --connection node_2b SET SESSION wsrep_sync_wait=0; ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table metadata lock'; +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'; --source include/wait_condition.inc --connection node_2a diff --git a/mysql-test/suite/galera/t/galera_bf_lock_wait.test b/mysql-test/suite/galera/t/galera_bf_lock_wait.test index 8ef2fee78ed..9ad3bbc36c6 100644 --- a/mysql-test/suite/galera/t/galera_bf_lock_wait.test +++ b/mysql-test/suite/galera/t/galera_bf_lock_wait.test @@ -95,4 +95,3 @@ drop procedure p1; --disconnect node_1_p2 --disconnect node_2_p1 --disconnect node_2_p2 - diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum.cnf b/mysql-test/suite/galera/t/galera_binlog_checksum.cnf index bd61ee67406..590cecf36bc 100644 --- a/mysql-test/suite/galera/t/galera_binlog_checksum.cnf +++ b/mysql-test/suite/galera/t/galera_binlog_checksum.cnf @@ -9,5 +9,3 @@ slave-sql-verify-checksum=1 binlog-checksum=CRC32 master-verify-checksum=1 slave-sql-verify-checksum=1 - - diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf index 9315086a3cc..5f0809ddf07 100644 --- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf +++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf @@ -4,6 +4,3 @@ binlog-row-event-max-size=4294967040 [mysqld.2] - - - diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf index 798435d8e54..5899387f52d 100644 --- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf +++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf @@ -4,6 +4,3 @@ binlog-row-event-max-size=256 [mysqld.2] - - - diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test index 00b55339770..43ea0932676 100644 --- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test +++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test @@ -12,4 +12,3 @@ INSERT INTO t1 VALUES (REPEAT('x', 1000)); SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('x', 1000); DROP TABLE t1; - diff --git a/mysql-test/suite/galera/t/galera_binlog_row_image.test b/mysql-test/suite/galera/t/galera_binlog_row_image.test index 70262ec44ca..5c544414b9e 100644 --- a/mysql-test/suite/galera/t/galera_binlog_row_image.test +++ b/mysql-test/suite/galera/t/galera_binlog_row_image.test @@ -94,7 +94,3 @@ SELECT COUNT(*) = 0 FROM t2; DROP TABLE t1; DROP TABLE t2; - - - - diff --git a/mysql-test/suite/galera/t/galera_change_user.test b/mysql-test/suite/galera/t/galera_change_user.test index 89efef1dbb0..5051b18eec6 100644 --- a/mysql-test/suite/galera/t/galera_change_user.test +++ b/mysql-test/suite/galera/t/galera_change_user.test @@ -26,4 +26,3 @@ reset_connection; --connection node_1 DROP TABLE t1; DROP USER user1; - diff --git a/mysql-test/suite/galera/t/galera_concurrent_ctas.test b/mysql-test/suite/galera/t/galera_concurrent_ctas.test index ed579f19a0d..199cd727df0 100644 --- a/mysql-test/suite/galera/t/galera_concurrent_ctas.test +++ b/mysql-test/suite/galera/t/galera_concurrent_ctas.test @@ -98,4 +98,3 @@ DROP TABLE t1; --source include/galera_end.inc --echo # End of test - diff --git a/mysql-test/suite/galera/t/galera_ddl_fk_conflict.cnf b/mysql-test/suite/galera/t/galera_ddl_fk_conflict.cnf index 2975070498e..106d79a503e 100644 --- a/mysql-test/suite/galera/t/galera_ddl_fk_conflict.cnf +++ b/mysql-test/suite/galera/t/galera_ddl_fk_conflict.cnf @@ -7,5 +7,3 @@ loose-galera-ddl-fk-conflict=1 [mysqld.2] wsrep-debug=1 loose-galera-ddl-fk-conflict=1 - - diff --git a/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test b/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test index a8fb6614e41..22da69dfc24 100644 --- a/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test +++ b/mysql-test/suite/galera/t/galera_ddl_fk_conflict.test @@ -43,4 +43,3 @@ SET SESSION wsrep_sync_wait=0; --source galera_ddl_fk_conflict_with_tmp.inc # CHECK and ANALYZE are not affected - diff --git a/mysql-test/suite/galera/t/galera_ddl_multiline.test b/mysql-test/suite/galera/t/galera_ddl_multiline.test index c7155d066fa..dc69dfd186f 100644 --- a/mysql-test/suite/galera/t/galera_ddl_multiline.test +++ b/mysql-test/suite/galera/t/galera_ddl_multiline.test @@ -51,4 +51,3 @@ SHOW CREATE TABLE t6; --connection node_1 DROP TABLE t1, t2, t3, t4, t5, t6; - diff --git a/mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf b/mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf index 0f7f80b7d0b..a26c4b30b00 100644 --- a/mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf +++ b/mysql-test/suite/galera/t/galera_encrypt_tmp_files.cnf @@ -1,6 +1,6 @@ !include ../galera_2nodes.cnf -[mysqld] +[mysqld] encrypt-tmp-files = 1 plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO file-key-management diff --git a/mysql-test/suite/galera/t/galera_forced_binlog_format.test b/mysql-test/suite/galera/t/galera_forced_binlog_format.test index 786837239ed..2866d6fee88 100644 --- a/mysql-test/suite/galera/t/galera_forced_binlog_format.test +++ b/mysql-test/suite/galera/t/galera_forced_binlog_format.test @@ -49,4 +49,3 @@ DROP DATABASE testdb_9401; #--source include/galera_end.inc --echo # End of tests - diff --git a/mysql-test/suite/galera/t/galera_gcs_fragment.cnf b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf index aae3fee5904..5d7bbf7b053 100644 --- a/mysql-test/suite/galera/t/galera_gcs_fragment.cnf +++ b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf @@ -1,5 +1,7 @@ !include ../galera_2nodes.cnf + [mysqld.1] wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64' + [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64' diff --git a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf index 6bb11e5957a..7e7c99ecb63 100644 --- a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf +++ b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf @@ -1,5 +1,7 @@ !include ../galera_2nodes.cnf + [mysqld.1] wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64;gcache.size=10M' + [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_gtid.cnf b/mysql-test/suite/galera/t/galera_gtid.cnf index 8f6a760def0..98e724fb2d0 100644 --- a/mysql-test/suite/galera/t/galera_gtid.cnf +++ b/mysql-test/suite/galera/t/galera_gtid.cnf @@ -7,4 +7,3 @@ log-slave-updates [mysqld.2] log-bin log-slave-updates - diff --git a/mysql-test/suite/galera/t/galera_gtid_server_id.cnf b/mysql-test/suite/galera/t/galera_gtid_server_id.cnf index bda7a00ab2e..76887d5c189 100644 --- a/mysql-test/suite/galera/t/galera_gtid_server_id.cnf +++ b/mysql-test/suite/galera/t/galera_gtid_server_id.cnf @@ -13,4 +13,3 @@ wsrep_gtid_mode=ON server-id=12 log_slave_updates log_bin - diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.cnf b/mysql-test/suite/galera/t/galera_gtid_slave.cnf index 112c487851f..5d242f01707 100644 --- a/mysql-test/suite/galera/t/galera_gtid_slave.cnf +++ b/mysql-test/suite/galera/t/galera_gtid_slave.cnf @@ -4,13 +4,16 @@ log-bin=mysqld-bin log-slave-updates binlog-format=ROW + [mysqld.1] gtid-domain-id=1 wsrep_gtid_mode=1 wsrep_gtid_domain_id=1 + [mysqld.2] gtid-domain-id=1 wsrep_gtid_mode=1 wsrep_gtid_domain_id=1 + [mysqld.3] gtid-domain-id=2 diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf index efeb536de96..2b05acfde01 100644 --- a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf +++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf @@ -5,14 +5,16 @@ log-bin=mysqld-bin log-slave-updates binlog-format=ROW wsrep_sst_method=rsync + [mysqld.1] gtid-domain-id=1 wsrep_gtid_mode=1 wsrep_gtid_domain_id=1 + [mysqld.2] gtid-domain-id=1 wsrep_gtid_mode=1 wsrep_gtid_domain_id=1 + [mysqld.3] gtid-domain-id=2 - diff --git a/mysql-test/suite/galera/t/galera_gtid_trx_conflict.cnf b/mysql-test/suite/galera/t/galera_gtid_trx_conflict.cnf index 5f129e7c168..1422f977bf7 100644 --- a/mysql-test/suite/galera/t/galera_gtid_trx_conflict.cnf +++ b/mysql-test/suite/galera/t/galera_gtid_trx_conflict.cnf @@ -4,10 +4,12 @@ log-bin=mysqld-bin log-slave-updates binlog-format=ROW + [mysqld.1] gtid-domain-id=1 wsrep_gtid_mode=1 wsrep_gtid_domain_id=1 + [mysqld.2] gtid-domain-id=1 wsrep_gtid_mode=1 diff --git a/mysql-test/suite/galera/t/galera_insert_ignore.test b/mysql-test/suite/galera/t/galera_insert_ignore.test index 027f70e96d9..4d500ab7b4e 100644 --- a/mysql-test/suite/galera/t/galera_insert_ignore.test +++ b/mysql-test/suite/galera/t/galera_insert_ignore.test @@ -57,4 +57,3 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; --eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig - diff --git a/mysql-test/suite/galera/t/galera_insert_multi.test b/mysql-test/suite/galera/t/galera_insert_multi.test index d62283aff69..35205921283 100644 --- a/mysql-test/suite/galera/t/galera_insert_multi.test +++ b/mysql-test/suite/galera/t/galera_insert_multi.test @@ -113,10 +113,3 @@ SELECT COUNT(*) = 2 FROM t1; SELECT COUNT(*) = 2 FROM t1; DROP TABLE t1; - - - - - - - diff --git a/mysql-test/suite/galera/t/galera_ist_progress.cnf b/mysql-test/suite/galera/t/galera_ist_progress.cnf index b37e7f38ce3..10958aad9a8 100644 --- a/mysql-test/suite/galera/t/galera_ist_progress.cnf +++ b/mysql-test/suite/galera/t/galera_ist_progress.cnf @@ -2,6 +2,3 @@ [mysqld.1] wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' - - - diff --git a/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf index 2628f05eaef..035fb0769b7 100644 --- a/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf +++ b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf @@ -5,4 +5,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;ist.recv_bind=127.0.0.1 [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;ist.recv_bind=127.0.0.1' - diff --git a/mysql-test/suite/galera/t/galera_kill_applier.cnf b/mysql-test/suite/galera/t/galera_kill_applier.cnf index 62cf1854032..18a80b22fb6 100644 --- a/mysql-test/suite/galera/t/galera_kill_applier.cnf +++ b/mysql-test/suite/galera/t/galera_kill_applier.cnf @@ -1,7 +1,9 @@ !include ../galera_2nodes.cnf [mysqld.1] +wsrep_slave_threads=1 wsrep-debug=1 [mysqld.2] +wsrep_slave_threads=1 wsrep-debug=1 diff --git a/mysql-test/suite/galera/t/galera_load_data.test b/mysql-test/suite/galera/t/galera_load_data.test index 252580f9426..24cd55c4ae0 100644 --- a/mysql-test/suite/galera/t/galera_load_data.test +++ b/mysql-test/suite/galera/t/galera_load_data.test @@ -397,4 +397,3 @@ SELECT data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_t --connection node_1 use test; drop database cardtest02; - diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.cnf b/mysql-test/suite/galera/t/galera_mdev_13787.cnf index ada78e1db2a..5f954d5ccba 100644 --- a/mysql-test/suite/galera/t/galera_mdev_13787.cnf +++ b/mysql-test/suite/galera/t/galera_mdev_13787.cnf @@ -5,5 +5,3 @@ innodb-stats-persistent=1 [mysqld.2] innodb-stats-persistent=1 - - diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.test b/mysql-test/suite/galera/t/galera_mdev_13787.test index 940cffb8b65..458d7f1d5d4 100644 --- a/mysql-test/suite/galera/t/galera_mdev_13787.test +++ b/mysql-test/suite/galera/t/galera_mdev_13787.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/have_innodb.inc + --connection node_1 create table t(a int); insert into t select 1; diff --git a/mysql-test/suite/galera/t/galera_mdev_15611.cnf b/mysql-test/suite/galera/t/galera_mdev_15611.cnf index b6f601c56b1..1d9f793beff 100644 --- a/mysql-test/suite/galera/t/galera_mdev_15611.cnf +++ b/mysql-test/suite/galera/t/galera_mdev_15611.cnf @@ -1,4 +1,5 @@ !include ../galera_2nodes.cnf + [mysqld.1] [mysqld.2] diff --git a/mysql-test/suite/galera/t/galera_mdl_race.test b/mysql-test/suite/galera/t/galera_mdl_race.test index 3341a3792f1..9d6babea0b3 100644 --- a/mysql-test/suite/galera/t/galera_mdl_race.test +++ b/mysql-test/suite/galera/t/galera_mdl_race.test @@ -91,4 +91,3 @@ SET DEBUG_SYNC = "RESET"; --disconnect node_1a --disconnect node_1b --disconnect node_1c - diff --git a/mysql-test/suite/galera/t/galera_nonPK_and_PA.test b/mysql-test/suite/galera/t/galera_nonPK_and_PA.test index 8a5173f576b..dbd516e9b31 100644 --- a/mysql-test/suite/galera/t/galera_nonPK_and_PA.test +++ b/mysql-test/suite/galera/t/galera_nonPK_and_PA.test @@ -164,5 +164,6 @@ SET GLOBAL wsrep_slave_threads = DEFAULT; DROP TABLE t1; DROP TABLE t2; + --connection node_2 SET GLOBAL wsrep_slave_threads = DEFAULT; diff --git a/mysql-test/suite/galera/t/galera_nopk_unicode.test b/mysql-test/suite/galera/t/galera_nopk_unicode.test index e036e14ebe0..8e98f1e5e47 100644 --- a/mysql-test/suite/galera/t/galera_nopk_unicode.test +++ b/mysql-test/suite/galera/t/galera_nopk_unicode.test @@ -39,5 +39,4 @@ COMMIT; SELECT f1 = 'текст2' FROM t1; SELECT f1 = 'текст2' FROM t1 WHERE f1 = 'текст2'; - DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test index 2e9f05cb4af..52226850532 100644 --- a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test +++ b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test @@ -29,11 +29,13 @@ INSERT INTO t2 VALUES (1); --let $galera_connection_name = node_2a --let $galera_server_number = 2 --source include/galera_connect.inc + --connection node_2a --sleep 1 SET SESSION wsrep_sync_wait=0; -SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); -SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE '%committing%' OR STATE LIKE 'Commit' OR STATE LIKE 'Waiting for certification'); +SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); + SELECT COUNT(*) AS EXPECT_0 FROM t1; SELECT COUNT(*) AS EXPECT_0 FROM t2; @@ -44,8 +46,11 @@ UNLOCK TABLES; --eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig; SELECT COUNT(*) AS EXPECT_1 FROM t1; SELECT COUNT(*) AS EXPECT_1 FROM t2; -SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification'); +SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE '%committed%' OR STATE LIKE 'Waiting for certification'); +--disable_query_log --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; +--enable_query_log + DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test index df0200fab55..f7d1c2c1e62 100644 --- a/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test +++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test @@ -67,4 +67,3 @@ SELECT COUNT(DISTINCT f1) AS EXPECT_30000 FROM t1; --connection default DROP TABLE t1; DROP TABLE ten; - diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test index 587fbe10fe4..a3e2f249e2f 100644 --- a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test +++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test @@ -91,5 +91,3 @@ SELECT COUNT(DISTINCT f1) FROM t1; DROP TABLE t1; DROP TABLE ten; DROP PROCEDURE p1; - - diff --git a/mysql-test/suite/galera/t/galera_parallel_simple.test b/mysql-test/suite/galera/t/galera_parallel_simple.test index a305473dbbb..074af301671 100644 --- a/mysql-test/suite/galera/t/galera_parallel_simple.test +++ b/mysql-test/suite/galera/t/galera_parallel_simple.test @@ -48,10 +48,10 @@ INSERT INTO t2 select * from t2; --connection node_2 SET SESSION wsrep_sync_wait = 0; ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%'; +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --source include/wait_condition.inc ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE '%committing%' OR STATE LIKE 'Commit' OR STATE LIKE 'Waiting for certification'); --source include/wait_condition.inc UNLOCK TABLES; @@ -61,7 +61,9 @@ SET SESSION wsrep_sync_wait = 15; SELECT COUNT(*) as expect_20 FROM t1; SELECT COUNT(*) as expect_20 FROM t2; +--disable_query_log --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; +--enable_query_log DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf b/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf index ae48aa3ae0f..8734323a2d6 100644 --- a/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf +++ b/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf @@ -8,4 +8,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' - diff --git a/mysql-test/suite/galera/t/galera_query_cache.cnf b/mysql-test/suite/galera/t/galera_query_cache.cnf index 80f40b0997e..5f37e357a52 100644 --- a/mysql-test/suite/galera/t/galera_query_cache.cnf +++ b/mysql-test/suite/galera/t/galera_query_cache.cnf @@ -7,4 +7,3 @@ query_cache_size=1355776 [mysqld.2] query_cache_type=1 query_cache_size=1355776 - diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf index 80f40b0997e..5f37e357a52 100644 --- a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf +++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf @@ -7,4 +7,3 @@ query_cache_size=1355776 [mysqld.2] query_cache_type=1 query_cache_size=1355776 - diff --git a/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test b/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test index 8749c20faed..5d12ad1c1c4 100644 --- a/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test +++ b/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test @@ -25,7 +25,6 @@ UPDATE t2 SET f1 = REPEAT('b', 256); SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 234; SELECT COUNT(*) = 1 FROM t2 WHERE f1 = REPEAT('b', 256); - --disable_query_log --eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; --enable_query_log diff --git a/mysql-test/suite/galera/t/galera_restart_nochanges.test b/mysql-test/suite/galera/t/galera_restart_nochanges.test index 0a6a0c5ccbe..8ca80649d3f 100644 --- a/mysql-test/suite/galera/t/galera_restart_nochanges.test +++ b/mysql-test/suite/galera/t/galera_restart_nochanges.test @@ -37,4 +37,3 @@ DROP TABLE t1; --source include/auto_increment_offset_restore.inc --source include/galera_end.inc - diff --git a/mysql-test/suite/galera/t/galera_restart_replica.cnf b/mysql-test/suite/galera/t/galera_restart_replica.cnf index 6713e301527..cb2a7998ec6 100644 --- a/mysql-test/suite/galera/t/galera_restart_replica.cnf +++ b/mysql-test/suite/galera/t/galera_restart_replica.cnf @@ -17,4 +17,3 @@ wsrep_gtid_mode=1 wsrep_gtid_domain_id=16 gtid_domain_id=11 gtid_strict_mode=1 - diff --git a/mysql-test/suite/galera/t/galera_savepoint_replay.test b/mysql-test/suite/galera/t/galera_savepoint_replay.test index cff26f4a94f..d8b04847a2b 100644 --- a/mysql-test/suite/galera/t/galera_savepoint_replay.test +++ b/mysql-test/suite/galera/t/galera_savepoint_replay.test @@ -83,4 +83,3 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; DROP TABLE t1; - diff --git a/mysql-test/suite/galera/t/galera_server.test b/mysql-test/suite/galera/t/galera_server.test index 30b39028b96..36687402d4e 100644 --- a/mysql-test/suite/galera/t/galera_server.test +++ b/mysql-test/suite/galera/t/galera_server.test @@ -25,4 +25,3 @@ SELECT COUNT(*)=0 FROM mysql.servers; --source include/galera_end.inc --echo # End of test - diff --git a/mysql-test/suite/galera/t/galera_set_position_after_cert_failure.test b/mysql-test/suite/galera/t/galera_set_position_after_cert_failure.test index 4dfddb0f32a..a7f26e28aca 100644 --- a/mysql-test/suite/galera/t/galera_set_position_after_cert_failure.test +++ b/mysql-test/suite/galera/t/galera_set_position_after_cert_failure.test @@ -95,4 +95,5 @@ if ($galera_wsrep_start_position != $expected_position) --connection node_1 DROP TABLE t1; SET GLOBAL wsrep_slave_threads = DEFAULT; + --source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_sp_bf_abort.inc b/mysql-test/suite/galera/t/galera_sp_bf_abort.inc index 58345184e98..a3c8c16209d 100644 --- a/mysql-test/suite/galera/t/galera_sp_bf_abort.inc +++ b/mysql-test/suite/galera/t/galera_sp_bf_abort.inc @@ -35,4 +35,3 @@ --source include/galera_signal_sync_point.inc --let $galera_sync_point = after_replicate_sync --source include/galera_signal_sync_point.inc - diff --git a/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test b/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test index cd8d6ba6426..c8c46b25e1c 100644 --- a/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test +++ b/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test @@ -17,7 +17,6 @@ SET SESSION sql_log_bin = 1; INSERT INTO t1 VALUES (2); - --connection node_2 SELECT COUNT(*) = 2 FROM t1; SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; diff --git a/mysql-test/suite/galera/t/galera_status_cluster.test b/mysql-test/suite/galera/t/galera_status_cluster.test index 3299613d584..0c2260321e9 100644 --- a/mysql-test/suite/galera/t/galera_status_cluster.test +++ b/mysql-test/suite/galera/t/galera_status_cluster.test @@ -14,5 +14,3 @@ SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; - - diff --git a/mysql-test/suite/galera/t/galera_status_local_index.test b/mysql-test/suite/galera/t/galera_status_local_index.test index b61b8ced863..3e15911537a 100644 --- a/mysql-test/suite/galera/t/galera_status_local_index.test +++ b/mysql-test/suite/galera/t/galera_status_local_index.test @@ -12,7 +12,6 @@ INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_ --connection node_2 INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index')); - --connection node_1 SELECT COUNT(*) = 2 FROM wsrep_local_indexes; SELECT COUNT(DISTINCT wsrep_local_index) = 2 FROM wsrep_local_indexes; diff --git a/mysql-test/suite/galera/t/galera_status_local_state.test b/mysql-test/suite/galera/t/galera_status_local_state.test index 09cdb25f80c..6401c32082f 100644 --- a/mysql-test/suite/galera/t/galera_status_local_state.test +++ b/mysql-test/suite/galera/t/galera_status_local_state.test @@ -22,7 +22,3 @@ SET GLOBAL wsrep_desync = 0; --source include/wait_condition.inc SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; - - - - diff --git a/mysql-test/suite/galera/t/galera_suspend_slave.test b/mysql-test/suite/galera/t/galera_suspend_slave.test index 0f95bcd4531..9a238e59f30 100644 --- a/mysql-test/suite/galera/t/galera_suspend_slave.test +++ b/mysql-test/suite/galera/t/galera_suspend_slave.test @@ -67,4 +67,3 @@ DROP TABLE t1; # Restore original auto_increment_offset values. --let $node_2=node_2a --source include/auto_increment_offset_restore.inc - diff --git a/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt b/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt index 0b35236062b..93b3d5bfdaf 100644 --- a/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt +++ b/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt @@ -1 +1 @@ ---wsrep-sync-wait=0 --wsrep-causal-reads=OFF \ No newline at end of file +--wsrep-sync-wait=0 --wsrep-causal-reads=OFF diff --git a/mysql-test/suite/galera/t/galera_table_with_hyphen.inc b/mysql-test/suite/galera/t/galera_table_with_hyphen.inc index ac79d864e82..f53a08cd401 100644 --- a/mysql-test/suite/galera/t/galera_table_with_hyphen.inc +++ b/mysql-test/suite/galera/t/galera_table_with_hyphen.inc @@ -45,4 +45,3 @@ SET GLOBAL wsrep_slave_threads=DEFAULT; --connection node_2 --eval drop table `$fk_child` --eval drop table `$fk_parent` - diff --git a/mysql-test/suite/galera/t/galera_temporary_sequences.test b/mysql-test/suite/galera/t/galera_temporary_sequences.test index c46c4243514..a85124950af 100644 --- a/mysql-test/suite/galera/t/galera_temporary_sequences.test +++ b/mysql-test/suite/galera/t/galera_temporary_sequences.test @@ -30,7 +30,6 @@ SELECT * FROM t; SHOW CREATE TABLE seq1; SHOW CREATE TABLE seq2; - --connection node_1 DROP TABLE t; DROP SEQUENCE seq1; diff --git a/mysql-test/suite/galera/t/galera_threadpool.cnf b/mysql-test/suite/galera/t/galera_threadpool.cnf index c1a1e6a81aa..0ef20a3abb9 100644 --- a/mysql-test/suite/galera/t/galera_threadpool.cnf +++ b/mysql-test/suite/galera/t/galera_threadpool.cnf @@ -13,5 +13,3 @@ log_bin=binlog log_slave_updates=ON wsrep_sst_method=rsync thread_handling = pool-of-threads - - diff --git a/mysql-test/suite/galera/t/galera_toi_ftwrl.test b/mysql-test/suite/galera/t/galera_toi_ftwrl.test index 4d0edefda8e..25a3de20847 100644 --- a/mysql-test/suite/galera/t/galera_toi_ftwrl.test +++ b/mysql-test/suite/galera/t/galera_toi_ftwrl.test @@ -19,4 +19,3 @@ UNLOCK TABLES; SHOW CREATE TABLE t1; DROP TABLE t1; - diff --git a/mysql-test/suite/galera/t/galera_transaction_read_only.test b/mysql-test/suite/galera/t/galera_transaction_read_only.test index 386d73fd3ca..65c65deda45 100644 --- a/mysql-test/suite/galera/t/galera_transaction_read_only.test +++ b/mysql-test/suite/galera/t/galera_transaction_read_only.test @@ -55,4 +55,3 @@ COMMIT; --enable_query_log DROP TABLE t1; - diff --git a/mysql-test/suite/galera/t/galera_udf.cnf b/mysql-test/suite/galera/t/galera_udf.cnf index 69d5acd65f3..16477960835 100644 --- a/mysql-test/suite/galera/t/galera_udf.cnf +++ b/mysql-test/suite/galera/t/galera_udf.cnf @@ -6,10 +6,3 @@ query_cache_type=1 [mysqld.2] query_cache_type=1 - - - - - - - diff --git a/mysql-test/suite/galera/t/galera_unicode_identifiers.test b/mysql-test/suite/galera/t/galera_unicode_identifiers.test index c0c95768650..79f6a72cfdc 100644 --- a/mysql-test/suite/galera/t/galera_unicode_identifiers.test +++ b/mysql-test/suite/galera/t/galera_unicode_identifiers.test @@ -75,4 +75,3 @@ DROP DATABASE `database with space`; DROP DATABASE `база`; DROP DATABASE `втора база`; --eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig - diff --git a/mysql-test/suite/galera/t/galera_v1_row_events.cnf b/mysql-test/suite/galera/t/galera_v1_row_events.cnf index b95e321ad4f..cfb3782832b 100644 --- a/mysql-test/suite/galera/t/galera_v1_row_events.cnf +++ b/mysql-test/suite/galera/t/galera_v1_row_events.cnf @@ -4,10 +4,3 @@ log-bin-use-v1-row-events=1 [mysqld.2] - - - - - - - diff --git a/mysql-test/suite/galera/t/galera_var_OSU_method2.test b/mysql-test/suite/galera/t/galera_var_OSU_method2.test index 099e2cc6612..5117f87b647 100644 --- a/mysql-test/suite/galera/t/galera_var_OSU_method2.test +++ b/mysql-test/suite/galera/t/galera_var_OSU_method2.test @@ -44,4 +44,3 @@ SET DEBUG_SYNC= 'RESET'; --connection node_1a SET DEBUG_SYNC= 'RESET'; - diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf index 523bae68763..25da46fc009 100644 --- a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf +++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf @@ -5,9 +5,3 @@ wsrep-auto-increment-control=ON [mysqld.2] wsrep-auto-increment-control=ON - - - - - - diff --git a/mysql-test/suite/galera/t/galera_var_slave_threads.test b/mysql-test/suite/galera/t/galera_var_slave_threads.test index 66909baff07..1a3a038a971 100644 --- a/mysql-test/suite/galera/t/galera_var_slave_threads.test +++ b/mysql-test/suite/galera/t/galera_var_slave_threads.test @@ -15,11 +15,15 @@ --connection node_1 --let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` + CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; CREATE TABLE t2 (f1 INT AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB; --connection node_2 +--let $wsrep_slave_threads_orig_2 = `SELECT @@wsrep_slave_threads` + CALL mtr.add_suppression("WSREP: Refusing exit for the last slave thread\\."); + # Setting wsrep_slave_threads to zero triggers a warning SET GLOBAL wsrep_slave_threads = 0; SHOW WARNINGS; @@ -74,7 +78,9 @@ SELECT COUNT(*) FROM t2; --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; --source include/wait_condition.inc ---eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig +--disable_query_log +--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig_2; +--enable_query_log DROP TABLE t1; DROP TABLE t2; @@ -94,6 +100,11 @@ SET GLOBAL wsrep_slave_threads = 4; SET GLOBAL wsrep_slave_threads = 1; --connection node_1 + +--disable_query_log +--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; +--enable_query_log + INSERT INTO t1 VALUES (DEFAULT); INSERT INTO t1 VALUES (DEFAULT); INSERT INTO t1 VALUES (DEFAULT); @@ -106,6 +117,10 @@ DROP TABLE t1; --connection node_2 +--disable_query_log +--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig_2; +--enable_query_log + # Wait until above DDL is replicated # # make sure that we are left with exactly one applier thread before we leaving the test diff --git a/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf b/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf index 202aa4ce1c8..f549aeedf30 100644 --- a/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf +++ b/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf @@ -14,4 +14,3 @@ wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2' [mysqld.4] wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2' - diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf index 440c37bea81..db7e2bd973c 100644 --- a/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf +++ b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf @@ -5,8 +5,3 @@ wsrep_log_conflicts=ON [mysqld.2] wsrep_log_conflicts=ON - - - - - diff --git a/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test index c70dede09a3..5cfcffce475 100644 --- a/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test +++ b/mysql-test/suite/galera/t/galera_wsrep_provider_options_syntax.test @@ -3,6 +3,7 @@ # --source include/galera_cluster.inc --source include/have_innodb.inc + --let LOGF=$MYSQLTEST_VARDIR/log/mysqld.1.err --disable_info call mtr.add_suppression("WSREP: Unknown parameter 'gmcasts\\.segment'"); diff --git a/mysql-test/suite/galera/t/mdev-31285.test b/mysql-test/suite/galera/t/mdev-31285.test index 5abef37cccd..3e5f5a48cf5 100644 --- a/mysql-test/suite/galera/t/mdev-31285.test +++ b/mysql-test/suite/galera/t/mdev-31285.test @@ -11,5 +11,3 @@ CREATE TABLE t ENGINE=InnoDB WITH SYSTEM VERSIONING AS SELECT 1 AS i; --connection node_2 --error ER_NO_SUCH_TABLE SHOW CREATE TABLE t; - - diff --git a/mysql-test/suite/galera/t/mysql-wsrep#198.cnf b/mysql-test/suite/galera/t/mysql-wsrep#198.cnf index bbeb0e31c31..4c62448fe3d 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#198.cnf +++ b/mysql-test/suite/galera/t/mysql-wsrep#198.cnf @@ -2,5 +2,3 @@ [mysqld] log-bin -wsrep-debug=1 -loose-mysql-wsrep198=1 diff --git a/mysql-test/suite/galera/t/mysql-wsrep#198.test b/mysql-test/suite/galera/t/mysql-wsrep#198.test index aba05ed8bf9..dceae6e17e9 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#198.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#198.test @@ -1,6 +1,5 @@ --source include/galera_cluster.inc --source include/have_innodb.inc ---source include/force_restart.inc CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB; @@ -21,7 +20,7 @@ LOCK TABLE t2 WRITE; --connection node_2 SET SESSION wsrep_sync_wait = 0; ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'Waiting for table metadata lock' +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'; --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST --source include/wait_condition_with_debug_and_kill.inc diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201.cnf b/mysql-test/suite/galera/t/mysql-wsrep#201.cnf index 4a82e9fa037..bea5b606e3e 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#201.cnf +++ b/mysql-test/suite/galera/t/mysql-wsrep#201.cnf @@ -5,5 +5,3 @@ query_cache_type=1 [mysqld.2] query_cache_type=1 - - diff --git a/mysql-test/suite/galera/t/mysql-wsrep#247.test b/mysql-test/suite/galera/t/mysql-wsrep#247.test index 8bcd58607a1..2f348029407 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#247.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#247.test @@ -20,4 +20,3 @@ SET GLOBAL wsrep_desync=0; --sleep 1 DROP TABLE t1; SHOW VARIABLES LIKE 'wsrep_desync'; - diff --git a/mysql-test/suite/galera/t/mysql-wsrep#31.test b/mysql-test/suite/galera/t/mysql-wsrep#31.test index c669d4834ba..1924bc4a11c 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#31.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#31.test @@ -49,5 +49,3 @@ DROP DATABASE db; --source include/auto_increment_offset_restore.inc --source include/galera_end.inc - - diff --git a/mysql-test/suite/galera/t/mysql-wsrep#33.cnf b/mysql-test/suite/galera/t/mysql-wsrep#33.cnf index f1c3d802e4b..f1d42cd791f 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#33.cnf +++ b/mysql-test/suite/galera/t/mysql-wsrep#33.cnf @@ -5,4 +5,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' - diff --git a/mysql-test/suite/galera/t/mysql-wsrep#332.test b/mysql-test/suite/galera/t/mysql-wsrep#332.test index 464156e832e..dcbbca89f25 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#332.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#332.test @@ -216,4 +216,3 @@ SELECT * FROM c; DROP TABLE c; DROP TABLE p1; DROP TABLE p2; - diff --git a/mysql-test/suite/galera/t/rename.test b/mysql-test/suite/galera/t/rename.test index 326d64d3b8a..b56caa1531f 100644 --- a/mysql-test/suite/galera/t/rename.test +++ b/mysql-test/suite/galera/t/rename.test @@ -50,4 +50,3 @@ DROP USER foo@localhost; DROP TABLE t2; --echo # End of tests - diff --git a/mysql-test/suite/galera/t/view.test b/mysql-test/suite/galera/t/view.test index fa2cd8b2a67..a6f94941ba0 100644 --- a/mysql-test/suite/galera/t/view.test +++ b/mysql-test/suite/galera/t/view.test @@ -47,4 +47,3 @@ DROP VIEW v1, v2, v3, v4; DROP TABLE t1; --echo # End of tests - diff --git a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result index 087f9e7e279..a38e14c40a2 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result +++ b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result @@ -26,7 +26,7 @@ connection node_3; SELECT f1 = 111 FROM t1; f1 = 111 1 -SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%'; +SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE '%committed%' OR STATE LIKE 'Waiting for certification'); COUNT(*) IN (1, 2) 1 SET GLOBAL wsrep_slave_threads = DEFAULT; diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm index ff1ba0a566f..9f45e22d459 100644 --- a/mysql-test/suite/galera_3nodes/suite.pm +++ b/mysql-test/suite/galera_3nodes/suite.pm @@ -10,58 +10,58 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), - qr(WSREP: Could not open saved state file for reading: .*), - qr(WSREP: Could not open state file for reading: .*), + qr(WSREP: Could not open saved state file for reading: ), + qr(WSREP: Could not open state file for reading: ), qr(WSREP: Gap in state sequence\. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), - qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, + qr(WSREP: Releasing seqno [0-9]+ before [0-9]+ was assigned\.), + qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), - qr|WSREP: discarding established \(time wait\) .*|, + qr|WSREP: discarding established \(time wait\) |, qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), - qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, + qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: Transport endpoint is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), - qr(WSREP: Maximum writeset size exceeded by .*), - qr(WSREP: transaction size exceeded.*), - qr(WSREP: RBR event .*), - qr(WSREP: Ignoring error for TO isolated action: .*), - qr(WSREP: transaction size limit .*), - qr(WSREP: rbr write fail, .*), - qr(WSREP: .*Backend not supported: foo.*), - qr(WSREP: .*Failed to initialize backend using .*), - qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: Maximum writeset size exceeded by ), + qr(WSREP: transaction size exceeded), + qr(WSREP: RBR event ), + qr(WSREP: Ignoring error for TO isolated action: ), + qr(WSREP: transaction size limit ), + qr(WSREP: rbr write fail, ), + qr(WSREP: .*Backend not supported: foo), + qr(WSREP: .*Failed to initialize backend using ), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Socket type not supported), qr(WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 .*), - qr(WSREP: .*Failed to open backend connection: -110 .*), - qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: .*Failed to open backend connection: -110 ), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), - qr(WSREP: TO isolation failed for: .*), - qr|WSREP: gcs_caused\(\) returned .*|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored\.|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored\.|, + qr(WSREP: TO isolation failed for: ), + qr|WSREP: gcs_caused\(\) returned |, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), - qr(WSREP: discarding established .*), - qr|WSREP: .*core_handle_uuid_msg.*|, + qr(WSREP: discarding established ), + qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, - qr|WSREP: .*Query apply failed:.*|, - qr(WSREP: Ignoring error.*), - qr(WSREP: Failed to remove page file .*), - qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), + qr|WSREP: .*Query apply failed:|, + qr(WSREP: Ignoring error), + qr(WSREP: Failed to remove page file ), + qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to ), qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, qr|WSREP: Trying to continue unpaused monitor|, diff --git a/mysql-test/suite/galera_3nodes/t/galera-features#119.test b/mysql-test/suite/galera_3nodes/t/galera-features#119.test index 0effe780a22..a9f96ddce7c 100644 --- a/mysql-test/suite/galera_3nodes/t/galera-features#119.test +++ b/mysql-test/suite/galera_3nodes/t/galera-features#119.test @@ -66,6 +66,5 @@ CALL mtr.add_suppression("WSREP: Event 3 Write_rows_v1 apply failed: 121, seqno" CALL mtr.add_suppression("WSREP: Node consistency compromized, leaving cluster\\.\\.\\."); CALL mtr.add_suppression("WSREP: Failed to apply write set: "); - # Restore original auto_increment_offset values. --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test index b4fe10bff0d..e5646d98427 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test +++ b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test @@ -50,4 +50,3 @@ DROP TABLE t1; --source ../galera/include/auto_increment_offset_restore.inc --source include/galera_end.inc - diff --git a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test index c52bebc7019..c36cce61f23 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test +++ b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test @@ -87,5 +87,6 @@ SELECT COUNT(*) FROM t1; --source include/wait_condition.inc DROP TABLE t1; + # Restore original auto_increment_offset values. --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test index 84629c96c65..61708f7ec6c 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test +++ b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test @@ -65,7 +65,7 @@ SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue'; --connection node_3 SELECT f1 = 111 FROM t1; -SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%'; +SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE '%committed%' OR STATE LIKE 'Waiting for certification'); SET GLOBAL wsrep_slave_threads = DEFAULT; diff --git a/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.test b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.test index 7d8089a8ceb..9b0b5599709 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.test +++ b/mysql-test/suite/galera_3nodes/t/galera_wsrep_schema_init.test @@ -55,4 +55,3 @@ SELECT node_incoming_address LIKE '127.0.0.1:%' from mysql.wsrep_cluster_members SELECT cluster_uuid = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_state_uuid') FROM mysql.wsrep_cluster_members; --source ../galera/include/auto_increment_offset_restore.inc - diff --git a/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.cnf b/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.cnf index ae2cf8068f5..340fe700e2b 100644 --- a/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.cnf +++ b/mysql-test/suite/galera_3nodes/t/inconsistency_shutdown.cnf @@ -5,5 +5,4 @@ wsrep-slave-threads=8 wsrep-ignore-apply-errors=0 [ENV] -galera_cluster_size = 3 - +galera_cluster_size=3 diff --git a/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result b/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result index 08e3fc6c3e3..404e909e956 100644 --- a/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result +++ b/mysql-test/suite/galera_3nodes_sr/r/galera_sr_kill_slave_before_apply.result @@ -44,7 +44,7 @@ connection node_2; SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; EXPECT_0 0 -call mtr.add_suppression("WSREP: node uuid:.*"); +call mtr.add_suppression("WSREP: node uuid:"); connection node_1; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/galera_3nodes_sr/suite.pm b/mysql-test/suite/galera_3nodes_sr/suite.pm index d2b31a0fbc7..3cc7af0666c 100644 --- a/mysql-test/suite/galera_3nodes_sr/suite.pm +++ b/mysql-test/suite/galera_3nodes_sr/suite.pm @@ -10,37 +10,37 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), - qr(WSREP: Could not open saved state file for reading: .*), - qr(WSREP: Could not open state file for reading: .*), - qr(WSREP: Gap in state sequence. Need state transfer\.), + qr(WSREP: Could not open saved state file for reading: ), + qr(WSREP: Could not open state file for reading: ), + qr(WSREP: Gap in state sequence\. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), qr(WSREP: SQL statement was ineffective), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), - qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, + qr(WSREP: Releasing seqno [0-9]+ before [0-9]+ was assigned\.), + qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), - qr|WSREP: discarding established \(time wait\).*|, + qr|WSREP: discarding established \(time wait\) |, qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), - qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, + qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: Transport endpoint is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), - qr(WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.), qr(WSREP: Could not find peer:), - qr|WSREP: gcs_caused\(\) returned .*|, + qr|WSREP: gcs_caused\(\) returned |, qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), - qr|WSREP: .*core_handle_uuid_msg.*|, + qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr(WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.), + qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, + qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, ); bless { }; diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-606.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-606.test index 879c007e601..2048580d735 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/GCF-606.test +++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-606.test @@ -85,4 +85,5 @@ DROP TABLE t1; --connection node_2 CALL mtr.add_suppression("WSREP: failed to send SR rollback for "); + --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_after_apply_rollback2.test b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_after_apply_rollback2.test index 6ca2011d221..4dba60ba79d 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_after_apply_rollback2.test +++ b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_after_apply_rollback2.test @@ -65,4 +65,5 @@ SELECT COUNT(*) FROM mysql.wsrep_streaming_log; --connection node_1 --disconnect node_1a DROP TABLE t1; + --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test index 58d744e704d..b6355050836 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test +++ b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_kill_slave_before_apply.test @@ -88,7 +88,7 @@ SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; --connection node_2 SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; # As noted above sometimes node delivers the same view twice -call mtr.add_suppression("WSREP: node uuid:.*"); +call mtr.add_suppression("WSREP: node uuid:"); --connection node_1 DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf index 910d945949a..557edbb09d9 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf +++ b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf @@ -2,4 +2,3 @@ [mysqld.1] wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.weight=3' - diff --git a/mysql-test/suite/galera_3nodes_sr/t/galera_vote_sr-master.opt b/mysql-test/suite/galera_3nodes_sr/t/galera_vote_sr-master.opt index 196498bb9fa..954aacb818b 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/galera_vote_sr-master.opt +++ b/mysql-test/suite/galera_3nodes_sr/t/galera_vote_sr-master.opt @@ -1,2 +1 @@ --wsrep-ignore-apply-errors=0 - diff --git a/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result index 433cfa4e459..de8d2bd7e7c 100644 --- a/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result +++ b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result @@ -1,6 +1,6 @@ connection node_2; connection node_1; -CALL mtr.add_suppression("WSREP: discarding established.*"); +CALL mtr.add_suppression("WSREP: discarding established"); connection node_1; connection node_2; connection node_2; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result index 98bf13e9d2b..a97c004999d 100644 --- a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result @@ -25,7 +25,7 @@ COMMIT; connection node_1; Got one of the listed errors connection node_2; -SET GLOBAL wsrep_slave_threads = 1; +SET GLOBAL wsrep_slave_threads = DEFAULT; SET GLOBAL debug_dbug = ''; SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; diff --git a/mysql-test/suite/galera_sr/suite.pm b/mysql-test/suite/galera_sr/suite.pm index 1a0e9b28685..f60ad1eefe3 100644 --- a/mysql-test/suite/galera_sr/suite.pm +++ b/mysql-test/suite/galera_sr/suite.pm @@ -10,58 +10,58 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( qr(WSREP: wsrep_sst_receive_address is set to '127\.0\.0\.1), - qr(WSREP: Could not open saved state file for reading: .*), - qr(WSREP: Could not open state file for reading: .*), + qr(WSREP: Could not open saved state file for reading: ), + qr(WSREP: Could not open state file for reading: ), qr(WSREP: Gap in state sequence\. Need state transfer\.), qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), qr(WSREP: last inactive check more than .* skipping check), - qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned\.), - qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, + qr(WSREP: Releasing seqno [0-9]+ before [0-9]+ was assigned\.), + qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), qr(WSREP: Initial position was provided by configuration or SST, avoiding override), - qr|WSREP: discarding established \(time wait\) .*|, + qr|WSREP: discarding established \(time wait\) |, qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside\. Will use that one\.), qr(WSREP: evs::proto.*), - qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, + qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: Transport endpoint is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), - qr(WSREP: Maximum writeset size exceeded by .*), - qr(WSREP: transaction size exceeded.*), - qr(WSREP: RBR event .*), - qr(WSREP: Ignoring error for TO isolated action: .*), - qr(WSREP: transaction size limit .*), - qr(WSREP: rbr write fail, .*), - qr(WSREP: .*Backend not supported: foo.*), - qr(WSREP: .*Failed to initialize backend using .*), - qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: Maximum writeset size exceeded by ), + qr(WSREP: transaction size exceeded), + qr(WSREP: RBR event ), + qr(WSREP: Ignoring error for TO isolated action: ), + qr(WSREP: transaction size limit ), + qr(WSREP: rbr write fail, ), + qr(WSREP: .*Backend not supported: foo), + qr(WSREP: .*Failed to initialize backend using ), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Socket type not supported), qr(WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 .*), - qr(WSREP: .*Failed to open backend connection: -110 .*), - qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*), + qr(WSREP: .*Failed to open backend connection: -110 ), + qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), - qr(WSREP: TO isolation failed for: .*), - qr|WSREP: gcs_caused\(\) returned .*|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored\.|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored\.|, + qr(WSREP: TO isolation failed for: ), + qr|WSREP: gcs_caused\(\) returned |, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), - qr(WSREP: discarding established .*), - qr|WSREP: .*core_handle_uuid_msg.*|, + qr(WSREP: discarding established ), + qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, - qr|WSREP: .*Query apply failed:.*|, - qr(WSREP: Ignoring error.*), - qr(WSREP: Failed to remove page file .*), - qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), + qr|WSREP: .*Query apply failed:|, + qr(WSREP: Ignoring error), + qr(WSREP: Failed to remove page file ), + qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to ), qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, qr|WSREP: Trying to continue unpaused monitor|, diff --git a/mysql-test/suite/galera_sr/t/MDEV-27615.test b/mysql-test/suite/galera_sr/t/MDEV-27615.test index 8cc425aa7e1..50076f23b41 100644 --- a/mysql-test/suite/galera_sr/t/MDEV-27615.test +++ b/mysql-test/suite/galera_sr/t/MDEV-27615.test @@ -69,5 +69,4 @@ SET DEBUG_SYNC = 'RESET'; --disconnect node_2 --connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2 - --source suite/galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test b/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test index 563f115ecf1..b0d5853ac69 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test +++ b/mysql-test/suite/galera_sr/t/galera_sr_cc_master.test @@ -7,7 +7,7 @@ # leave the cluster. # -CALL mtr.add_suppression("WSREP: discarding established.*"); +CALL mtr.add_suppression("WSREP: discarding established"); # Save original auto_increment_offset values. --let $node_1=node_1 diff --git a/mysql-test/suite/galera_sr/t/galera_sr_gtid-master.opt b/mysql-test/suite/galera_sr/t/galera_sr_gtid-master.opt index 6623c33c484..2c3adba1eee 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_gtid-master.opt +++ b/mysql-test/suite/galera_sr/t/galera_sr_gtid-master.opt @@ -1 +1 @@ - --log-bin --log-slave-updates --loose-galera-sr-gtid-unique +--log-bin --log-slave-updates --loose-galera-sr-gtid-unique diff --git a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf index 574ae28b54a..a4edaf98802 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf +++ b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf @@ -8,4 +8,3 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' - diff --git a/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf b/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf index c8e17436e71..8f9e053487f 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf +++ b/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf @@ -1,6 +1,7 @@ !include ../galera_2nodes.cnf + [mysqld.1] wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=16K' + [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=16K' - diff --git a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#14.test b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#14.test index deeb890fa0b..2f1e0920f0c 100644 --- a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#14.test +++ b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#14.test @@ -18,4 +18,3 @@ DROP TABLE t1; --connection node_2 --source include/galera_wait_ready.inc - diff --git a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#148.test b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#148.test index e0a443061df..7689fac802e 100644 --- a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#148.test +++ b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#148.test @@ -47,7 +47,7 @@ COMMIT; --reap --connection node_2 -SET GLOBAL wsrep_slave_threads = 1; +SET GLOBAL wsrep_slave_threads = DEFAULT; SET GLOBAL debug_dbug = ''; SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; diff --git a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#22.test b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#22.test index 544109dadee..302c11d8ff1 100644 --- a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#22.test +++ b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#22.test @@ -40,7 +40,6 @@ COMMIT; --connection node_1 SELECT COUNT(*) = 6 FROM t1; - --connection node_2 SELECT COUNT(*) = 6 FROM t1; diff --git a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#96.test b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#96.test index c773b310183..59875862f70 100644 --- a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#96.test +++ b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#96.test @@ -39,7 +39,3 @@ SELECT COUNT(*) = 0 FROM t2; --connection node_1 DROP TABLE t1; DROP TABLE t2; - - - - diff --git a/mysql-test/suite/wsrep/r/plugin.result b/mysql-test/suite/wsrep/r/plugin.result index 4f52173cb25..2928acd07d2 100644 --- a/mysql-test/suite/wsrep/r/plugin.result +++ b/mysql-test/suite/wsrep/r/plugin.result @@ -1,3 +1,3 @@ -SELECT plugin_name,plugin_version,plugin_maturity FROM information_schema.plugins where plugin_name like 'wsrep' ORDER BY plugin_maturity,plugin_name; +SELECT plugin_name,plugin_version,plugin_maturity FROM information_schema.plugins WHERE plugin_name like 'wsrep' ORDER BY plugin_maturity,plugin_name; plugin_name plugin_version plugin_maturity wsrep 1.0 Stable diff --git a/mysql-test/suite/wsrep/suite.pm b/mysql-test/suite/wsrep/suite.pm index 2ee33d83275..040a48c7964 100644 --- a/mysql-test/suite/wsrep/suite.pm +++ b/mysql-test/suite/wsrep/suite.pm @@ -9,9 +9,9 @@ return wsrep_not_ok() if wsrep_not_ok(); push @::global_suppressions, ( - qr(WSREP: Could not open saved state file for reading: .*), - qr(WSREP: Could not open state file for reading: .*), - qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, + qr(WSREP: Could not open saved state file for reading: ), + qr(WSREP: Could not open state file for reading: ), + qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, ); bless { }; diff --git a/mysql-test/suite/wsrep/t/binlog_format.cnf b/mysql-test/suite/wsrep/t/binlog_format.cnf index 7ec24c14d80..500a197e422 100644 --- a/mysql-test/suite/wsrep/t/binlog_format.cnf +++ b/mysql-test/suite/wsrep/t/binlog_format.cnf @@ -5,4 +5,3 @@ wsrep-on=ON wsrep-provider=@ENV.WSREP_PROVIDER wsrep-cluster-address=gcomm:// innodb_autoinc_lock_mode=2 - diff --git a/mysql-test/suite/wsrep/t/foreign_key.test b/mysql-test/suite/wsrep/t/foreign_key.test index 71f6076a1d7..c14910c7f86 100644 --- a/mysql-test/suite/wsrep/t/foreign_key.test +++ b/mysql-test/suite/wsrep/t/foreign_key.test @@ -17,4 +17,3 @@ SELECT * FROM test.c; # Cleanup DROP TABLE c; DROP TABLE p; - diff --git a/mysql-test/suite/wsrep/t/mdev_10186.test b/mysql-test/suite/wsrep/t/mdev_10186.test index 0f0aa287086..157e7b5a7b6 100644 --- a/mysql-test/suite/wsrep/t/mdev_10186.test +++ b/mysql-test/suite/wsrep/t/mdev_10186.test @@ -9,4 +9,3 @@ SELECT @@wsrep_on; SET @@GLOBAL.wsrep_cluster_address='gcomm://'; - diff --git a/mysql-test/suite/wsrep/t/mdev_7798.cnf b/mysql-test/suite/wsrep/t/mdev_7798.cnf index 0bf01f81fc5..c2b7c4d415f 100644 --- a/mysql-test/suite/wsrep/t/mdev_7798.cnf +++ b/mysql-test/suite/wsrep/t/mdev_7798.cnf @@ -4,4 +4,3 @@ wsrep-on=ON wsrep-provider=@ENV.WSREP_PROVIDER wsrep-cluster-address=gcomm:// - diff --git a/mysql-test/suite/wsrep/t/plugin.test b/mysql-test/suite/wsrep/t/plugin.test index 73d605b0918..90750403405 100644 --- a/mysql-test/suite/wsrep/t/plugin.test +++ b/mysql-test/suite/wsrep/t/plugin.test @@ -5,4 +5,4 @@ # MDEV-7604: wsrep plugin lists its status as Unknown # -SELECT plugin_name,plugin_version,plugin_maturity FROM information_schema.plugins where plugin_name like 'wsrep' ORDER BY plugin_maturity,plugin_name; \ No newline at end of file +SELECT plugin_name,plugin_version,plugin_maturity FROM information_schema.plugins WHERE plugin_name like 'wsrep' ORDER BY plugin_maturity,plugin_name; diff --git a/mysql-test/suite/wsrep/t/wsrep-recover.cnf b/mysql-test/suite/wsrep/t/wsrep-recover.cnf index 19986cd97bc..489c4385dbd 100644 --- a/mysql-test/suite/wsrep/t/wsrep-recover.cnf +++ b/mysql-test/suite/wsrep/t/wsrep-recover.cnf @@ -6,4 +6,4 @@ binlog-format=ROW innodb-flush-log-at-trx-commit=1 wsrep-cluster-address=gcomm:// wsrep-provider=@ENV.WSREP_PROVIDER -innodb-autoinc-lock-mode=2 \ No newline at end of file +innodb-autoinc-lock-mode=2 diff --git a/mysql-test/suite/wsrep/t/wsrep_forced_binlog_format.test b/mysql-test/suite/wsrep/t/wsrep_forced_binlog_format.test index 37e9c6c718e..718fc975071 100644 --- a/mysql-test/suite/wsrep/t/wsrep_forced_binlog_format.test +++ b/mysql-test/suite/wsrep/t/wsrep_forced_binlog_format.test @@ -2,7 +2,6 @@ --source include/have_wsrep_provider.inc --source include/have_binlog_format_row.inc - --echo # --echo # wsrep_forced_binlog_format --echo # diff --git a/mysql-test/suite/wsrep/t/wsrep_rpl.test b/mysql-test/suite/wsrep/t/wsrep_rpl.test index 4f34aadc365..98a70d0dfb1 100644 --- a/mysql-test/suite/wsrep/t/wsrep_rpl.test +++ b/mysql-test/suite/wsrep/t/wsrep_rpl.test @@ -41,4 +41,3 @@ eval SET @@GLOBAL.wsrep_max_ws_rows = $wsrep_max_ws_rows_slave; --source include/rpl_end.inc --echo # End of test. - diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test b/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test index b41718792a2..d63c3e5fafb 100644 --- a/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test +++ b/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test @@ -44,7 +44,6 @@ SET GLOBAL wsrep_sst_method='method;'; SELECT @@global.wsrep_sst_method; SHOW WARNINGS; - --disable_query_log SET @@global.wsrep_sst_method = @wsrep_sst_method_saved; --enable_query_log diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf index 2e66b1ef23c..66a5dcc1f7c 100644 --- a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf +++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf @@ -9,4 +9,3 @@ wsrep-on=OFF #galera_port=@OPT.port #ist_port=@OPT.port #sst_port=@OPT.port - diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 974ddfc1d4c..ebd2659ea6f 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2089,14 +2089,15 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton) { if (!wsrep_strict_ddl) return true; - - if (!hton) - return true; DBUG_ASSERT(hton != nullptr); switch (hton->db_type) { + case DB_TYPE_UNKNOWN: + /* Special pseudo-handlertons (such as 10.6+ JSON tables). */ + return true; + break; case DB_TYPE_INNODB: return true; break; @@ -2123,7 +2124,7 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton) my_error(ER_GALERA_REPLICATION_NOT_SUPPORTED, MYF(0)); push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_ILLEGAL_HA, - "WSREP: wsrep_strict_dll enabled. " + "WSREP: wsrep_strict_ddl enabled. " "Storage engine %s not supported.", ha_resolve_storage_engine_name(hton)); return false; From bb64a5103798bff6fb6d191880d558a6651a7945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 10 Feb 2025 09:19:23 +0200 Subject: [PATCH 19/65] MDEV-35941 : galera_bf_abort_lock_table fails with wait for metadata lock Problem was missing case from wsrep_handle_mdl_conflict. Test case was trying to confirm that LOCK TABLE thread is not BF-aborted. However as case was missing it was BF-aborted. Test case passed because BF-aborting takes time and used wait condition might see expected thread status before it was BF-aborted. Test naturally failed if BF-aborting was done early enough. Fix is to add missing case for SQLCOM_LOCK_TABLES to wsrep_handle_mdl_conflict. Note that using LOCK TABLE is still not recomended on cluster because it could cause cluster hang. This is a 10.5 specific commit that will then be overridden by another one for 10.6+. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/disabled.def | 2 -- .../suite/galera/t/galera_bf_abort_lock_table.cnf | 1 - .../suite/galera/t/galera_bf_abort_lock_table.test | 4 ++-- sql/wsrep_mysqld.cc | 11 ++++++++--- 4 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 72caea32867..538d2d36759 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -13,7 +13,5 @@ galera_sequences : MDEV-35934/MDEV-33850 For Galera, create sequence with low cache got signal 6 error: [ERROR] WSREP: FSM: no such a transition REPLICATING -> COMMITTED galera_wan : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan galera_vote_rejoin_ddl : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan -galera_bf_abort_lock_table : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock -mysql-wsrep#198 : MDEV-35941 galera_bf_abort_lock_table fails with wait for metadata lock MW-329 : MDEV-35951 Complete freeze during MW-329 test galera_vote_rejoin_dml : MDEV-35964 Assertion `ist_seqno >= cc_seqno' failed in galera_vote_rejoin_dml diff --git a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf deleted file mode 100644 index fa33b09d739..00000000000 --- a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.cnf +++ /dev/null @@ -1 +0,0 @@ -!include ../galera_2nodes.cnf diff --git a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test index 652e89f8e57..71c3a7198f2 100644 --- a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test +++ b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test @@ -19,13 +19,13 @@ INSERT INTO t1 VALUES (2); SET SESSION wsrep_sync_wait = 0; --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ---source include/wait_condition_with_debug_and_kill.inc +--source include/wait_condition_with_debug.inc UNLOCK TABLES; --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'Waiting to execute in isolation%'); --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ---source include/wait_condition_with_debug_and_kill.inc +--source include/wait_condition_with_debug.inc COMMIT; SELECT COUNT(*) = 1 FROM t1; diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index ebd2659ea6f..569bfa35f75 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2781,11 +2781,9 @@ void wsrep_to_isolation_end(THD *thd) @param requestor_ctx The MDL context of the requestor @param ticket MDL ticket for the requested lock + @param key The key of the object (data) being protected - @retval TRUE Lock request can be granted - @retval FALSE Lock request cannot be granted */ - void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, const MDL_ticket *ticket, const MDL_key *key) @@ -2861,6 +2859,13 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, mysql_mutex_unlock(&granted_thd->LOCK_thd_data); mysql_mutex_unlock(&granted_thd->LOCK_thd_kill); } + else if (granted_thd->lex->sql_command == SQLCOM_LOCK_TABLES) + { + WSREP_DEBUG("BF thread waiting for LOCK TABLES"); + ticket->wsrep_report(wsrep_debug); + mysql_mutex_unlock(&granted_thd->LOCK_thd_data); + mysql_mutex_unlock(&granted_thd->LOCK_thd_kill); + } else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE) { WSREP_DEBUG("DROP caused BF abort, conf %s", From 573b584eba18176d4cc367e8558966c83af682f6 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 11 Feb 2025 03:51:42 +0100 Subject: [PATCH 20/65] galera mtr tests: unification of wsrep provider settings --- mysql-test/suite/galera/galera_2nodes.cnf | 4 ++-- mysql-test/suite/galera/galera_2nodes_as_master.cnf | 4 ++-- .../suite/galera/galera_2nodes_as_replica_2primary.cnf | 4 ++-- mysql-test/suite/galera/galera_2nodes_as_slave.cnf | 4 ++-- mysql-test/suite/galera/galera_3nodes_as_slave.cnf | 6 +++--- mysql-test/suite/galera/galera_4nodes.cnf | 8 ++++---- mysql-test/suite/galera/t/galera#414.cnf | 4 ++-- .../suite/galera/t/galera_autoinc_sst_mariabackup.cnf | 4 ++-- mysql-test/suite/galera/t/galera_defaults.cnf | 4 ++-- mysql-test/suite/galera/t/galera_gcache_recover.cnf | 4 ++-- .../suite/galera/t/galera_gcache_recover_full_gcache.cnf | 4 ++-- mysql-test/suite/galera/t/galera_gcs_fragment.cnf | 4 ++-- mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ist_mariabackup.cnf | 4 ++-- .../galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf | 4 ++-- .../suite/galera/t/galera_ist_mariabackup_verify_ca.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ist_mysqldump.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ist_progress.cnf | 2 +- mysql-test/suite/galera/t/galera_ist_recv_bind.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf | 2 +- mysql-test/suite/galera/t/galera_ist_rsync.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ist_rsync_verify_ca.cnf | 4 ++-- mysql-test/suite/galera/t/galera_log_bin_opt.cnf | 4 ++-- mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ssl.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ssl_cipher.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ssl_compression.cnf | 4 ++-- mysql-test/suite/galera/t/galera_ssl_upgrade.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_encrypted.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_mariabackup.cnf | 4 ++-- .../suite/galera/t/galera_sst_mariabackup_data_dir.cnf | 4 ++-- .../galera/t/galera_sst_mariabackup_force_recovery.cnf | 4 ++-- .../suite/galera/t/galera_sst_mariabackup_logarchive.cnf | 4 ++-- .../suite/galera/t/galera_sst_mariabackup_lost_found.cnf | 4 ++-- .../galera/t/galera_sst_mariabackup_table_options.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_mysqldump.cnf | 5 +++-- .../suite/galera/t/galera_sst_mysqldump_with_key.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_rsync.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_rsync2.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf | 4 ++-- .../galera/t/galera_sst_rsync_encrypt_with_capath.cnf | 4 ++-- .../suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf | 4 ++-- .../galera/t/galera_sst_rsync_encrypt_with_server.cnf | 4 ++-- .../suite/galera/t/galera_sst_rsync_logbasename.cnf | 4 ++-- mysql-test/suite/galera/t/galera_sst_rsync_recv_auto.cnf | 8 ++++---- mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf | 4 ++-- mysql-test/suite/galera/t/galera_wan.cnf | 8 ++++---- mysql-test/suite/galera/t/galera_wan_restart_ist.cnf | 8 ++++---- mysql-test/suite/galera/t/galera_wan_restart_sst.cnf | 8 ++++---- mysql-test/suite/galera/t/mysql-wsrep#33.cnf | 4 ++-- mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf | 1 + mysql-test/suite/galera_3nodes/galera_3nodes.cnf | 6 +++--- mysql-test/suite/galera_3nodes/t/GAL-501.cnf | 6 +++--- mysql-test/suite/galera_3nodes/t/GCF-354.cnf | 6 +++--- .../suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf | 6 +++--- .../galera_3nodes/t/galera_ipv6_mariabackup_section.cnf | 6 +++--- .../suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf | 6 +++--- mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf | 6 +++--- .../suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf | 6 +++--- .../suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf | 6 +++--- mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf | 6 +++--- .../suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf | 2 +- .../suite/galera_sr/t/galera_sr_kill_all_norecovery.cnf | 3 ++- mysql-test/suite/galera_sr/t/galera_sr_kill_slave.cnf | 2 +- mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf | 4 ++-- mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf | 4 ++-- 69 files changed, 155 insertions(+), 152 deletions(-) diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf index f1697c08149..f0996fa3a97 100644 --- a/mysql-test/suite/galera/galera_2nodes.cnf +++ b/mysql-test/suite/galera/galera_2nodes.cnf @@ -17,7 +17,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address=gcomm:// -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -28,7 +28,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' diff --git a/mysql-test/suite/galera/galera_2nodes_as_master.cnf b/mysql-test/suite/galera/galera_2nodes_as_master.cnf index 11d7401535a..43bd091c8ee 100644 --- a/mysql-test/suite/galera/galera_2nodes_as_master.cnf +++ b/mysql-test/suite/galera/galera_2nodes_as_master.cnf @@ -25,7 +25,7 @@ server-id=1 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address=gcomm:// -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -38,7 +38,7 @@ server-id=2 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' diff --git a/mysql-test/suite/galera/galera_2nodes_as_replica_2primary.cnf b/mysql-test/suite/galera/galera_2nodes_as_replica_2primary.cnf index 714caf6ee67..570eeda0bc6 100644 --- a/mysql-test/suite/galera/galera_2nodes_as_replica_2primary.cnf +++ b/mysql-test/suite/galera/galera_2nodes_as_replica_2primary.cnf @@ -24,7 +24,7 @@ server-id=1 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address=gcomm:// -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -37,7 +37,7 @@ server-id=2 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' diff --git a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf index c6f6299ca92..c00e6c6a937 100644 --- a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf +++ b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf @@ -24,7 +24,7 @@ server-id=1 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address=gcomm:// -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -37,7 +37,7 @@ server-id=2 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' diff --git a/mysql-test/suite/galera/galera_3nodes_as_slave.cnf b/mysql-test/suite/galera/galera_3nodes_as_slave.cnf index 228147c0248..6231da6c246 100644 --- a/mysql-test/suite/galera/galera_3nodes_as_slave.cnf +++ b/mysql-test/suite/galera/galera_3nodes_as_slave.cnf @@ -24,7 +24,7 @@ server-id=1 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address=gcomm:// -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -37,7 +37,7 @@ server-id=2 #sst_port=@OPT.port wsrep_provider=@ENV.WSREP_PROVIDER wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' @@ -50,7 +50,7 @@ server-id=3 #sst_port=@OPT.port wsrep-provider=@ENV.WSREP_PROVIDER wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port' diff --git a/mysql-test/suite/galera/galera_4nodes.cnf b/mysql-test/suite/galera/galera_4nodes.cnf index 090b8953bff..3006882eda3 100644 --- a/mysql-test/suite/galera/galera_4nodes.cnf +++ b/mysql-test/suite/galera/galera_4nodes.cnf @@ -18,7 +18,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address=gcomm:// -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -30,7 +30,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' @@ -42,7 +42,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port' @@ -54,7 +54,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port' diff --git a/mysql-test/suite/galera/t/galera#414.cnf b/mysql-test/suite/galera/t/galera#414.cnf index 03e7214b76f..c1538deca8f 100644 --- a/mysql-test/suite/galera/t/galera#414.cnf +++ b/mysql-test/suite/galera/t/galera#414.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=2' +wsrep_provider_options='gcs.max_packet_size=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=2' +wsrep_provider_options='gcs.max_packet_size=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf index cddb8e0e174..1fcfcc6bf9f 100644 --- a/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf +++ b/mysql-test/suite/galera/t/galera_autoinc_sst_mariabackup.cnf @@ -5,7 +5,7 @@ wsrep_sst_method=mariabackup wsrep_sst_auth="root:" [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_defaults.cnf b/mysql-test/suite/galera/t/galera_defaults.cnf index fb143baf30f..02d3d542224 100644 --- a/mysql-test/suite/galera/t/galera_defaults.cnf +++ b/mysql-test/suite/galera/t/galera_defaults.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_gcache_recover.cnf b/mysql-test/suite/galera/t/galera_gcache_recover.cnf index 34c757de77e..d1bea184e3e 100644 --- a/mysql-test/suite/galera/t/galera_gcache_recover.cnf +++ b/mysql-test/suite/galera/t/galera_gcache_recover.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true' +wsrep_provider_options='gcache.recover=yes;pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes' +wsrep_provider_options='gcache.recover=yes;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S' diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf index 0157d2f08b1..fee9d154817 100644 --- a/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf +++ b/mysql-test/suite/galera/t/galera_gcache_recover_full_gcache.cnf @@ -3,7 +3,7 @@ [mysqld.1] max_allowed_packet=10M innodb_log_file_size=220M -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M' +wsrep_provider_options='gcache.recover=yes;pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M' +wsrep_provider_options='gcache.recover=yes;pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_gcs_fragment.cnf b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf index 5d7bbf7b053..b75fddaef6f 100644 --- a/mysql-test/suite/galera/t/galera_gcs_fragment.cnf +++ b/mysql-test/suite/galera/t/galera_gcs_fragment.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64' +wsrep_provider_options='gcs.max_packet_size=64;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64' +wsrep_provider_options='gcs.max_packet_size=64;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf index 7e7c99ecb63..b75fddaef6f 100644 --- a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf +++ b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64;gcache.size=10M' +wsrep_provider_options='gcs.max_packet_size=64;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64;gcache.size=10M' +wsrep_provider_options='gcs.max_packet_size=64;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf index 691e52208b1..c32726ae833 100644 --- a/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf +++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf @@ -35,10 +35,10 @@ log_slave_updates=ON log_bin=binlog [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf index 3835cd02a41..667757a337c 100644 --- a/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf +++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf @@ -35,10 +35,10 @@ log_slave_updates=ON log_bin=binlog [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf index f03527dc808..fea434ab181 100644 --- a/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf +++ b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf @@ -5,10 +5,10 @@ wsrep_sst_method=mariabackup wsrep_sst_auth=root: [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf index e4f52aaad0a..e0651b03e67 100644 --- a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf +++ b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf @@ -7,10 +7,10 @@ wsrep_sst_auth=root: innodb_flush_log_at_trx_commit=0 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup_verify_ca.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup_verify_ca.cnf index f2187b83486..66f9c3217e8 100644 --- a/mysql-test/suite/galera/t/galera_ist_mariabackup_verify_ca.cnf +++ b/mysql-test/suite/galera/t/galera_ist_mariabackup_verify_ca.cnf @@ -9,10 +9,10 @@ ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] ssl-mode=VERIFY_CA diff --git a/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf index 807829f047f..1007de9f779 100644 --- a/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf +++ b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf @@ -4,7 +4,7 @@ # causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ist_progress.cnf b/mysql-test/suite/galera/t/galera_ist_progress.cnf index 10958aad9a8..7a043bbe9f0 100644 --- a/mysql-test/suite/galera/t/galera_ist_progress.cnf +++ b/mysql-test/suite/galera/t/galera_ist_progress.cnf @@ -1,4 +1,4 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf index 035fb0769b7..90502d3326e 100644 --- a/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf +++ b/mysql-test/suite/galera/t/galera_ist_recv_bind.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;ist.recv_bind=127.0.0.1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;ist.recv_bind=127.0.0.1;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;ist.recv_bind=127.0.0.1' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;ist.recv_bind=127.0.0.1;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf b/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf index 10958aad9a8..7a043bbe9f0 100644 --- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf +++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf @@ -1,4 +1,4 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ist_rsync.cnf b/mysql-test/suite/galera/t/galera_ist_rsync.cnf index 7a3da6dad02..33cea999503 100644 --- a/mysql-test/suite/galera/t/galera_ist_rsync.cnf +++ b/mysql-test/suite/galera/t/galera_ist_rsync.cnf @@ -4,9 +4,9 @@ wsrep_sst_method=rsync [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sync_wait=1 [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sync_wait=1 diff --git a/mysql-test/suite/galera/t/galera_ist_rsync_verify_ca.cnf b/mysql-test/suite/galera/t/galera_ist_rsync_verify_ca.cnf index 9125f6708fe..ddedc97717c 100644 --- a/mysql-test/suite/galera/t/galera_ist_rsync_verify_ca.cnf +++ b/mysql-test/suite/galera/t/galera_ist_rsync_verify_ca.cnf @@ -8,10 +8,10 @@ ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] ssl-mode=VERIFY_CA diff --git a/mysql-test/suite/galera/t/galera_log_bin_opt.cnf b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf index 3c14cde794c..b9da661bb42 100644 --- a/mysql-test/suite/galera/t/galera_log_bin_opt.cnf +++ b/mysql-test/suite/galera/t/galera_log_bin_opt.cnf @@ -5,10 +5,10 @@ wsrep_sst_method=mariabackup wsrep_sst_auth="root:" [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf b/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf index 8734323a2d6..5ea513d111e 100644 --- a/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf +++ b/mysql-test/suite/galera/t/galera_pc_ignore_sb.cnf @@ -4,7 +4,7 @@ wsrep_debug=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' diff --git a/mysql-test/suite/galera/t/galera_ssl.cnf b/mysql-test/suite/galera/t/galera_ssl.cnf index de57c9ffbf0..904842c88b6 100644 --- a/mysql-test/suite/galera/t/galera_ssl.cnf +++ b/mysql-test/suite/galera/t/galera_ssl.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ssl_cipher.cnf b/mysql-test/suite/galera/t/galera_ssl_cipher.cnf index dff9c96afbb..776c321d800 100644 --- a/mysql-test/suite/galera/t/galera_ssl_cipher.cnf +++ b/mysql-test/suite/galera/t/galera_ssl_cipher.cnf @@ -5,7 +5,7 @@ loose-galera-ssl-cipher=1 wsrep-debug=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;cert.log_conflicts=YES' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;cert.log_conflicts=YES;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;cert.log_conflicts=YES' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;cert.log_conflicts=YES;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ssl_compression.cnf b/mysql-test/suite/galera/t/galera_ssl_compression.cnf index 4dffe99bd5a..2994c552338 100644 --- a/mysql-test/suite/galera/t/galera_ssl_compression.cnf +++ b/mysql-test/suite/galera/t/galera_ssl_compression.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem;socket.ssl_compression=YES' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem;socket.ssl_compression=YES;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem;socket.ssl_compression=YES' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem;socket.ssl_compression=YES;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf index 7c495102564..ee8c6e590f4 100644 --- a/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf +++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.cnf @@ -5,7 +5,7 @@ loose-galera-ssl-upgrade=1 wsrep-debug=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_sst_encrypted.cnf b/mysql-test/suite/galera/t/galera_sst_encrypted.cnf index e10c3e9f215..b796f9f92cf 100644 --- a/mysql-test/suite/galera/t/galera_sst_encrypted.cnf +++ b/mysql-test/suite/galera/t/galera_sst_encrypted.cnf @@ -11,7 +11,7 @@ innodb_file_per_table=1 wsrep_sst_method=rsync [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf index 857a4101406..06a49ff85d0 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup.cnf @@ -6,10 +6,10 @@ wsrep_sst_auth="root:" wsrep_debug=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf index b1caf700a12..20581ee765e 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_data_dir.cnf @@ -6,11 +6,11 @@ wsrep_sst_auth="root:" wsrep_debug=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] innodb_data_home_dir=@ENV.MYSQL_TMP_DIR/data_dir_test -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_force_recovery.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_force_recovery.cnf index 857a4101406..1e6bbcce82f 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_force_recovery.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_force_recovery.cnf @@ -6,10 +6,10 @@ wsrep_sst_auth="root:" wsrep_debug=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_logarchive.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_logarchive.cnf index 04043ac2b74..8e68fc0554a 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_logarchive.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_logarchive.cnf @@ -6,10 +6,10 @@ wsrep_sst_auth="root:" wsrep_debug=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.cnf index a09efd2e011..56ab462df7d 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_lost_found.cnf @@ -5,10 +5,10 @@ wsrep_sst_method=mariabackup wsrep_sst_auth="root:" [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf index 4c57017299f..5c468a664f1 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf @@ -8,10 +8,10 @@ innodb-file-format='Barracuda' innodb-file-per-table=ON [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [sst] transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf b/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf index af4fedf12ce..1007de9f779 100644 --- a/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf @@ -4,6 +4,7 @@ # causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' + [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf index da04a605291..2e4e0ffd31d 100644 --- a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf @@ -9,10 +9,10 @@ wsrep-sync_wait=15 loose-galera_sst_mysqldump_with_key=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [client] ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.cnf b/mysql-test/suite/galera/t/galera_sst_rsync.cnf index 29d3a1e6219..197c2a1a11e 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync.cnf @@ -4,7 +4,7 @@ wsrep_sst_method=rsync [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_sst_rsync2.cnf b/mysql-test/suite/galera/t/galera_sst_rsync2.cnf index a089baacf36..483d4b0f015 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync2.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync2.cnf @@ -4,11 +4,11 @@ wsrep_sst_method=rsync [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' log_bin=@ENV.MYSQLTEST_VARDIR/mysqld.1/server1_binlog log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server1_binlog_index.index [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' log_bin=@ENV.MYSQLTEST_VARDIR/mysqld.2/server2_binlog log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server2_binlog_index.index diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf index b1e4278dceb..dcd77967c80 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf @@ -4,9 +4,9 @@ wsrep_sst_method=rsync [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' log_bin=server1_binlog [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' log_bin=server2_binlog diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf index 4cc3442bd87..b873ac0d6a1 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync_data_dir.cnf @@ -4,11 +4,11 @@ wsrep_sst_method=rsync [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' innodb_data_home_dir=@ENV.MYSQL_TMP_DIR/rsync_test_2 -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' [sst] backup_threads=2 diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_capath.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_capath.cnf index 3ab762df013..d93f5a1a663 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_capath.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_capath.cnf @@ -14,7 +14,7 @@ ssl-ca= ssl-mode=VERIFY_CA [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf index 948b52d4bf7..354376baec8 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_key.cnf @@ -8,7 +8,7 @@ tkey=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem tcert=@ENV.MYSQL_TEST_DIR/std_data/server-cert.pem [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf index 8ed9348e789..6ad746ebff0 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync_encrypt_with_server.cnf @@ -10,7 +10,7 @@ ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem ssl-mode=VERIFY_CA [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf index 3913ab6660f..4c9745cba66 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf @@ -4,11 +4,11 @@ wsrep_sst_method=rsync [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' log_basename=server1 log_bin [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' log_basename=server2 log_bin diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_recv_auto.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_recv_auto.cnf index c2888926a57..c1011763faf 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync_recv_auto.cnf +++ b/mysql-test/suite/galera/t/galera_sst_rsync_recv_auto.cnf @@ -5,14 +5,14 @@ wsrep_sst_method=rsync bind-address=:: [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_incoming_address='[::1]:@mysqld.1.port' wsrep_node_address=::1 wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' [mysqld.2] -wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;gcache.size=1;pc.ignore_sb=true' -wsrep_node_address=::1 +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_incoming_address='[::1]:@mysqld.2.port' +wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' +wsrep_node_address=::1 wsrep_sst_receive_address=AUTO diff --git a/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf index 9b88a09d814..a8c2826ad0d 100644 --- a/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf +++ b/mysql-test/suite/galera/t/galera_var_notify_ssl_ipv6.cnf @@ -6,7 +6,7 @@ ssl-key=@ENV.MYSQL_TEST_DIR/std_data/server-key.pem ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem [mysqld.1] -wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;repl.causal_read_timeout=PT90S;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_incoming_address='[::1]:@mysqld.1.port' wsrep_node_address=[::1]:@mysqld.1.#galera_port wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' @@ -14,7 +14,7 @@ bind-address=:: [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;repl.causal_read_timeout=PT90S;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_incoming_address='[::1]:@mysqld.2.port' wsrep_node_address=[::1]:@mysqld.2.#galera_port wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' diff --git a/mysql-test/suite/galera/t/galera_wan.cnf b/mysql-test/suite/galera/t/galera_wan.cnf index 5f86e1cb61e..c01468b5073 100644 --- a/mysql-test/suite/galera/t/galera_wan.cnf +++ b/mysql-test/suite/galera/t/galera_wan.cnf @@ -4,13 +4,13 @@ loose-galera-wan=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.3] -wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;gmcast.segment=2' +wsrep_provider_options='gmcast.segment=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.4] -wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M;gmcast.segment=3' +wsrep_provider_options='gmcast.segment=3;repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf b/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf index 941ce694f0b..d101f5d5f53 100644 --- a/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf +++ b/mysql-test/suite/galera/t/galera_wan_restart_ist.cnf @@ -4,13 +4,13 @@ loose-galera-wan-restart-ist=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.3] -wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2' +wsrep_provider_options='gmcast.segment=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.4] -wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2' +wsrep_provider_options='gmcast.segment=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf b/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf index f549aeedf30..e8f6804ffe6 100644 --- a/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf +++ b/mysql-test/suite/galera/t/galera_wan_restart_sst.cnf @@ -4,13 +4,13 @@ loose-galera-wan-restart-sst=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1' +wsrep_provider_options='gmcast.segment=1;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.3] -wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2' +wsrep_provider_options='gmcast.segment=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.4] -wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=2' +wsrep_provider_options='gmcast.segment=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/mysql-wsrep#33.cnf b/mysql-test/suite/galera/t/mysql-wsrep#33.cnf index f1d42cd791f..7100721695f 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#33.cnf +++ b/mysql-test/suite/galera/t/mysql-wsrep#33.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf index 22e160c21b4..5cd16f029e0 100644 --- a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf +++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf @@ -24,6 +24,7 @@ wsrep-on=1 #sst_port=@OPT.port wsrep_cluster_address=gcomm:// wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' + wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf index 12ddc8621d1..b0229971c57 100644 --- a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf +++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf @@ -19,7 +19,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address=gcomm:// -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' @@ -31,7 +31,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' @@ -43,7 +43,7 @@ wsrep-on=1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port' diff --git a/mysql-test/suite/galera_3nodes/t/GAL-501.cnf b/mysql-test/suite/galera_3nodes/t/GAL-501.cnf index cd99c90bc16..7e521ee5c5b 100644 --- a/mysql-test/suite/galera_3nodes/t/GAL-501.cnf +++ b/mysql-test/suite/galera_3nodes/t/GAL-501.cnf @@ -6,7 +6,7 @@ wsrep_sst_method=rsync [mysqld.1] wsrep-cluster-address=gcomm:// wsrep_node_address=[::1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.1.port' bind-address=:: @@ -14,7 +14,7 @@ bind-address=:: [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' wsrep_node_address=[::1] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.2.port' bind-address=:: @@ -22,7 +22,7 @@ bind-address=:: [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' wsrep_node_address=[::1] -wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.3.port' bind-address=:: diff --git a/mysql-test/suite/galera_3nodes/t/GCF-354.cnf b/mysql-test/suite/galera_3nodes/t/GCF-354.cnf index e87e65ca58c..660266e2cce 100644 --- a/mysql-test/suite/galera_3nodes/t/GCF-354.cnf +++ b/mysql-test/suite/galera_3nodes/t/GCF-354.cnf @@ -7,10 +7,10 @@ loose-gcf-354=0 wsrep-debug=1 [mysqld.1] -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1G;pc.weight=4' +wsrep_provider_options='repl.causal_read_timeout=PT90S;pc.weight=4;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=256M' [mysqld.2] -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1G' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=256M' [mysqld.3] -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1G' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=256M' diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf index ed0e6204d3e..e7f79cfb40a 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf @@ -6,7 +6,7 @@ wsrep_sst_auth="root:" [mysqld.1] wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.1.port' @@ -15,7 +15,7 @@ bind-address=:: [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.2.port' @@ -25,7 +25,7 @@ bind-address=:: [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.3.port' diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf index aaad88ebcbd..765c465794e 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.cnf @@ -9,7 +9,7 @@ wsrep_sst_auth="root:" [mysqld.1] wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.1.port' @@ -18,7 +18,7 @@ bind-address=:: [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.2.port' @@ -28,7 +28,7 @@ bind-address=:: [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.3.port' diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf index 0a54fb8e4e1..e739704aa9d 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf @@ -5,7 +5,7 @@ wsrep_sst_method=rsync [mysqld.1] wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.1.port' @@ -13,7 +13,7 @@ bind-address=:: [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.2.port' @@ -21,7 +21,7 @@ bind-address=:: [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.3.port' diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf index 0a54fb8e4e1..e739704aa9d 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf @@ -5,7 +5,7 @@ wsrep_sst_method=rsync [mysqld.1] wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.1.port' @@ -13,7 +13,7 @@ bind-address=:: [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.2.port' @@ -21,7 +21,7 @@ bind-address=:: [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.3.port' diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf index 35196700044..8e62cad67f6 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync_section.cnf @@ -10,7 +10,7 @@ wsrep_sst_method=rsync [mysqld.1] wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.1.port' @@ -18,7 +18,7 @@ bind-address=:: [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.2.port' @@ -26,7 +26,7 @@ bind-address=:: [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1];evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_address=::1 wsrep_node_incoming_address='[::1]:@mysqld.3.port' diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf index 29563657262..3b8375ceae7 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf @@ -1,7 +1,7 @@ !include ../galera_3nodes.cnf [mysqld.1] -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1M' auto_increment_increment=1 auto_increment_offset=1 # this will force server restarts before this test @@ -9,14 +9,14 @@ loose-galera-ist-gcache-rollover=1 wsrep-debug=1 [mysqld.2] -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1M' auto_increment_increment=2 auto_increment_offset=2 loose-galera-ist-gcache-rollover=2 wsrep-debug=1 [mysqld.3] -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1M' auto_increment_increment=3 auto_increment_offset=3 loose-galera-ist-gcache-rollover=3 diff --git a/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf index d4c654e2bf8..58c3093d811 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ssl_reload.cnf @@ -5,10 +5,10 @@ wsrep-debug=1 loose-galera-ssl-reload=1 [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem' +wsrep_provider_options='socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem' +wsrep_provider_options='socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.3] -wsrep_provider_options='base_port=@mysqld.3.#galera_port;socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem' +wsrep_provider_options='socket.ssl=yes;socket.ssl_ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/client-key.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf index 557edbb09d9..18bae4a74e9 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf +++ b/mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split.cnf @@ -1,4 +1,4 @@ !include ../galera_3nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.weight=3' +wsrep_provider_options='pc.weight=3;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.cnf b/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.cnf index 82c001e0131..c9b6ff8c3f7 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.cnf +++ b/mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.cnf @@ -1,7 +1,8 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.recovery=false' +wsrep_provider_options='pc.recovery=false;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' + auto_increment_offset=1 [mysqld.2] diff --git a/mysql-test/suite/galera_sr/t/galera_sr_kill_slave.cnf b/mysql-test/suite/galera_sr/t/galera_sr_kill_slave.cnf index 290d8fe196e..d0509488d83 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_kill_slave.cnf +++ b/mysql-test/suite/galera_sr/t/galera_sr_kill_slave.cnf @@ -1,4 +1,4 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.weight=2' +wsrep_provider_options='pc.weight=2;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf index a4edaf98802..1007de9f779 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf +++ b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.cnf @@ -4,7 +4,7 @@ # causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf b/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf index 8f9e053487f..c56efcbf2d4 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf +++ b/mysql-test/suite/galera_sr/t/galera_sr_small_gcache.cnf @@ -1,7 +1,7 @@ !include ../galera_2nodes.cnf [mysqld.1] -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=16K' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=16K' [mysqld.2] -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=16K' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=16K' From 94ef07d61edd21d81eaa788c07a15e5508aacbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 24 Sep 2024 11:09:00 +0300 Subject: [PATCH 21/65] MDEV-32631 : galera_2_cluster: before_rollback(): Assertion `0' failed Test case changes only. Add wait_conditions to make sure nodes rejoin the cluster. Assertion itself should not be possible anymore as we do not allow sequences on Aria tables. Signed-off-by: Julius Goryavsky --- .../galera/r/galera_sequences,binlogoff.rdiff | 11 +++ .../suite/galera/r/galera_sequences.result | 13 ++++ .../suite/galera/t/galera_sequences.cnf | 4 - .../galera/t/galera_sequences.combinations | 5 ++ .../suite/galera/t/galera_sequences.test | 24 ++++++ mysql-test/suite/galera_3nodes/disabled.def | 2 - .../galera_3nodes/r/galera_2_cluster.result | 32 +++++++- .../galera_3nodes/t/galera_2_cluster.cnf | 9 +++ .../t/galera_2_cluster.combinations | 5 ++ .../galera_3nodes/t/galera_2_cluster.test | 74 +++++++++++++++---- 10 files changed, 155 insertions(+), 24 deletions(-) create mode 100644 mysql-test/suite/galera/r/galera_sequences,binlogoff.rdiff create mode 100644 mysql-test/suite/galera/t/galera_sequences.combinations create mode 100644 mysql-test/suite/galera_3nodes/t/galera_2_cluster.combinations diff --git a/mysql-test/suite/galera/r/galera_sequences,binlogoff.rdiff b/mysql-test/suite/galera/r/galera_sequences,binlogoff.rdiff new file mode 100644 index 00000000000..425d1175a09 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_sequences,binlogoff.rdiff @@ -0,0 +1,11 @@ +--- r/galera_sequences.result ++++ r/galera_sequences,binlogoff.reject +@@ -313,7 +313,7 @@ + 7 4 + SELECT NEXTVAL(t); + NEXTVAL(t) +-42 ++2 + connection node_1; + DROP TABLE t1; + DROP SEQUENCE t; diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result index 1f6b2bd6637..e78b89d4b09 100644 --- a/mysql-test/suite/galera/r/galera_sequences.result +++ b/mysql-test/suite/galera/r/galera_sequences.result @@ -279,6 +279,9 @@ NEXTVAL(t) connection node_1; DROP TABLE t1; DROP SEQUENCE t; +connection node_2; +SET SESSION wsrep_sync_wait=15; +connection node_1; CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; BEGIN; @@ -324,4 +327,14 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp ALTER SEQUENCE IF EXISTS t MINVALUE=1; ERROR 42000: This version of MariaDB doesn't yet support 'CACHE without INCREMENT BY 0 in Galera cluster' DROP TABLE t; + +MDEV-32631: + +CREATE OR REPLACE TABLE t1(c INT ) ENGINE=ARIA; +SET SESSION WSREP_OSU_METHOD=RSU; +INSERT INTO t1 SELECT seq,concat(seq,1) FROM seq_1_to_100; +ERROR 42000: This version of MariaDB doesn't yet support 'RSU on this table engine' +SET SESSION WSREP_OSU_METHOD=TOI; +DROP TABLE t1; + End of 10.5 tests diff --git a/mysql-test/suite/galera/t/galera_sequences.cnf b/mysql-test/suite/galera/t/galera_sequences.cnf index 3a0543e3d34..8701e86db5f 100644 --- a/mysql-test/suite/galera/t/galera_sequences.cnf +++ b/mysql-test/suite/galera/t/galera_sequences.cnf @@ -1,13 +1,9 @@ !include ../galera_2nodes.cnf [mysqld.1] -log-bin -log-slave-updates auto-increment-increment=2 auto-increment-offset=1 [mysqld.2] -log-bin -log-slave-updates auto-increment-increment=2 auto-increment-offset=2 diff --git a/mysql-test/suite/galera/t/galera_sequences.combinations b/mysql-test/suite/galera/t/galera_sequences.combinations new file mode 100644 index 00000000000..cef98e75213 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sequences.combinations @@ -0,0 +1,5 @@ +[binlogon] +log-bin +log-slave-updates + +[binlogoff] diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test index f99796264b6..db388de2551 100644 --- a/mysql-test/suite/galera/t/galera_sequences.test +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -1,6 +1,7 @@ --source include/galera_cluster.inc --source include/have_innodb.inc --source include/have_sequence.inc +--source include/have_aria.inc # # MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster @@ -317,6 +318,12 @@ SELECT NEXTVAL(t); DROP TABLE t1; DROP SEQUENCE t; +--connection node_2 +--let $wsrep_sync_wait_orig_2 = `SELECT @@wsrep_sync_wait` +SET SESSION wsrep_sync_wait=15; + +--connection node_1 + CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; # @@ -339,6 +346,10 @@ SELECT NEXTVAL(t); SELECT * FROM t1; SELECT NEXTVAL(t); +--disable_query_log +--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig_2 +--enable_query_log + --connection node_1 DROP TABLE t1; DROP SEQUENCE t; @@ -356,4 +367,17 @@ CREATE TABLE t1 (c VARCHAR) ENGINE=InnoDB; ALTER SEQUENCE IF EXISTS t MINVALUE=1; DROP TABLE t; + +--echo +--echo MDEV-32631: +--echo + +CREATE OR REPLACE TABLE t1(c INT ) ENGINE=ARIA; +SET SESSION WSREP_OSU_METHOD=RSU; +--error ER_NOT_SUPPORTED_YET +INSERT INTO t1 SELECT seq,concat(seq,1) FROM seq_1_to_100; +SET SESSION WSREP_OSU_METHOD=TOI; +DROP TABLE t1; + +--echo --echo End of 10.5 tests diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index 6fbfda9a07f..fcaf38a3d7b 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -9,5 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## - -galera_2_cluster : MDEV-32631 galera_2_cluster: before_rollback(): Assertion `0' failed diff --git a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result index 0a2be393d27..9a151c10b9b 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result +++ b/mysql-test/suite/galera_3nodes/r/galera_2_cluster.result @@ -1,5 +1,6 @@ connection node_2; connection node_1; +connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6; connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5; connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4; connection node_4; @@ -20,7 +21,6 @@ include/sync_with_master_gtid.inc SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 -connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6; connection node_6; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 @@ -50,12 +50,22 @@ SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; COUNT(*) = 3 1 connection node_2; +connection node_1; +connection node_3; +connection node_4; +connection node_5; +connection node_6; +connection node_2; OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize note Table does not support optimize, doing recreate + analyze instead test.t1 optimize status OK +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave connection node_1; +connection node_3; connection node_4; +connection node_5; connection node_6; connection node_1; DROP TABLE t1; @@ -74,19 +84,33 @@ connection node_2; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; -CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); connection node_3; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; -CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); connection node_5; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; -CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); connection node_6; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +connection node_1; CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); +connection node_2; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); +connection node_3; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); +connection node_4; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); +connection node_5; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); +connection node_6; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.cnf b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.cnf index 41c1c7c0519..297e0fad159 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.cnf @@ -1,25 +1,34 @@ !include ../galera_2x3nodes.cnf +[mysqld] +wsrep-debug=1 + [mysqld.1] wsrep_gtid_domain_id=1 server-id=11 +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT20S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S;pc.wait_prim_timeout=PT60S;gcache.size=128M;pc.weight=2' [mysqld.2] wsrep_gtid_domain_id=1 server-id=12 +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT20S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S;pc.wait_prim_timeout=PT60S;gcache.size=128M' [mysqld.3] wsrep_gtid_domain_id=1 server-id=13 +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT20S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S;pc.wait_prim_timeout=PT60S;gcache.size=128M' [mysqld.4] wsrep_gtid_domain_id=2 server-id=21 +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT20S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S;pc.wait_prim_timeout=PT60S;gcache.size=128M' [mysqld.5] wsrep_gtid_domain_id=2 server-id=22 +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT20S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S;pc.wait_prim_timeout=PT60S;gcache.size=128M' [mysqld.6] wsrep_gtid_domain_id=2 server-id=23 +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT20S;evs.inactive_timeout=PT30S;evs.install_timeout=PT25S;pc.wait_prim_timeout=PT60S;gcache.size=128M' diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.combinations b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.combinations new file mode 100644 index 00000000000..cef98e75213 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.combinations @@ -0,0 +1,5 @@ +[binlogon] +log-bin +log-slave-updates + +[binlogoff] diff --git a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test index 86119bf7bcb..a41a5096c7d 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test +++ b/mysql-test/suite/galera_3nodes/t/galera_2_cluster.test @@ -9,7 +9,9 @@ --source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/force_restart.inc +--connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6 --connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5 --connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 @@ -43,7 +45,6 @@ SELECT COUNT(*) = 1 FROM t1; SELECT COUNT(*) = 1 FROM t1; ---connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6 --connection node_6 SELECT COUNT(*) = 1 FROM t1; @@ -82,23 +83,46 @@ SELECT COUNT(*) = 3 FROM information_schema.columns WHERE table_name ='t1'; # --connection node_2 - ---let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -OPTIMIZE TABLE t1; +--let $wsrep_last_committed_before_2 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` --connection node_1 +--let $wsrep_last_committed_before_1 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` ---let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--connection node_3 +--let $wsrep_last_committed_before_3 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_4 +--let $wsrep_last_committed_before_4 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_5 +--let $wsrep_last_committed_before_5 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_6 +--let $wsrep_last_committed_before_6 = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_2 +OPTIMIZE TABLE t1; +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before_2 + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before_1 + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before_3 + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc --connection node_4 +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before_4 + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc ---let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--connection node_5 +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before_5 + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc --connection node_6 - ---let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before_6 + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' --source include/wait_condition.inc # @@ -116,6 +140,7 @@ RESET SLAVE; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc SET GLOBAL GTID_SLAVE_POS=""; --connection node_1 @@ -123,35 +148,56 @@ SET GLOBAL GTID_SLAVE_POS=""; SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc --connection node_2 SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; - -CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +--source include/wait_until_ready.inc --connection node_3 SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; - -CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +--source include/wait_until_ready.inc --connection node_5 SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; - -CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +--source include/wait_until_ready.inc --connection node_6 SET GLOBAL wsrep_on = OFF; RESET MASTER; SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc +connection node_1; CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); + +connection node_2; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); + +connection node_3; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); + +connection node_4; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); + +connection node_5; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); + +connection node_6; +CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since "); From 5ebff6e15a0c2e1b8a8e41943540332c757a6d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 18 Feb 2025 17:01:44 +0200 Subject: [PATCH 22/65] =?UTF-8?q?MDEV-36038=20ALTER=20TABLE=E2=80=A6SEQUEN?= =?UTF-8?q?CE=20does=20not=20work=20correctly=20with=20InnoDB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mysql_alter_table(): Consider ha_sequence::storage_ht() when determining if the storage engine changed. ha_sequence::check_if_supported_inplace_alter(): A new function, to ensure that ha_innobase::check_if_supported_inplace_alter() will be called on ALTER TABLE name_of_sequence SEQUENCE=0. ha_innobase::check_if_supported_inplace_alter(): For any change of the SEQUENCE attribute, always return HA_ALTER_INPLACE_NOT_SUPPORTED, forcing ALGORITHM=COPY. --- mysql-test/suite/sql_sequence/alter.opt | 1 + mysql-test/suite/sql_sequence/alter.result | 26 ++++++++++++++++++++++ mysql-test/suite/sql_sequence/alter.test | 19 ++++++++++++++++ sql/ha_sequence.cc | 6 +++++ sql/ha_sequence.h | 3 +++ sql/sql_table.cc | 3 ++- storage/innobase/handler/handler0alter.cc | 8 +++++++ 7 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/sql_sequence/alter.opt diff --git a/mysql-test/suite/sql_sequence/alter.opt b/mysql-test/suite/sql_sequence/alter.opt new file mode 100644 index 00000000000..c5eebd75ce5 --- /dev/null +++ b/mysql-test/suite/sql_sequence/alter.opt @@ -0,0 +1 @@ +--innodb-sys-tables diff --git a/mysql-test/suite/sql_sequence/alter.result b/mysql-test/suite/sql_sequence/alter.result index 0508660e82b..dc55040c135 100644 --- a/mysql-test/suite/sql_sequence/alter.result +++ b/mysql-test/suite/sql_sequence/alter.result @@ -166,6 +166,32 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si select next value for t1; next value for t1 11 +$check_innodb_flags; +is_sequence +12288 +alter table t1 sequence=0; +begin; +delete from t1; +rollback; +$check_innodb_flags; +is_sequence +0 +alter table t1 sequence=1; +$check_innodb_flags; +is_sequence +12288 +alter table t1 sequence=0, algorithm=copy; +$check_innodb_flags; +is_sequence +0 +alter table t1 sequence=1, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: SEQUENCE. Try ALGORITHM=COPY +alter table t1 sequence=1, algorithm=copy; +$check_innodb_flags; +is_sequence +12288 +alter table t1 sequence=0, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: SEQUENCE. Try ALGORITHM=COPY drop sequence t1; # # ALTER TABLE diff --git a/mysql-test/suite/sql_sequence/alter.test b/mysql-test/suite/sql_sequence/alter.test index fce2cb45838..34b83cb19d2 100644 --- a/mysql-test/suite/sql_sequence/alter.test +++ b/mysql-test/suite/sql_sequence/alter.test @@ -80,6 +80,25 @@ alter sequence t1 start=100; show create sequence t1; select * from t1; select next value for t1; +let $check_innodb_flags = +select flag & 12288 is_sequence from information_schema.innodb_sys_tables +where name='test/t1'; +evalp $check_innodb_flags; +alter table t1 sequence=0; +begin; +delete from t1; +rollback; +evalp $check_innodb_flags; +alter table t1 sequence=1; +evalp $check_innodb_flags; +alter table t1 sequence=0, algorithm=copy; +evalp $check_innodb_flags; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +alter table t1 sequence=1, algorithm=inplace; +alter table t1 sequence=1, algorithm=copy; +evalp $check_innodb_flags; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +alter table t1 sequence=0, algorithm=inplace; drop sequence t1; --echo # diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc index 3803042bec5..1e0e253a618 100644 --- a/sql/ha_sequence.cc +++ b/sql/ha_sequence.cc @@ -353,6 +353,12 @@ bool ha_sequence::check_if_incompatible_data(HA_CREATE_INFO *create_info, return(COMPATIBLE_DATA_YES); } +enum_alter_inplace_result +ha_sequence::check_if_supported_inplace_alter(TABLE *altered_table, + Alter_inplace_info *ai) +{ + return file->check_if_supported_inplace_alter(altered_table, ai); +} int ha_sequence::external_lock(THD *thd, int lock_type) { diff --git a/sql/ha_sequence.h b/sql/ha_sequence.h index 24fcc6baa31..3ce71b1da05 100644 --- a/sql/ha_sequence.h +++ b/sql/ha_sequence.h @@ -94,6 +94,9 @@ public: /* For ALTER ONLINE TABLE */ bool check_if_incompatible_data(HA_CREATE_INFO *create_info, uint table_changes) override; + enum_alter_inplace_result + check_if_supported_inplace_alter(TABLE *altered_table, + Alter_inplace_info *ai) override; void write_lock() { write_locked= 1;} void unlock() { write_locked= 0; } bool is_locked() { return write_locked; } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2b46fae9781..a080677a251 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -11534,7 +11534,8 @@ do_continue:; - Neither old or new engine uses files from another engine The above is mainly true for the sequence and the partition engine. */ - engine_changed= ((new_table->file->ht != table->file->ht) && + engine_changed= ((new_table->file->storage_ht() != + table->file->storage_ht()) && ((!(new_table->file->ha_table_flags() & HA_FILE_BASED) || !(table->file->ha_table_flags() & HA_FILE_BASED))) && !(table->file->ha_table_flags() & HA_REUSES_FILE_NAMES) && diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index e5824dcdb86..5afdcb3892e 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -2049,6 +2049,12 @@ ha_innobase::check_if_supported_inplace_alter( DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); } + if (ha_alter_info->create_info->used_fields + & HA_CREATE_USED_SEQUENCE) { + ha_alter_info->unsupported_reason = "SEQUENCE"; + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + update_thd(); if (!m_prebuilt->table->space) { @@ -6317,6 +6323,8 @@ prepare_inplace_alter_table_dict( DBUG_ASSERT(!ctx->add_index); DBUG_ASSERT(!ctx->add_key_numbers); DBUG_ASSERT(!ctx->num_to_add_index); + DBUG_ASSERT(!(ha_alter_info->create_info->used_fields + & HA_CREATE_USED_SEQUENCE)); user_table = ctx->new_table; From b167730499b359f247015447e985319814342bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 2 Jan 2025 11:13:32 +0200 Subject: [PATCH 23/65] MDEV-34891 : SST failure occurs when gtid_strict_mode is enabled Problem was that initial GTID was set on wsrep_before_prepare out-of-order. In practice GTID was set to same as previous executed transaction GTID. In recovery valid GTID was found from prepared transaction and this transaction is committed leading to fact that same GTID was executed twice. This is fixed by setting invalid GTID at wsrep_before_prepare and later in wsrep_before_commit actual correct GTID is set and this setting is done while we are in commit monitor i.e. assigment is done in order of replication. In recovery if prepared transaction is found we check its GTID, if it is invalid transaction will be rolled back and if it is valid it will be committed. Initialize gtid seqno from recovered seqno when bootstrapping a new cluster. Added two test cases for both mariabackup and rsync SST methods to show that GTIDs remain consistent on cluster and that all expected rows are in the table. Added tests for wsrep GTID recovery with binlog on and off. Signed-off-by: Julius Goryavsky --- .../r/galera_sst_mariabackup_gtid,debug.rdiff | 210 +++++++ .../r/galera_sst_mariabackup_gtid.result | 534 ++++++++++++++++++ .../r/galera_sst_rsync_gtid,debug.rdiff | 210 +++++++ .../galera/r/galera_sst_rsync_gtid.result | 534 ++++++++++++++++++ mysql-test/suite/galera/suite.pm | 2 +- .../galera/t/galera_sst_mariabackup_gtid.cnf | 28 + .../galera/t/galera_sst_mariabackup_gtid.test | 29 + .../suite/galera/t/galera_sst_rsync_gtid.cnf | 23 + .../suite/galera/t/galera_sst_rsync_gtid.test | 29 + mysql-test/suite/galera_3nodes/suite.pm | 2 +- mysql-test/suite/galera_3nodes_sr/suite.pm | 2 +- mysql-test/suite/galera_sr/suite.pm | 2 +- .../r/wsrep-recover-gtid-nobinlog.result | 18 + .../suite/wsrep/r/wsrep-recover-gtid.result | 65 +++ .../wsrep/t/wsrep-recover-gtid-nobinlog.cnf | 10 + .../wsrep/t/wsrep-recover-gtid-nobinlog.test | 28 + .../suite/wsrep/t/wsrep-recover-gtid.cnf | 14 + .../suite/wsrep/t/wsrep-recover-gtid.test | 73 +++ sql/handler.cc | 1 + sql/wsrep_mysqld.cc | 3 +- sql/wsrep_trans_observer.h | 15 +- sql/wsrep_xid.cc | 43 +- sql/wsrep_xid.h | 4 +- 23 files changed, 1853 insertions(+), 26 deletions(-) create mode 100644 mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff create mode 100644 mysql-test/suite/galera/r/galera_sst_mariabackup_gtid.result create mode 100644 mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff create mode 100644 mysql-test/suite/galera/r/galera_sst_rsync_gtid.result create mode 100644 mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.cnf create mode 100644 mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.test create mode 100644 mysql-test/suite/galera/t/galera_sst_rsync_gtid.cnf create mode 100644 mysql-test/suite/galera/t/galera_sst_rsync_gtid.test create mode 100644 mysql-test/suite/wsrep/r/wsrep-recover-gtid-nobinlog.result create mode 100644 mysql-test/suite/wsrep/r/wsrep-recover-gtid.result create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.test create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-gtid.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-gtid.test diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff new file mode 100644 index 00000000000..12609bb571f --- /dev/null +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff @@ -0,0 +1,210 @@ +--- suite/galera/r/galera_sst_mariabackup_gtid.result 2025-01-02 15:34:28.251593452 +0200 ++++ suite/galera/r/galera_sst_mariabackup_gtid.reject 2025-01-02 16:01:18.058469177 +0200 +@@ -516,19 +516,203 @@ + 1 + DROP TABLE t1; + COMMIT; ++Performing State Transfer on a server that has been killed and restarted ++while a DDL was in progress on it ++connection node_1; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); ++connection node_2; ++START TRANSACTION; ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); ++COMMIT; ++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; ++connection node_1; ++ALTER TABLE t1 ADD COLUMN f2 INTEGER; ++connection node_2; ++SET wsrep_sync_wait = 0; ++Killing server ... ++connection node_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); ++COMMIT; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); ++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); ++connection node_2; ++Performing --wsrep-recover ... ++connection node_2; ++Starting server ... ++Using --wsrep-start-position when starting mysqld ... ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); ++COMMIT; ++connection node_1; ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); ++COMMIT; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); ++COMMIT; ++connection node_1a_galera_st_kill_slave_ddl; ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); ++ROLLBACK; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++COMMIT; ++connection node_1; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++DROP TABLE t1; ++COMMIT; ++SET GLOBAL debug_dbug = $debug_orig; + connection node_1; + # Node_1 + SHOW global variables like 'gtid%pos'; + Variable_name Value +-gtid_binlog_pos 100-10-24 +-gtid_current_pos 100-10-24 ++gtid_binlog_pos 100-10-33 ++gtid_current_pos 100-10-33 + gtid_slave_pos + connection node_2; + # Node_2 + SHOW global variables like 'gtid%pos'; + Variable_name Value +-gtid_binlog_pos 100-10-24 +-gtid_current_pos 100-10-24 ++gtid_binlog_pos 100-10-33 ++gtid_current_pos 100-10-33 + gtid_slave_pos + disconnect node_2; + disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid.result b/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid.result new file mode 100644 index 00000000000..fa2397b722e --- /dev/null +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid.result @@ -0,0 +1,534 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +Performing State Transfer on a server that has been shut down cleanly and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Shutting down server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Starting server ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_shutdown_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that starts from a clean var directory +This is accomplished by shutting down node #2 and removing its var directory before restarting it +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Shutting down server ... +connection node_1; +Cleaning var directory ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Starting server ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_clean_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that has been killed and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Killing server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +Starting server ... +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +connection node_1; +# Node_1 +SHOW global variables like 'gtid%pos'; +Variable_name Value +gtid_binlog_pos 100-10-24 +gtid_current_pos 100-10-24 +gtid_slave_pos +connection node_2; +# Node_2 +SHOW global variables like 'gtid%pos'; +Variable_name Value +gtid_binlog_pos 100-10-24 +gtid_current_pos 100-10-24 +gtid_slave_pos +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff new file mode 100644 index 00000000000..0e3e85ef213 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff @@ -0,0 +1,210 @@ +--- suite/galera/r/galera_sst_rsync_gtid.result 2025-01-02 15:35:15.162175835 +0200 ++++ suite/galera/r/galera_sst_rsync_gtid.reject 2025-01-02 16:02:08.588902711 +0200 +@@ -516,19 +516,203 @@ + 1 + DROP TABLE t1; + COMMIT; ++Performing State Transfer on a server that has been killed and restarted ++while a DDL was in progress on it ++connection node_1; ++CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 VALUES (1,'node1_committed_before'); ++INSERT INTO t1 VALUES (2,'node1_committed_before'); ++INSERT INTO t1 VALUES (3,'node1_committed_before'); ++INSERT INTO t1 VALUES (4,'node1_committed_before'); ++INSERT INTO t1 VALUES (5,'node1_committed_before'); ++connection node_2; ++START TRANSACTION; ++INSERT INTO t1 VALUES (6,'node2_committed_before'); ++INSERT INTO t1 VALUES (7,'node2_committed_before'); ++INSERT INTO t1 VALUES (8,'node2_committed_before'); ++INSERT INTO t1 VALUES (9,'node2_committed_before'); ++INSERT INTO t1 VALUES (10,'node2_committed_before'); ++COMMIT; ++SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; ++connection node_1; ++ALTER TABLE t1 ADD COLUMN f2 INTEGER; ++connection node_2; ++SET wsrep_sync_wait = 0; ++Killing server ... ++connection node_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); ++INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); ++COMMIT; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); ++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); ++connection node_2; ++Performing --wsrep-recover ... ++connection node_2; ++Starting server ... ++Using --wsrep-start-position when starting mysqld ... ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); ++COMMIT; ++connection node_1; ++INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); ++COMMIT; ++SET AUTOCOMMIT=OFF; ++START TRANSACTION; ++INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); ++INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); ++COMMIT; ++connection node_1a_galera_st_kill_slave_ddl; ++INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); ++INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); ++ROLLBACK; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++COMMIT; ++connection node_1; ++SET AUTOCOMMIT=ON; ++SET SESSION wsrep_sync_wait=15; ++SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ++EXPECT_3 ++3 ++SELECT COUNT(*) AS EXPECT_35 FROM t1; ++EXPECT_35 ++35 ++SELECT * FROM t1; ++id f1 f2 ++1 node1_committed_before NULL ++2 node1_committed_before NULL ++3 node1_committed_before NULL ++4 node1_committed_before NULL ++5 node1_committed_before NULL ++6 node2_committed_before NULL ++7 node2_committed_before NULL ++8 node2_committed_before NULL ++9 node2_committed_before NULL ++10 node2_committed_before NULL ++11 node1_committed_during NULL ++12 node1_committed_during NULL ++13 node1_committed_during NULL ++14 node1_committed_during NULL ++15 node1_committed_during NULL ++16 node1_to_be_committed_after NULL ++17 node1_to_be_committed_after NULL ++18 node1_to_be_committed_after NULL ++19 node1_to_be_committed_after NULL ++20 node1_to_be_committed_after NULL ++26 node2_committed_after NULL ++27 node2_committed_after NULL ++28 node2_committed_after NULL ++29 node2_committed_after NULL ++30 node2_committed_after NULL ++31 node1_to_be_committed_after NULL ++32 node1_to_be_committed_after NULL ++33 node1_to_be_committed_after NULL ++34 node1_to_be_committed_after NULL ++35 node1_to_be_committed_after NULL ++36 node1_committed_after NULL ++37 node1_committed_after NULL ++38 node1_committed_after NULL ++39 node1_committed_after NULL ++40 node1_committed_after NULL ++SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; ++COUNT(*) = 0 ++1 ++DROP TABLE t1; ++COMMIT; ++SET GLOBAL debug_dbug = $debug_orig; + connection node_1; + # Node_1 + SHOW global variables like 'gtid%pos'; + Variable_name Value +-gtid_binlog_pos 100-10-24 +-gtid_current_pos 100-10-24 ++gtid_binlog_pos 100-10-33 ++gtid_current_pos 100-10-33 + gtid_slave_pos + connection node_2; + # Node_2 + SHOW global variables like 'gtid%pos'; + Variable_name Value +-gtid_binlog_pos 100-10-24 +-gtid_current_pos 100-10-24 ++gtid_binlog_pos 100-10-33 ++gtid_current_pos 100-10-33 + gtid_slave_pos + disconnect node_2; + disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_gtid.result b/mysql-test/suite/galera/r/galera_sst_rsync_gtid.result new file mode 100644 index 00000000000..fa2397b722e --- /dev/null +++ b/mysql-test/suite/galera/r/galera_sst_rsync_gtid.result @@ -0,0 +1,534 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +Performing State Transfer on a server that has been shut down cleanly and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Shutting down server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Starting server ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_shutdown_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that starts from a clean var directory +This is accomplished by shutting down node #2 and removing its var directory before restarting it +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Shutting down server ... +connection node_1; +Cleaning var directory ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Starting server ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_clean_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * from t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +Performing State Transfer on a server that has been killed and restarted +connection node_1; +CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1,'node1_committed_before'); +INSERT INTO t1 VALUES (2,'node1_committed_before'); +INSERT INTO t1 VALUES (3,'node1_committed_before'); +INSERT INTO t1 VALUES (4,'node1_committed_before'); +INSERT INTO t1 VALUES (5,'node1_committed_before'); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (6,'node2_committed_before'); +INSERT INTO t1 VALUES (7,'node2_committed_before'); +INSERT INTO t1 VALUES (8,'node2_committed_before'); +INSERT INTO t1 VALUES (9,'node2_committed_before'); +INSERT INTO t1 VALUES (10,'node2_committed_before'); +COMMIT; +Killing server ... +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (11,'node1_committed_during'); +INSERT INTO t1 VALUES (12,'node1_committed_during'); +INSERT INTO t1 VALUES (13,'node1_committed_during'); +INSERT INTO t1 VALUES (14,'node1_committed_during'); +INSERT INTO t1 VALUES (15,'node1_committed_during'); +COMMIT; +START TRANSACTION; +INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); +connection node_2; +Performing --wsrep-recover ... +Starting server ... +Using --wsrep-start-position when starting mysqld ... +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (26,'node2_committed_after'); +INSERT INTO t1 VALUES (27,'node2_committed_after'); +INSERT INTO t1 VALUES (28,'node2_committed_after'); +INSERT INTO t1 VALUES (29,'node2_committed_after'); +INSERT INTO t1 VALUES (30,'node2_committed_after'); +COMMIT; +connection node_1; +INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); +INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); +COMMIT; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (36,'node1_committed_after'); +INSERT INTO t1 VALUES (37,'node1_committed_after'); +INSERT INTO t1 VALUES (38,'node1_committed_after'); +INSERT INTO t1 VALUES (39,'node1_committed_after'); +INSERT INTO t1 VALUES (40,'node1_committed_after'); +COMMIT; +connection node_1a_galera_st_kill_slave; +INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); +INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); +ROLLBACK; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +COMMIT; +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_35 FROM t1; +EXPECT_35 +35 +SELECT * FROM t1; +id f1 +1 node1_committed_before +2 node1_committed_before +3 node1_committed_before +4 node1_committed_before +5 node1_committed_before +6 node2_committed_before +7 node2_committed_before +8 node2_committed_before +9 node2_committed_before +10 node2_committed_before +11 node1_committed_during +12 node1_committed_during +13 node1_committed_during +14 node1_committed_during +15 node1_committed_during +16 node1_to_be_committed_after +17 node1_to_be_committed_after +18 node1_to_be_committed_after +19 node1_to_be_committed_after +20 node1_to_be_committed_after +26 node2_committed_after +27 node2_committed_after +28 node2_committed_after +29 node2_committed_after +30 node2_committed_after +31 node1_to_be_committed_after +32 node1_to_be_committed_after +33 node1_to_be_committed_after +34 node1_to_be_committed_after +35 node1_to_be_committed_after +36 node1_committed_after +37 node1_committed_after +38 node1_committed_after +39 node1_committed_after +40 node1_committed_after +SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; +COUNT(*) = 0 +1 +DROP TABLE t1; +COMMIT; +connection node_1; +# Node_1 +SHOW global variables like 'gtid%pos'; +Variable_name Value +gtid_binlog_pos 100-10-24 +gtid_current_pos 100-10-24 +gtid_slave_pos +connection node_2; +# Node_2 +SHOW global variables like 'gtid%pos'; +Variable_name Value +gtid_binlog_pos 100-10-24 +gtid_current_pos 100-10-24 +gtid_slave_pos +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index 404025fb175..8f2a0cf5385 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -29,7 +29,7 @@ push @::global_suppressions, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), - qr(WSREP: .* sending install message failed: Transport endpoint is not connected), + qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), qr(WSREP: Maximum writeset size exceeded by ), qr(WSREP: transaction size exceeded), diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.cnf new file mode 100644 index 00000000000..053c2175946 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.cnf @@ -0,0 +1,28 @@ +!include ../galera_2nodes.cnf + +[mysqld] +wsrep_sst_method=mariabackup +wsrep_sst_auth="root:" +gtid_strict_mode=ON +wsrep-gtid_mode=ON +log-bin +log-slave_updates +loose-galera-sst-mariabackup-gtid=1 + +[mysqld.1] +wsrep_provider_options='pc.weight=2;pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +gtid_domain_id=10 +wsrep_gtid_domain_id=100 +wsrep_slave_threads=4 +server-id=10 + +[mysqld.2] +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +gtid_domain_id=10 +wsrep_gtid_domain_id=100 +wsrep_slave_threads=4 +server-id=10 + +[sst] +transferfmt=@ENV.MTR_GALERA_TFMT +streamfmt=mbstream diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.test b/mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.test new file mode 100644 index 00000000000..66cd0c92307 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.test @@ -0,0 +1,29 @@ +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_mariabackup.inc +--source include/force_restart.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +--source suite/galera/include/galera_st_shutdown_slave.inc +--source suite/galera/include/galera_st_clean_slave.inc + +--source suite/galera/include/galera_st_kill_slave.inc +--source suite/galera/include/galera_st_kill_slave_ddl.inc + +# Restore original auto_increment_offset values. +--source include/auto_increment_offset_restore.inc + +--connection node_1 +--echo # Node_1 +SHOW global variables like 'gtid%pos'; + +--connection node_2 +--echo # Node_2 +SHOW global variables like 'gtid%pos'; + +--source include/galera_end.inc diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_gtid.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_gtid.cnf new file mode 100644 index 00000000000..af5d2225bba --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sst_rsync_gtid.cnf @@ -0,0 +1,23 @@ +!include ../galera_2nodes.cnf + +[mysqld] +wsrep_sst_method=rsync +gtid_strict_mode=ON +wsrep-gtid_mode=ON +log-bin +log-slave_updates +loose-galera-sst-rsync-gtid=1 + +[mysqld.1] +wsrep_provider_options='pc.weight=2;pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +gtid_domain_id=10 +wsrep_gtid_domain_id=100 +wsrep_slave_threads=4 +server-id=10 + +[mysqld.2] +wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +gtid_domain_id=10 +wsrep_gtid_domain_id=100 +wsrep_slave_threads=4 +server-id=10 diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_gtid.test b/mysql-test/suite/galera/t/galera_sst_rsync_gtid.test new file mode 100644 index 00000000000..66cd0c92307 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sst_rsync_gtid.test @@ -0,0 +1,29 @@ +--source include/big_test.inc +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_mariabackup.inc +--source include/force_restart.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +--source suite/galera/include/galera_st_shutdown_slave.inc +--source suite/galera/include/galera_st_clean_slave.inc + +--source suite/galera/include/galera_st_kill_slave.inc +--source suite/galera/include/galera_st_kill_slave_ddl.inc + +# Restore original auto_increment_offset values. +--source include/auto_increment_offset_restore.inc + +--connection node_1 +--echo # Node_1 +SHOW global variables like 'gtid%pos'; + +--connection node_2 +--echo # Node_2 +SHOW global variables like 'gtid%pos'; + +--source include/galera_end.inc diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm index 9f45e22d459..c1cc1ef4076 100644 --- a/mysql-test/suite/galera_3nodes/suite.pm +++ b/mysql-test/suite/galera_3nodes/suite.pm @@ -28,7 +28,7 @@ push @::global_suppressions, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), - qr(WSREP: .* sending install message failed: Transport endpoint is not connected), + qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), qr(WSREP: Maximum writeset size exceeded by ), qr(WSREP: transaction size exceeded), diff --git a/mysql-test/suite/galera_3nodes_sr/suite.pm b/mysql-test/suite/galera_3nodes_sr/suite.pm index 3cc7af0666c..54489387ec5 100644 --- a/mysql-test/suite/galera_3nodes_sr/suite.pm +++ b/mysql-test/suite/galera_3nodes_sr/suite.pm @@ -29,7 +29,7 @@ push @::global_suppressions, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), - qr(WSREP: .* sending install message failed: Transport endpoint is not connected), + qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), qr(WSREP: Could not find peer:), qr|WSREP: gcs_caused\(\) returned |, diff --git a/mysql-test/suite/galera_sr/suite.pm b/mysql-test/suite/galera_sr/suite.pm index f60ad1eefe3..a0e386a52b7 100644 --- a/mysql-test/suite/galera_sr/suite.pm +++ b/mysql-test/suite/galera_sr/suite.pm @@ -28,7 +28,7 @@ push @::global_suppressions, qr(WSREP: no nodes coming from prim view, prim not possible), qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), - qr(WSREP: .* sending install message failed: Transport endpoint is not connected), + qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), qr(WSREP: Maximum writeset size exceeded by ), qr(WSREP: transaction size exceeded), diff --git a/mysql-test/suite/wsrep/r/wsrep-recover-gtid-nobinlog.result b/mysql-test/suite/wsrep/r/wsrep-recover-gtid-nobinlog.result new file mode 100644 index 00000000000..2429434ae53 --- /dev/null +++ b/mysql-test/suite/wsrep/r/wsrep-recover-gtid-nobinlog.result @@ -0,0 +1,18 @@ +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; +# Case 1: Server goes through graceful shutdown and is restarted +connection default; +INSERT INTO t1 VALUES (1); +Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); +WSREP_LAST_SEEN_GTID() +100-10-2 +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); +WSREP_LAST_SEEN_GTID() +100-10-2 +SELECT * FROM t1; +f1 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/r/wsrep-recover-gtid.result b/mysql-test/suite/wsrep/r/wsrep-recover-gtid.result new file mode 100644 index 00000000000..682cecca8bb --- /dev/null +++ b/mysql-test/suite/wsrep/r/wsrep-recover-gtid.result @@ -0,0 +1,65 @@ +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; +# Case 1: Server goes through graceful shutdown and is restarted +connection default; +INSERT INTO t1 VALUES (1); +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); +WSREP_LAST_SEEN_GTID() +100-10-2 +SELECT @@GLOBAL.gtid_binlog_pos; +@@GLOBAL.gtid_binlog_pos +100-10-2 +SELECT * FROM t1; +f1 +1 +# Case 2: Server is killed after the transaction gets prepared +# but before it is written into binlog. As there is not GTID assigned, +# the transaction must be rolled back during recovery. +connect con, localhost, root; +SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL reached WAIT_FOR continue"; +INSERT INTO t1 VALUES (2); +connection default; +SET DEBUG_SYNC = "now WAIT_FOR reached"; +# Kill the server +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); +WSREP_LAST_SEEN_GTID() +100-10-2 +SELECT @@GLOBAL.gtid_binlog_pos; +@@GLOBAL.gtid_binlog_pos +100-10-2 +Expect 1 +SELECT * FROM t1; +f1 +1 +disconnect con; +# Case 3: Server is killed after the transaction gets written into binlog +# but before it is committed in storage engine. In this case the +# transaction must be committed during recovery as it had a valid +# GTID assigned. +connect con, localhost, root; +SET DEBUG_SYNC = "commit_before_get_LOCK_commit_ordered SIGNAL reached WAIT_FOR continue"; +INSERT INTO t1 VALUES (3); +connection default; +SET DEBUG_SYNC = "now WAIT_FOR reached"; +# Kill the server +Performing --wsrep-recover ... +Using --wsrep-start-position when starting mysqld ... +Expect 100-10-3 +SELECT WSREP_LAST_SEEN_GTID(); +WSREP_LAST_SEEN_GTID() +100-10-3 +SELECT @@GLOBAL.gtid_binlog_pos; +@@GLOBAL.gtid_binlog_pos +100-10-3 +Expect 1 3 +SELECT * FROM t1; +f1 +1 +3 +disconnect con; +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.cnf b/mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.cnf new file mode 100644 index 00000000000..a6b93d651bd --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.cnf @@ -0,0 +1,10 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address=gcomm:// +binlog-format=ROW +wsrep-gtid-domain-id=100 +server-id=10 +innodb-autoinc-lock-mode=2 diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.test b/mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.test new file mode 100644 index 00000000000..06685ebdd17 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.test @@ -0,0 +1,28 @@ +# Test wsrep GTID recovery with binlog off. The test restarts the server +# and verifies that the GTID returned by SELECT WSREP_LAST_SEEN_GTID() +# gets initialized properly during server restart. +# +--source include/have_wsrep.inc +--source include/have_wsrep_provider.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; + +--echo # Case 1: Server goes through graceful shutdown and is restarted +--connection default +INSERT INTO t1 VALUES (1); + +--echo Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); + +--source include/shutdown_mysqld.inc +--let $galera_wsrep_recover_server_id = 1 +--source suite/galera/include/galera_wsrep_recover.inc +--source suite/galera/include/start_mysqld.inc + +--echo Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); +SELECT * FROM t1; + +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-gtid.cnf b/mysql-test/suite/wsrep/t/wsrep-recover-gtid.cnf new file mode 100644 index 00000000000..7080157b2b4 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-gtid.cnf @@ -0,0 +1,14 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address=gcomm:// +binlog-format=ROW +log-bin +log-slave-updates +gtid-domain-id=10 +gtid-strict-mode=ON +wsrep-gtid-mode=ON +wsrep-gtid-domain-id=100 +server-id=10 diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-gtid.test b/mysql-test/suite/wsrep/t/wsrep-recover-gtid.test new file mode 100644 index 00000000000..2113bafb6de --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-gtid.test @@ -0,0 +1,73 @@ +# Test wsrep recovery with gtid_mode=ON. The test crashes the server +# in different commit stages and verifies that the GTID returned by +# SELECT WSREP_LAST_SEEN_GTID() and @@GLOBAL.gtid_binlog_pos get +# initialized properly during server restart. +# +--source include/have_wsrep.inc +--source include/have_wsrep_provider.inc +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; + +--echo # Case 1: Server goes through graceful shutdown and is restarted +--connection default +INSERT INTO t1 VALUES (1); +--source include/shutdown_mysqld.inc +--let $galera_wsrep_recover_server_id = 1 +--source suite/galera/include/galera_wsrep_recover.inc +--source suite/galera/include/start_mysqld.inc + +--echo Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); +SELECT @@GLOBAL.gtid_binlog_pos; +SELECT * FROM t1; + +--echo # Case 2: Server is killed after the transaction gets prepared +--echo # but before it is written into binlog. As there is not GTID assigned, +--echo # the transaction must be rolled back during recovery. +--connect con, localhost, root +SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL reached WAIT_FOR continue"; +--send INSERT INTO t1 VALUES (2) + +--connection default +SET DEBUG_SYNC = "now WAIT_FOR reached"; +--source include/kill_mysqld.inc +--let $galera_wsrep_recover_server_id = 1 +--source suite/galera/include/galera_wsrep_recover.inc +--source suite/galera/include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +--echo Expect 100-10-2 +SELECT WSREP_LAST_SEEN_GTID(); +SELECT @@GLOBAL.gtid_binlog_pos; +--echo Expect 1 +SELECT * FROM t1; +--disconnect con + +--echo # Case 3: Server is killed after the transaction gets written into binlog +--echo # but before it is committed in storage engine. In this case the +--echo # transaction must be committed during recovery as it had a valid +--echo # GTID assigned. + +--connect con, localhost, root +SET DEBUG_SYNC = "commit_before_get_LOCK_commit_ordered SIGNAL reached WAIT_FOR continue"; +--send INSERT INTO t1 VALUES (3) + +--connection default +SET DEBUG_SYNC = "now WAIT_FOR reached"; +--source include/kill_mysqld.inc +--let $galera_wsrep_recover_server_id = 1 +--source suite/galera/include/galera_wsrep_recover.inc +--source suite/galera/include/start_mysqld.inc +--source include/wait_wsrep_ready.inc +--echo Expect 100-10-3 +SELECT WSREP_LAST_SEEN_GTID(); +SELECT @@GLOBAL.gtid_binlog_pos; +--echo Expect 1 3 +SELECT * FROM t1; + +--disconnect con + +DROP TABLE t1; diff --git a/sql/handler.cc b/sql/handler.cc index 22bc363e88c..2be0740fdd8 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2454,6 +2454,7 @@ static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin, // recovery mode if (IF_WSREP((wsrep_emulate_bin_log && wsrep_is_wsrep_xid(info->list + i) && + !wsrep_is_xid_gtid_undefined(info->list + i) && x <= wsrep_limit), false) || (info->commit_list ? my_hash_search(info->commit_list, (uchar *)&x, sizeof(x)) != 0 : diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 569bfa35f75..f0fc9c37dae 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -819,7 +819,8 @@ void wsrep_init_globals() wsrep_server_gtid_t new_gtid; new_gtid.domain_id= wsrep_gtid_domain_id; new_gtid.server_id= global_system_variables.server_id; - new_gtid.seqno= 0; + /* Use seqno which was recovered in wsrep_init_gtid() */ + new_gtid.seqno= wsrep_gtid_server.seqno(); /* Try to search for domain_id and server_id combination in binlog if found continue from last seqno */ wsrep_get_binlog_gtid_seqno(new_gtid); wsrep_gtid_server.gtid(new_gtid); diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h index 028882d428b..7e5fcf3930e 100644 --- a/sql/wsrep_trans_observer.h +++ b/sql/wsrep_trans_observer.h @@ -1,4 +1,4 @@ -/* Copyright 2016-2023 Codership Oy +/* Copyright 2016-2025 Codership Oy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -265,12 +265,17 @@ static inline int wsrep_before_prepare(THD* thd, bool all) { DBUG_RETURN(ret); } + if ((ret= thd->wsrep_cs().before_prepare()) == 0) { DBUG_ASSERT(!thd->wsrep_trx().ws_meta().gtid().is_undefined()); + /* Here we init xid with UUID and wsrep seqno. GTID is + set to undefined because commit order is decided later + in wsrep_before_commit(). wsrep_before_prepare() is + executed out of order. */ wsrep_xid_init(&thd->wsrep_xid, thd->wsrep_trx().ws_meta().gtid(), - wsrep_gtid_server.gtid()); + wsrep_gtid_server.undefined()); } mysql_mutex_lock(&thd->LOCK_thd_kill); @@ -470,12 +475,6 @@ static inline int wsrep_after_statement(THD* thd) { DBUG_ENTER("wsrep_after_statement"); - WSREP_DEBUG("wsrep_after_statement for %lu client_state %s " - " client_mode %s trans_state %s", - thd_get_thread_id(thd), - wsrep::to_c_string(thd->wsrep_cs().state()), - wsrep::to_c_string(thd->wsrep_cs().mode()), - wsrep::to_c_string(thd->wsrep_cs().transaction().state())); int ret= ((thd->wsrep_cs().state() != wsrep::client_state::s_none && thd->wsrep_cs().mode() == Wsrep_client_state::m_local) && !thd->internal_transaction() ? diff --git a/sql/wsrep_xid.cc b/sql/wsrep_xid.cc index 34eafe9c46c..12647907881 100644 --- a/sql/wsrep_xid.cc +++ b/sql/wsrep_xid.cc @@ -1,4 +1,4 @@ -/* Copyright 2015 Codership Oy +/* Copyright 2015-2025 Codership Oy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,8 @@ #include #include /* std::sort() */ +#include /* std::string */ +#include /* std::stringstream */ /* * WSREPXid */ @@ -119,11 +121,7 @@ static my_bool set_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg) if (hton->set_checkpoint) { - const unsigned char* uuid= wsrep_xid_uuid(xid); - char uuid_str[40]= {0, }; - wsrep_uuid_print((const wsrep_uuid_t*)uuid, uuid_str, sizeof(uuid_str)); - WSREP_DEBUG("Set WSREPXid for InnoDB: %s:%lld", - uuid_str, (long long)wsrep_xid_seqno(xid)); + WSREP_DEBUG("Set WSREPXid for InnoDB: %s", wsrep_xid_print(xid).c_str()); hton->set_checkpoint(hton, xid); } return FALSE; @@ -150,12 +148,7 @@ static my_bool get_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg) if (hton->get_checkpoint) { hton->get_checkpoint(hton, xid); - wsrep_uuid_t uuid; - memcpy(&uuid, wsrep_xid_uuid(xid), sizeof(uuid)); - char uuid_str[40]= {0, }; - wsrep_uuid_print(&uuid, uuid_str, sizeof(uuid_str)); - WSREP_DEBUG("Read WSREPXid from InnoDB: %s:%lld", - uuid_str, (long long)wsrep_xid_seqno(xid)); + WSREP_DEBUG("Read WSREPXid from InnoDB: %s", wsrep_xid_print(xid).c_str()); } return FALSE; } @@ -252,3 +245,29 @@ void wsrep_sort_xid_array(XID *array, int len) { std::sort(array, array + len, Wsrep_xid_cmp()); } + +std::string wsrep_xid_print(const XID *xid) +{ + std::stringstream ss; + const unsigned char* uuid= wsrep_xid_uuid(xid); + char uuid_str[40]= {0, }; + wsrep_uuid_print((const wsrep_uuid_t*)uuid, uuid_str, sizeof(uuid_str)); + wsrep_server_gtid_t gtid= {0,0,0}; + memcpy(>id, &xid->data[WSREP_XID_RPL_GTID_OFFSET], sizeof(wsrep_server_gtid_t)); + ss << uuid_str << ":" << wsrep_xid_seqno(xid) << " " << gtid.domain_id << "-" + << gtid.server_id << "-" << gtid.seqno; + return ss.str(); +} + +bool wsrep_is_xid_gtid_undefined(const XID *xid) +{ + wsrep_server_gtid_t gtid= {0,0,0}; + + if (wsrep_is_wsrep_xid(xid) && + xid->data[WSREP_XID_VERSION_OFFSET] == WSREP_XID_VERSION_3) + { + memcpy(>id, &xid->data[WSREP_XID_RPL_GTID_OFFSET], sizeof(wsrep_server_gtid_t)); + } + + return (gtid.seqno == 0 && gtid.server_id == 0 && gtid.domain_id == 0); +} diff --git a/sql/wsrep_xid.h b/sql/wsrep_xid.h index 45ba6ffee6b..6eb812c81ce 100644 --- a/sql/wsrep_xid.h +++ b/sql/wsrep_xid.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Codership Oy +/* Copyright (C) 2015-2025 Codership Oy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,8 @@ bool wsrep_set_SE_checkpoint(const wsrep::gtid& gtid, const wsrep_server_gtid_t& //void wsrep_set_SE_checkpoint(XID&); /* uncomment if needed */ void wsrep_sort_xid_array(XID *array, int len); +std::string wsrep_xid_print(const XID *xid); +bool wsrep_is_xid_gtid_undefined(const XID *xid); #endif /* WITH_WSREP */ #endif /* WSREP_UTILS_H */ From f3687ccaafe3f4216e832c429c6494d0e76b54ac Mon Sep 17 00:00:00 2001 From: Aryan Arora Date: Fri, 21 Feb 2025 09:31:21 +0530 Subject: [PATCH 24/65] MDEV-27126 my_getopt compares option names case sensitively my_getopt compares option names case-sensitively, causing "Unknown option" errors when users type mixed-case options like wsrep_slave_UK_checks in lowercase wsrep_slave_fk_checks. Made the comparison in the getopt_compare_strings() case-insensitive. --- mysql-test/main/my_getopt_case_insensitive.opt | 1 + mysql-test/main/my_getopt_case_insensitive.result | 8 ++++++++ mysql-test/main/my_getopt_case_insensitive.test | 8 ++++++++ .../suite/wsrep/r/wsrep_mixed_case_cmd_arg.result | 8 ++++++++ mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf | 7 +++++++ mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.opt | 1 + .../suite/wsrep/t/wsrep_mixed_case_cmd_arg.test | 11 +++++++++++ mysys/my_getopt.c | 3 ++- 8 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 mysql-test/main/my_getopt_case_insensitive.opt create mode 100644 mysql-test/main/my_getopt_case_insensitive.result create mode 100644 mysql-test/main/my_getopt_case_insensitive.test create mode 100644 mysql-test/suite/wsrep/r/wsrep_mixed_case_cmd_arg.result create mode 100644 mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.opt create mode 100644 mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.test diff --git a/mysql-test/main/my_getopt_case_insensitive.opt b/mysql-test/main/my_getopt_case_insensitive.opt new file mode 100644 index 00000000000..cadcd15e765 --- /dev/null +++ b/mysql-test/main/my_getopt_case_insensitive.opt @@ -0,0 +1 @@ +--slOw_QuEry_loG=OFF diff --git a/mysql-test/main/my_getopt_case_insensitive.result b/mysql-test/main/my_getopt_case_insensitive.result new file mode 100644 index 00000000000..0ab93079fbf --- /dev/null +++ b/mysql-test/main/my_getopt_case_insensitive.result @@ -0,0 +1,8 @@ +# +# MDEV-27126: my_getopt compares option names case sensitively +# +# Check if the variable is set correctly from options +SELECT @@GLOBAL.slow_query_log; +@@GLOBAL.slow_query_log +0 +# End of test. diff --git a/mysql-test/main/my_getopt_case_insensitive.test b/mysql-test/main/my_getopt_case_insensitive.test new file mode 100644 index 00000000000..5b301375034 --- /dev/null +++ b/mysql-test/main/my_getopt_case_insensitive.test @@ -0,0 +1,8 @@ +--echo # +--echo # MDEV-27126: my_getopt compares option names case sensitively +--echo # + +--echo # Check if the variable is set correctly from options +SELECT @@GLOBAL.slow_query_log; + +--echo # End of test. diff --git a/mysql-test/suite/wsrep/r/wsrep_mixed_case_cmd_arg.result b/mysql-test/suite/wsrep/r/wsrep_mixed_case_cmd_arg.result new file mode 100644 index 00000000000..6eb68ca13a5 --- /dev/null +++ b/mysql-test/suite/wsrep/r/wsrep_mixed_case_cmd_arg.result @@ -0,0 +1,8 @@ +# +# MDEV-27126: my_getopt compares option names case sensitively +# +# Check if the variable is set correctly from options +SELECT @@GLOBAL.wsrep_slave_uk_checks; +@@GLOBAL.wsrep_slave_uk_checks +1 +# End of test. diff --git a/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf new file mode 100644 index 00000000000..0bf01f81fc5 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf @@ -0,0 +1,7 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address=gcomm:// + diff --git a/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.opt b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.opt new file mode 100644 index 00000000000..d13f9f874c9 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.opt @@ -0,0 +1 @@ +--wsrep-slave-uk-checks=1 diff --git a/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.test b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.test new file mode 100644 index 00000000000..acfe8fd6c45 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.test @@ -0,0 +1,11 @@ +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc +--echo # +--echo # MDEV-27126: my_getopt compares option names case sensitively +--echo # + +--echo # Check if the variable is set correctly from options +SELECT @@GLOBAL.wsrep_slave_uk_checks; + +--echo # End of test. diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 40cc17d0c22..ada7f883b01 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -962,7 +963,7 @@ my_bool getopt_compare_strings(register const char *s, register const char *t, for (;s != end ; s++, t++) { - if ((*s != '-' ? *s : '_') != (*t != '-' ? *t : '_')) + if ((*s != '-' ? tolower(*s) : '_') != (*t != '-' ? tolower(*t) : '_')) DBUG_RETURN(1); } DBUG_RETURN(0); From 0fa141ebb4639c5c6c4b5d990f448a932fd095a8 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 24 Feb 2025 12:10:32 +1100 Subject: [PATCH 25/65] MDEV-36138 Server null-pointer crash at startup when tmptables left in --tmpdir Fix a regression introduced in MDEV-35840 78157c4765f2c086fabe183d51d7734ecffdbdd8 Also tested compiling with -O3 that the -Warray-bounds fixed in MDEV-35840 does not resurface --- mysql-test/main/temp_table_frm.result | 6 ++++++ mysql-test/main/temp_table_frm.test | 13 ++++++++++++- sql/sql_base.cc | 6 ++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/mysql-test/main/temp_table_frm.result b/mysql-test/main/temp_table_frm.result index a9c59ff5969..e54d91bf940 100644 --- a/mysql-test/main/temp_table_frm.result +++ b/mysql-test/main/temp_table_frm.result @@ -25,3 +25,9 @@ OPENED_VIEWS 0 set @@use_stat_tables= @save_use_stat_tables; set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t1; +# +# MDEV-36138 Server null-pointer crash at startup when tmptables left in --tmpdir +# +create table t1 (c int); +drop table t1; +# restart diff --git a/mysql-test/main/temp_table_frm.test b/mysql-test/main/temp_table_frm.test index 47d2fc40d20..1f36238f418 100644 --- a/mysql-test/main/temp_table_frm.test +++ b/mysql-test/main/temp_table_frm.test @@ -24,4 +24,15 @@ select variable_name, session_status.variable_value - t1.variable_value from information_schema.session_status join t1 using (variable_name); set @@use_stat_tables= @save_use_stat_tables; set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; -drop table t1; \ No newline at end of file +drop table t1; + +--echo # +--echo # MDEV-36138 Server null-pointer crash at startup when tmptables left in --tmpdir +--echo # + +create table t1 (c int); +let $MYSQLD_TMPDIR=`SELECT @@tmpdir`; +let $MYSQLD_DATADIR=`SELECT @@datadir`; +--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_TMPDIR/#sqlt1.frm +drop table t1; +--source include/restart_mysqld.inc diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 95b650c33d3..09dac838c3f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -8986,9 +8986,11 @@ my_bool mysql_rm_tmp_tables(void) memcpy(path_copy, path, path_len - ext_len); path_copy[path_len - ext_len]= 0; init_tmp_table_share(thd, &share, "", 0, "", path_copy); - handlerton *ht= share.db_type(); if (!open_table_def(thd, &share)) - ht->drop_table(share.db_type(), path_copy); + { + handlerton *ht= share.db_type(); + ht->drop_table(ht, path_copy); + } free_table_share(&share); } /* From fcfb89a8979862ff06552a5e6cd8329f3d5fed6a Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 24 Feb 2025 13:23:47 +1100 Subject: [PATCH 26/65] MDEV-35874 Spider: add missing skips when fetching results In MDEV-26345 77ed235d50bd9b1480f26d18ea0b70ca7480af23 a bitmap is introduced to skip spider GBH SELECTed constant fields when storing the results from the data node. Unfortunately this bitmap was not used in all applicable calls. This patch fixes it. The test covers most of the calls, with the exception of spider_db_store_result_for_reuse_cursor(), which is not covered in existing tests, because it is only called when limit_mode()==1, which is not the case for any spider backend wrapper. --- .../spider/bugfix/r/mdev_35874.result | 50 ++++++++++++++++++ .../spider/bugfix/t/mdev_35874.test | 52 +++++++++++++++++++ storage/spider/spd_db_conn.cc | 25 +++++---- 3 files changed, 114 insertions(+), 13 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_35874.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_35874.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_35874.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_35874.result new file mode 100644 index 00000000000..9425babbb22 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_35874.result @@ -0,0 +1,50 @@ +# +# MDEV-35874 Unexpected error 1264 'Out of Range Value for Column' when inserting into ... select ... from a spider table +# +for master_1 +for child2 +for child3 +set spider_same_server_link= 1; +CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +CREATE TABLE t1 (c6 decimal(6,0)) ENGINE=InnoDB; +CREATE TABLE t1_s (c6 decimal(6,0)) +ENGINE=SPIDER COMMENT='wrapper "mariadb", srv "srv", table "t1"' ; +CREATE TABLE t2 (c8 decimal(8,0), c6 decimal(6,0)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (123456), (654321); +/* 1 */ SELECT 12345678, c6 FROM t1_s GROUP BY c6; +12345678 c6 +12345678 123456 +12345678 654321 +/* 2 */ INSERT INTO t2 (c8, c6) SELECT 12345678, c6 FROM t1_s GROUP BY c6; +set spider_quick_mode= 2; +/* 3 */ SELECT 12345678, c6 FROM t1_s GROUP BY c6; +12345678 c6 +12345678 123456 +12345678 654321 +/* 4 */ INSERT INTO t2 (c8, c6) SELECT 12345678, c6 FROM t1_s GROUP BY c6; +set spider_quick_mode= 3; +set spider_quick_page_size= 1; +INSERT INTO t1 VALUES (777777); +/* 5 */ SELECT 12345678, c6 FROM t1_s GROUP BY c6; +12345678 c6 +12345678 123456 +12345678 654321 +12345678 777777 +/* 6 */ INSERT INTO t2 (c8, c6) SELECT 12345678, c6 FROM t1_s GROUP BY c6; +set spider_quick_mode= 0; +set spider_quick_page_size= 1024; +CREATE OR REPLACE TABLE t1_s (c6 decimal(6,0) key) +ENGINE=SPIDER COMMENT='wrapper "mariadb", srv "srv", table "t1"' ; +/* 7 */ SELECT MAX(c6), SUM(c6) FROM t1_s; +MAX(c6) SUM(c6) +777777 1555554 +set spider_select_column_mode= 0; +/* 8 */ SELECT MAX(c6), SUM(c6) FROM t1_s; +MAX(c6) SUM(c6) +777777 1555554 +drop table t2, t1_s, t1; +drop server srv; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_35874.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_35874.test new file mode 100644 index 00000000000..beeec416a8d --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_35874.test @@ -0,0 +1,52 @@ +--echo # +--echo # MDEV-35874 Unexpected error 1264 'Out of Range Value for Column' when inserting into ... select ... from a spider table +--echo # + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log +--source include/have_innodb.inc +set spider_same_server_link= 1; +evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); + +CREATE TABLE t1 (c6 decimal(6,0)) ENGINE=InnoDB; + +CREATE TABLE t1_s (c6 decimal(6,0)) +ENGINE=SPIDER COMMENT='wrapper "mariadb", srv "srv", table "t1"' ; + +CREATE TABLE t2 (c8 decimal(8,0), c6 decimal(6,0)) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (123456), (654321); + +/* 1 */ SELECT 12345678, c6 FROM t1_s GROUP BY c6; +/* 2 */ INSERT INTO t2 (c8, c6) SELECT 12345678, c6 FROM t1_s GROUP BY c6; + +set spider_quick_mode= 2; +/* 3 */ SELECT 12345678, c6 FROM t1_s GROUP BY c6; +/* 4 */ INSERT INTO t2 (c8, c6) SELECT 12345678, c6 FROM t1_s GROUP BY c6; + +set spider_quick_mode= 3; +set spider_quick_page_size= 1; +INSERT INTO t1 VALUES (777777); +/* 5 */ SELECT 12345678, c6 FROM t1_s GROUP BY c6; +/* 6 */ INSERT INTO t2 (c8, c6) SELECT 12345678, c6 FROM t1_s GROUP BY c6; + +set spider_quick_mode= 0; +set spider_quick_page_size= 1024; +CREATE OR REPLACE TABLE t1_s (c6 decimal(6,0) key) +ENGINE=SPIDER COMMENT='wrapper "mariadb", srv "srv", table "t1"' ; +/* 7 */ SELECT MAX(c6), SUM(c6) FROM t1_s; + +set spider_select_column_mode= 0; +/* 8 */ SELECT MAX(c6), SUM(c6) FROM t1_s; + +drop table t2, t1_s, t1; +drop server srv; +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc index 1c1aa308e82..d33115ca1a0 100644 --- a/storage/spider/spd_db_conn.cc +++ b/storage/spider/spd_db_conn.cc @@ -2872,7 +2872,7 @@ int spider_db_fetch_table( if (result_list->quick_mode == 0) { SPIDER_DB_RESULT *result = current->result; - if (!(row = result->fetch_row())) + if (!(row = result->fetch_row(result_list->skips))) { table->status = STATUS_NOT_FOUND; DBUG_RETURN(HA_ERR_END_OF_FILE); @@ -2992,7 +2992,7 @@ int spider_db_fetch_key( if (result_list->quick_mode == 0) { SPIDER_DB_RESULT *result = current->result; - if (!(row = result->fetch_row())) + if (!(row = result->fetch_row(result_list->skips))) { table->status = STATUS_NOT_FOUND; DBUG_RETURN(HA_ERR_END_OF_FILE); @@ -3099,7 +3099,7 @@ int spider_db_fetch_minimum_columns( if (result_list->quick_mode == 0) { SPIDER_DB_RESULT *result = current->result; - if (!(row = result->fetch_row())) + if (!(row = result->fetch_row(result_list->skips))) { table->status = STATUS_NOT_FOUND; DBUG_RETURN(HA_ERR_END_OF_FILE); @@ -3874,7 +3874,7 @@ int spider_db_store_result( } position++; roop_count++; - row = current->result->fetch_row(); + row = current->result->fetch_row(result_list->skips); } } else { do { @@ -3896,7 +3896,7 @@ int spider_db_store_result( } } while ( page_size > roop_count && - (row = current->result->fetch_row()) + (row = current->result->fetch_row(result_list->skips)) ); } if ( @@ -3940,7 +3940,7 @@ int spider_db_store_result( roop_count++; } while ( result_list->limit_num > roop_count && - (row = current->result->fetch_row()) + (row = current->result->fetch_row(result_list->skips)) ); tmp_tbl->file->ha_end_bulk_insert(); page_size = result_list->limit_num; @@ -4171,7 +4171,7 @@ int spider_db_store_result_for_reuse_cursor( } current->dbton_id = current->result->dbton_id; SPIDER_DB_ROW *row; - if (!(row = current->result->fetch_row())) + if (!(row = current->result->fetch_row(result_list->skips))) { error_num = current->result->get_errno(); DBUG_PRINT("info",("spider set finish_flg point 3")); @@ -4249,7 +4249,7 @@ int spider_db_store_result_for_reuse_cursor( } position++; roop_count++; - row = current->result->fetch_row(); + row = current->result->fetch_row(result_list->skips); } } else { do { @@ -4271,7 +4271,7 @@ int spider_db_store_result_for_reuse_cursor( } } while ( page_size > roop_count && - (row = current->result->fetch_row()) + (row = current->result->fetch_row(result_list->skips)) ); } if ( @@ -4315,7 +4315,7 @@ int spider_db_store_result_for_reuse_cursor( roop_count++; } while ( result_list->limit_num > roop_count && - (row = current->result->fetch_row()) + (row = current->result->fetch_row(result_list->skips)) ); tmp_tbl->file->ha_end_bulk_insert(); page_size = result_list->limit_num; @@ -4887,9 +4887,8 @@ int spider_db_seek_next( #ifndef WITHOUT_SPIDER_BG_SEARCH } #endif - DBUG_RETURN(spider_db_fetch(buf, spider, table)); - } else - DBUG_RETURN(spider_db_fetch(buf, spider, table)); + } + DBUG_RETURN(spider_db_fetch(buf, spider, table)); } int spider_db_seek_last( From 71244c30a11299e6249b7ea108be98ce6d52d88c Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 13 Jan 2025 14:07:22 +1100 Subject: [PATCH 27/65] MDEV-35807 Removed an unused function spider_cmp_trx_alter_table --- storage/spider/spd_trx.cc | 199 -------------------------------------- storage/spider/spd_trx.h | 5 - 2 files changed, 204 deletions(-) diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index c52c781af8a..c72b201fc81 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -820,205 +820,6 @@ error_alloc_alter_table: DBUG_RETURN(error_num); } -bool spider_cmp_trx_alter_table( - SPIDER_ALTER_TABLE *cmp1, - SPIDER_ALTER_TABLE *cmp2 -) { - int roop_count; - DBUG_ENTER("spider_cmp_trx_alter_table"); - if ( - cmp1->tmp_priority != cmp2->tmp_priority || - cmp1->link_count != cmp2->link_count || - cmp1->all_link_count != cmp2->all_link_count - ) - DBUG_RETURN(TRUE); - - for (roop_count = 0; roop_count < (int) cmp1->all_link_count; roop_count++) - { - if ( - ( - cmp1->tmp_server_names[roop_count] != - cmp2->tmp_server_names[roop_count] && - ( - !cmp1->tmp_server_names[roop_count] || - !cmp2->tmp_server_names[roop_count] || - strcmp(cmp1->tmp_server_names[roop_count], - cmp2->tmp_server_names[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_table_names[roop_count] != - cmp2->tmp_tgt_table_names[roop_count] && - ( - !cmp1->tmp_tgt_table_names[roop_count] || - !cmp2->tmp_tgt_table_names[roop_count] || - strcmp(cmp1->tmp_tgt_table_names[roop_count], - cmp2->tmp_tgt_table_names[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_dbs[roop_count] != - cmp2->tmp_tgt_dbs[roop_count] && - ( - !cmp1->tmp_tgt_dbs[roop_count] || - !cmp2->tmp_tgt_dbs[roop_count] || - strcmp(cmp1->tmp_tgt_dbs[roop_count], - cmp2->tmp_tgt_dbs[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_hosts[roop_count] != - cmp2->tmp_tgt_hosts[roop_count] && - ( - !cmp1->tmp_tgt_hosts[roop_count] || - !cmp2->tmp_tgt_hosts[roop_count] || - strcmp(cmp1->tmp_tgt_hosts[roop_count], - cmp2->tmp_tgt_hosts[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_usernames[roop_count] != - cmp2->tmp_tgt_usernames[roop_count] && - ( - !cmp1->tmp_tgt_usernames[roop_count] || - !cmp2->tmp_tgt_usernames[roop_count] || - strcmp(cmp1->tmp_tgt_usernames[roop_count], - cmp2->tmp_tgt_usernames[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_passwords[roop_count] != - cmp2->tmp_tgt_passwords[roop_count] && - ( - !cmp1->tmp_tgt_passwords[roop_count] || - !cmp2->tmp_tgt_passwords[roop_count] || - strcmp(cmp1->tmp_tgt_passwords[roop_count], - cmp2->tmp_tgt_passwords[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_sockets[roop_count] != - cmp2->tmp_tgt_sockets[roop_count] && - ( - !cmp1->tmp_tgt_sockets[roop_count] || - !cmp2->tmp_tgt_sockets[roop_count] || - strcmp(cmp1->tmp_tgt_sockets[roop_count], - cmp2->tmp_tgt_sockets[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_wrappers[roop_count] != - cmp2->tmp_tgt_wrappers[roop_count] && - ( - !cmp1->tmp_tgt_wrappers[roop_count] || - !cmp2->tmp_tgt_wrappers[roop_count] || - strcmp(cmp1->tmp_tgt_wrappers[roop_count], - cmp2->tmp_tgt_wrappers[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_ssl_cas[roop_count] != - cmp2->tmp_tgt_ssl_cas[roop_count] && - ( - !cmp1->tmp_tgt_ssl_cas[roop_count] || - !cmp2->tmp_tgt_ssl_cas[roop_count] || - strcmp(cmp1->tmp_tgt_ssl_cas[roop_count], - cmp2->tmp_tgt_ssl_cas[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_ssl_capaths[roop_count] != - cmp2->tmp_tgt_ssl_capaths[roop_count] && - ( - !cmp1->tmp_tgt_ssl_capaths[roop_count] || - !cmp2->tmp_tgt_ssl_capaths[roop_count] || - strcmp(cmp1->tmp_tgt_ssl_capaths[roop_count], - cmp2->tmp_tgt_ssl_capaths[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_ssl_certs[roop_count] != - cmp2->tmp_tgt_ssl_certs[roop_count] && - ( - !cmp1->tmp_tgt_ssl_certs[roop_count] || - !cmp2->tmp_tgt_ssl_certs[roop_count] || - strcmp(cmp1->tmp_tgt_ssl_certs[roop_count], - cmp2->tmp_tgt_ssl_certs[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_ssl_ciphers[roop_count] != - cmp2->tmp_tgt_ssl_ciphers[roop_count] && - ( - !cmp1->tmp_tgt_ssl_ciphers[roop_count] || - !cmp2->tmp_tgt_ssl_ciphers[roop_count] || - strcmp(cmp1->tmp_tgt_ssl_ciphers[roop_count], - cmp2->tmp_tgt_ssl_ciphers[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_ssl_keys[roop_count] != - cmp2->tmp_tgt_ssl_keys[roop_count] && - ( - !cmp1->tmp_tgt_ssl_keys[roop_count] || - !cmp2->tmp_tgt_ssl_keys[roop_count] || - strcmp(cmp1->tmp_tgt_ssl_keys[roop_count], - cmp2->tmp_tgt_ssl_keys[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_default_files[roop_count] != - cmp2->tmp_tgt_default_files[roop_count] && - ( - !cmp1->tmp_tgt_default_files[roop_count] || - !cmp2->tmp_tgt_default_files[roop_count] || - strcmp(cmp1->tmp_tgt_default_files[roop_count], - cmp2->tmp_tgt_default_files[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_default_groups[roop_count] != - cmp2->tmp_tgt_default_groups[roop_count] && - ( - !cmp1->tmp_tgt_default_groups[roop_count] || - !cmp2->tmp_tgt_default_groups[roop_count] || - strcmp(cmp1->tmp_tgt_default_groups[roop_count], - cmp2->tmp_tgt_default_groups[roop_count]) - ) - ) || - ( - cmp1->tmp_tgt_dsns[roop_count] != - cmp2->tmp_tgt_dsns[roop_count] && - ( - !cmp1->tmp_tgt_dsns[roop_count] || - !cmp2->tmp_tgt_dsns[roop_count] || - strcmp(cmp1->tmp_tgt_dsns[roop_count], - cmp2->tmp_tgt_dsns[roop_count]) - ) - ) || - ( - cmp1->tmp_static_link_ids[roop_count] != - cmp2->tmp_static_link_ids[roop_count] && - ( - !cmp1->tmp_static_link_ids[roop_count] || - !cmp2->tmp_static_link_ids[roop_count] || - strcmp(cmp1->tmp_static_link_ids[roop_count], - cmp2->tmp_static_link_ids[roop_count]) - ) - ) || - cmp1->tmp_tgt_ports[roop_count] != cmp2->tmp_tgt_ports[roop_count] || - cmp1->tmp_tgt_ssl_vscs[roop_count] != - cmp2->tmp_tgt_ssl_vscs[roop_count] || - cmp1->tmp_monitoring_binlog_pos_at_failing[roop_count] != - cmp2->tmp_monitoring_binlog_pos_at_failing[roop_count] || - cmp1->tmp_link_statuses[roop_count] != - cmp2->tmp_link_statuses[roop_count] - ) - DBUG_RETURN(TRUE); - } - DBUG_RETURN(FALSE); -} - int spider_free_trx_alloc( SPIDER_TRX *trx ) { diff --git a/storage/spider/spd_trx.h b/storage/spider/spd_trx.h index 93b03fcec21..9185661fe1f 100644 --- a/storage/spider/spd_trx.h +++ b/storage/spider/spd_trx.h @@ -67,11 +67,6 @@ int spider_create_trx_alter_table( bool now_create ); -bool spider_cmp_trx_alter_table( - SPIDER_ALTER_TABLE *cmp1, - SPIDER_ALTER_TABLE *cmp2 -); - SPIDER_TRX *spider_get_trx( THD *thd, bool regist_allocated_thds, From 92d5882ffd51c89520889aff1fed7ce5f02d1a35 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 13 Jan 2025 14:09:42 +1100 Subject: [PATCH 28/65] MDEV-35807 Case-insensitive wrappers in spider Continued on the work in MDEV-32157 18990f007366863e2066c2905993358ceb941ce3 --- .../spider/bugfix/r/mdev_35807.result | 16 ++++++++++++++ .../spider/bugfix/t/mdev_35807.test | 21 +++++++++++++++++++ storage/spider/spd_direct_sql.cc | 4 ++-- storage/spider/spd_table.cc | 4 ++-- 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_35807.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_35807.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_35807.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_35807.result new file mode 100644 index 00000000000..e02629ca9ec --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_35807.result @@ -0,0 +1,16 @@ +# +# MDEV-35807 Spider wrapper name is case sensitive +# +for master_1 +for child2 +for child3 +set spider_same_server_link= 1; +CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +SELECT spider_direct_sql ('SELECT 1','','SRV "srv"'); +spider_direct_sql ('SELECT 1','','SRV "srv"') +1 +drop server srv; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_35807.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_35807.test new file mode 100644 index 00000000000..cab648124cc --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_35807.test @@ -0,0 +1,21 @@ +--echo # +--echo # MDEV-35807 Spider wrapper name is case sensitive +--echo # + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +set spider_same_server_link= 1; +evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +SELECT spider_direct_sql ('SELECT 1','','SRV "srv"'); +drop server srv; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/spd_direct_sql.cc b/storage/spider/spd_direct_sql.cc index f0661bdd4c0..fb9aa4f5be9 100644 --- a/storage/spider/spd_direct_sql.cc +++ b/storage/spider/spd_direct_sql.cc @@ -194,7 +194,7 @@ int spider_udf_direct_sql_create_conn_key( spider_dbton[roop_count2].wrapper : "NULL")); if ( spider_dbton[roop_count2].wrapper && - !strcmp(direct_sql->tgt_wrapper, spider_dbton[roop_count2].wrapper) + !strcasecmp(direct_sql->tgt_wrapper, spider_dbton[roop_count2].wrapper) ) { if (spider_dbton[roop_count2].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL) @@ -983,7 +983,7 @@ int spider_udf_set_direct_sql_param_default( spider_dbton[roop_count].wrapper : "NULL")); if ( spider_dbton[roop_count].wrapper && - !strcmp(direct_sql->tgt_wrapper, + !strcasecmp(direct_sql->tgt_wrapper, spider_dbton[roop_count].wrapper) ) { if (spider_dbton[roop_count].db_access_type == diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 347a3074325..cdbcd39ec5b 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -3421,7 +3421,7 @@ int spider_set_connect_info_default( spider_dbton[roop_count2].wrapper : "NULL")); if ( spider_dbton[roop_count2].wrapper && - !strcmp(share->tgt_wrappers[roop_count], + !strcasecmp(share->tgt_wrappers[roop_count], spider_dbton[roop_count2].wrapper) ) { if (spider_dbton[roop_count2].db_access_type == @@ -3697,7 +3697,7 @@ int spider_set_connect_info_default_db_table( spider_dbton[roop_count2].wrapper : "NULL")); if ( spider_dbton[roop_count2].wrapper && - !strcmp(share->tgt_wrappers[roop_count], + !strcasecmp(share->tgt_wrappers[roop_count], spider_dbton[roop_count2].wrapper) ) { if (spider_dbton[roop_count2].db_access_type == From 04d731b6cc93b3957a3dc6ccdd5b57db29828a82 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Wed, 19 Feb 2025 03:53:49 +0100 Subject: [PATCH 29/65] galera mtr tests: synchronization between versions Added fixes to galera tests for issues found during merging changes from 10.5 to 10.6. --- .../galera/r/galera_as_slave_nonprim.result | 2 +- .../r/galera_sst_mariabackup_gtid,debug.rdiff | 4 ++-- .../galera/r/galera_sst_rsync_gtid,debug.rdiff | 4 ++-- mysql-test/suite/galera/suite.pm | 16 ++++++++-------- .../suite/galera/t/galera_as_slave_nonprim.test | 2 +- .../galera_3nodes/r/galera_join_with_cc_A.result | 6 +++--- .../galera_3nodes/r/galera_join_with_cc_B.result | 6 +++--- .../galera_3nodes/r/galera_join_with_cc_C.result | 8 ++++---- .../galera_3nodes/r/galera_pc_weight.result | 10 +++++----- mysql-test/suite/galera_3nodes/suite.pm | 16 ++++++++-------- .../galera_3nodes/t/galera_join_with_cc_A.test | 6 +++--- .../galera_3nodes/t/galera_join_with_cc_B.test | 6 +++--- .../galera_3nodes/t/galera_join_with_cc_C.test | 8 ++++---- .../suite/galera_3nodes/t/galera_pc_weight.test | 10 +++++----- mysql-test/suite/galera_3nodes_sr/suite.pm | 11 ++++++----- mysql-test/suite/galera_sr/suite.pm | 16 ++++++++-------- .../suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf | 1 - 17 files changed, 66 insertions(+), 66 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_as_slave_nonprim.result b/mysql-test/suite/galera/r/galera_as_slave_nonprim.result index fefc988d9d4..969e844577e 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_nonprim.result +++ b/mysql-test/suite/galera/r/galera_as_slave_nonprim.result @@ -27,7 +27,7 @@ STOP SLAVE; RESET SLAVE ALL; CALL mtr.add_suppression("Slave SQL: Error 'Unknown command' on query"); CALL mtr.add_suppression("Slave: Unknown command Error_code: 1047"); -CALL mtr.add_suppression("Transport endpoint is not connected"); +CALL mtr.add_suppression("(Transport endpoint|Socket) is not connected"); CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213"); CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047"); connection node_4; diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff index 12609bb571f..4e1470839e9 100644 --- a/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff @@ -1,5 +1,5 @@ ---- suite/galera/r/galera_sst_mariabackup_gtid.result 2025-01-02 15:34:28.251593452 +0200 -+++ suite/galera/r/galera_sst_mariabackup_gtid.reject 2025-01-02 16:01:18.058469177 +0200 +--- r/galera_sst_mariabackup_gtid.result ++++ r/galera_sst_mariabackup_gtid,debug.reject @@ -516,19 +516,203 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff index 0e3e85ef213..c83ead475e2 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff +++ b/mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff @@ -1,5 +1,5 @@ ---- suite/galera/r/galera_sst_rsync_gtid.result 2025-01-02 15:35:15.162175835 +0200 -+++ suite/galera/r/galera_sst_rsync_gtid.reject 2025-01-02 16:02:08.588902711 +0200 +--- r/galera_sst_rsync_gtid.result ++++ r/galera_sst_rsync_gtid,debug.reject @@ -516,19 +516,203 @@ 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index 8f2a0cf5385..55cdde373c5 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -17,7 +17,7 @@ push @::global_suppressions, qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), - qr(WSREP: last inactive check more than .* skipping check), + qr(WSREP: last inactive check more than .+ skipping check), qr(WSREP: Releasing seqno [0-9]+ before [0-9]+ was assigned\.), qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), @@ -27,7 +27,7 @@ push @::global_suppressions, qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), - qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), + qr(WSREP: Member .+ ?requested state transfer from .+ but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), @@ -46,25 +46,25 @@ push @::global_suppressions, qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, - qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), + qr(WSREP: SYNC message from member .+ ?in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), qr(WSREP: TO isolation failed for: ), qr|WSREP: gcs_caused\(\) returned |, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(JOINED\)\. Message ignored\.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established ), qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, + qr|WSREP: JOIN message from member .+ ?in non-primary configuration\. Ignored\.|, qr|WSREP: .*Query apply failed:|, qr(WSREP: Ignoring error), qr(WSREP: Failed to remove page file ), qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to ), - qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, - qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, + qr+WSREP: Sending JOIN failed: -107 \((Transport endpoint|Socket) is not connected\)\. Will retry in new primary component\.+, + qr+WSREP: Send action \{.* STATE_REQUEST\} returned -107 \((Transport endpoint|Socket) is not connected\)+, qr|WSREP: Trying to continue unpaused monitor|, qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|, qr|WSREP: Failed to report last committed|, diff --git a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test index 600d64e5a81..42414761e62 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test +++ b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test @@ -84,7 +84,7 @@ RESET SLAVE ALL; CALL mtr.add_suppression("Slave SQL: Error 'Unknown command' on query"); CALL mtr.add_suppression("Slave: Unknown command Error_code: 1047"); -CALL mtr.add_suppression("Transport endpoint is not connected"); +CALL mtr.add_suppression("(Transport endpoint|Socket) is not connected"); CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213"); CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047"); diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result index fdea4154626..52f5db8daed 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result +++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result @@ -77,8 +77,8 @@ SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'dbug='; connection node_1; DROP TABLE t1; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); connection node_2; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); connection node_3; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result index 7811059db42..a63e7933e9c 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result +++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result @@ -87,11 +87,11 @@ SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; SET GLOBAL wsrep_provider_options = 'dbug='; connection node_1; DROP TABLE t1; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); connection node_2; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); connection node_3; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); disconnect node_1a; disconnect node_3; disconnect node_2; diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result index ea185bf676a..d80d90cd726 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result +++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result @@ -94,9 +94,9 @@ SET GLOBAL wsrep_provider_options = 'dbug='; SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; connection node_1; DROP TABLE t1; -call mtr.add_suppression("WSREP: Send action {(.*), STATE_REQUEST} returned -107 \\(Transport endpoint is not connected\\)"); -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Send action {.* STATE_REQUEST} returned -107 \\((Transport endpoint|Socket) is not connected\\)"); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); connection node_2; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); connection node_3; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); diff --git a/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result index 6d8c7a51b1f..9351d528b87 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result +++ b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result @@ -157,10 +157,10 @@ SET GLOBAL wsrep_provider_options = 'pc.weight=1'; CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1'); connection node_2; CALL mtr.add_suppression('SYNC message from member'); -CALL mtr.add_suppression('user message in state LEAVING'); -CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)'); -CALL mtr.add_suppression('overriding reported weight for'); +CALL mtr.add_suppression('WSREP: user message in state LEAVING'); +CALL mtr.add_suppression('sending install message failed: (Transport endpoint|Socket) is not connected'); +CALL mtr.add_suppression('overriding reported weight for '); connection node_3; CALL mtr.add_suppression('WSREP: user message in state LEAVING'); -CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)'); -CALL mtr.add_suppression('overriding reported weight for'); +CALL mtr.add_suppression('sending install message failed: (Transport endpoint|Socket) is not connected'); +CALL mtr.add_suppression('overriding reported weight for '); diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm index c1cc1ef4076..34b5afd0cdc 100644 --- a/mysql-test/suite/galera_3nodes/suite.pm +++ b/mysql-test/suite/galera_3nodes/suite.pm @@ -16,7 +16,7 @@ push @::global_suppressions, qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), - qr(WSREP: last inactive check more than .* skipping check), + qr(WSREP: last inactive check more than .+ skipping check), qr(WSREP: Releasing seqno [0-9]+ before [0-9]+ was assigned\.), qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), @@ -26,7 +26,7 @@ push @::global_suppressions, qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), - qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), + qr(WSREP: Member .+ ?requested state transfer from .+ but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), @@ -45,25 +45,25 @@ push @::global_suppressions, qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, - qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), + qr(WSREP: SYNC message from member .+ ?in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), qr(WSREP: TO isolation failed for: ), qr|WSREP: gcs_caused\(\) returned |, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(JOINED\)\. Message ignored\.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established ), qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, + qr|WSREP: JOIN message from member .+ ?in non-primary configuration\. Ignored\.|, qr|WSREP: .*Query apply failed:|, qr(WSREP: Ignoring error), qr(WSREP: Failed to remove page file ), qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to ), - qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, - qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, + qr+WSREP: Sending JOIN failed: -107 \((Transport endpoint|Socket) is not connected\)\. Will retry in new primary component\.+, + qr+WSREP: Send action \{.* STATE_REQUEST\} returned -107 \((Transport endpoint|Socket) is not connected\)+, qr|WSREP: Trying to continue unpaused monitor|, qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|, qr|WSREP: Failed to report last committed|, diff --git a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test index bb25b1dd9d1..b30446b84bb 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test +++ b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test @@ -259,12 +259,12 @@ INSERT INTO t1 VALUES (9, 2); DROP TABLE t1; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --connection node_2 -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --connection node_3 -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_B.test b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_B.test index b5983c384ed..b80a1dd89fb 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_B.test +++ b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_B.test @@ -270,13 +270,13 @@ SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debu DROP TABLE t1; -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --connection node_2 -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --connection node_3 -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --disconnect node_1a diff --git a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_C.test b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_C.test index d914482a100..6afd7b94d0f 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_C.test +++ b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_C.test @@ -295,13 +295,13 @@ INSERT INTO t1 VALUES (9, 2); DROP TABLE t1; -call mtr.add_suppression("WSREP: Send action {(.*), STATE_REQUEST} returned -107 \\(Transport endpoint is not connected\\)"); -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Send action {.* STATE_REQUEST} returned -107 \\((Transport endpoint|Socket) is not connected\\)"); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --connection node_2 -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --connection node_3 -call mtr.add_suppression("WSREP: Rejecting JOIN message from (.*): new State Transfer required\\."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from .+: new State Transfer required\\."); --source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test index 8a1c93a769f..037a732923f 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test +++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test @@ -132,11 +132,11 @@ CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1'); --connection node_2 CALL mtr.add_suppression('SYNC message from member'); -CALL mtr.add_suppression('user message in state LEAVING'); -CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)'); -CALL mtr.add_suppression('overriding reported weight for'); +CALL mtr.add_suppression('WSREP: user message in state LEAVING'); +CALL mtr.add_suppression('sending install message failed: (Transport endpoint|Socket) is not connected'); +CALL mtr.add_suppression('overriding reported weight for '); --connection node_3 CALL mtr.add_suppression('WSREP: user message in state LEAVING'); -CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)'); -CALL mtr.add_suppression('overriding reported weight for'); +CALL mtr.add_suppression('sending install message failed: (Transport endpoint|Socket) is not connected'); +CALL mtr.add_suppression('overriding reported weight for '); diff --git a/mysql-test/suite/galera_3nodes_sr/suite.pm b/mysql-test/suite/galera_3nodes_sr/suite.pm index 54489387ec5..c7f4472e242 100644 --- a/mysql-test/suite/galera_3nodes_sr/suite.pm +++ b/mysql-test/suite/galera_3nodes_sr/suite.pm @@ -27,20 +27,21 @@ push @::global_suppressions, qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), - qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), + qr(WSREP: Member .+ ?requested state transfer from .+ but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), qr(WSREP: Could not find peer:), qr|WSREP: gcs_caused\(\) returned |, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(JOINED\)\. Message ignored\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, - qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, + qr|WSREP: JOIN message from member .+ ?in non-primary configuration\. Ignored\.|, + qr+WSREP: Sending JOIN failed: -107 \((Transport endpoint|Socket) is not connected\)\. Will retry in new primary component\.+, + qr+WSREP: Send action \{.* STATE_REQUEST\} returned -107 \((Transport endpoint|Socket) is not connected\)+, ); bless { }; diff --git a/mysql-test/suite/galera_sr/suite.pm b/mysql-test/suite/galera_sr/suite.pm index a0e386a52b7..0aea25145da 100644 --- a/mysql-test/suite/galera_sr/suite.pm +++ b/mysql-test/suite/galera_sr/suite.pm @@ -16,7 +16,7 @@ push @::global_suppressions, qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP: .*down context.*), qr(WSREP: Failed to send state UUID:), - qr(WSREP: last inactive check more than .* skipping check), + qr(WSREP: last inactive check more than .+ skipping check), qr(WSREP: Releasing seqno [0-9]+ before [0-9]+ was assigned\.), qr|WSREP: access file\(.*gvwstate.dat\) failed ?\(No such file or directory\)|, qr(WSREP: Quorum: No node with complete state), @@ -26,7 +26,7 @@ push @::global_suppressions, qr(WSREP: evs::proto.*), qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:|, qr(WSREP: no nodes coming from prim view, prim not possible), - qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), + qr(WSREP: Member .+ ?requested state transfer from .+ but it is impossible to select State Transfer donor: Resource temporarily unavailable), qr(WSREP: user message in state LEAVING), qr(WSREP: .* sending install message failed: (Transport endpoint|Socket) is not connected), qr(WSREP: .* sending install message failed: Resource temporarily unavailable), @@ -45,25 +45,25 @@ push @::global_suppressions, qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at ), qr(WSREP: gcs connect failed: Connection timed out), qr|WSREP: wsrep::connect\(.*\) failed: 7|, - qr(WSREP: SYNC message from member .* in non-primary configuration\. Ignored\.), + qr(WSREP: SYNC message from member .+ ?in non-primary configuration\. Ignored\.), qr(WSREP: Could not find peer:), qr(WSREP: TO isolation failed for: ), qr|WSREP: gcs_caused\(\) returned |, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(SYNCED\)\. Message ignored\.|, - qr|WSREP: Protocol violation\. JOIN message sender .* is not in state transfer \(JOINED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(SYNCED\)\. Message ignored\.|, + qr|WSREP: Protocol violation\. JOIN message sender .+ ?is not in state transfer \(JOINED\)\. Message ignored\.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled\. Expect abort\.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established ), qr|WSREP: .*core_handle_uuid_msg|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0\. WSREP_SYNC_WAIT_BEFORE_READ is on), - qr|WSREP: JOIN message from member .* in non-primary configuration\. Ignored\.|, + qr|WSREP: JOIN message from member .+ ?in non-primary configuration\. Ignored\.|, qr|WSREP: .*Query apply failed:|, qr(WSREP: Ignoring error), qr(WSREP: Failed to remove page file ), qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to ), - qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\)\. Will retry in new primary component\.|, - qr|WSREP: Send action \{.* STATE_REQUEST\} returned -107 \(Transport endpoint is not connected\)|, + qr+WSREP: Sending JOIN failed: -107 \((Transport endpoint|Socket) is not connected\)\. Will retry in new primary component\.+, + qr+WSREP: Send action \{.* STATE_REQUEST\} returned -107 \((Transport endpoint|Socket) is not connected\)+, qr|WSREP: Trying to continue unpaused monitor|, qr|WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position|, qr|WSREP: Failed to report last committed|, diff --git a/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf index 0bf01f81fc5..c2b7c4d415f 100644 --- a/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf +++ b/mysql-test/suite/wsrep/t/wsrep_mixed_case_cmd_arg.cnf @@ -4,4 +4,3 @@ wsrep-on=ON wsrep-provider=@ENV.WSREP_PROVIDER wsrep-cluster-address=gcomm:// - From 7bb0885397ac7e5c8594bffcd8b268c1553b6a2d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 21 Feb 2025 13:24:27 +1100 Subject: [PATCH 30/65] fixup of MDEV-35959 --- storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test index 9beebaa8c1d..d2bfa6657ce 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_35959.test @@ -14,8 +14,10 @@ OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); CREATE TABLE t_remote (a INT); CREATE TABLE t (a INT) ENGINE=SPIDER COMMENT = 'wrapper "mysql", srv "srv", table "t_remote"'; +--disable_ps_protocol --error ER_NET_READ_INTERRUPTED CREATE OR REPLACE TABLE t_remote LIKE t; +--enable_ps_protocol SHOW WARNINGS; drop table t; From e95a8f84de7bc51d7e173b2623491ed258d89d3c Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 27 Feb 2025 11:33:44 +1100 Subject: [PATCH 31/65] MDEV-36156: MSAN Compile and Link flags needed for compile/run checks When MSAN adds the -fsantize=memory this significantly affects compile and link tests. Whether this is a compile/run/or looking for a symbol in a library these cmake tests require the same flags be set. Ideally the minimum invocation of cmake to create a MSAN build as investigated in MDBF-793 should be: -DWITH_MSAN=ON \ -DCMAKE_{EXE,MODULE}_LINKER_FLAGS="-L${MSAN_LIBDIR} -Wl,-rpath=${MSAN_LIBDIR}" On the assumption that the compiler supports msan and the instrumented libraries are in MSAN_LIBDIR (maybe later can be made a cmake option). Without cmake policy below, the checking of everything from libc++ to libfmt will not have the supplied linker flags or the compile options that WITH_MSAN=ON invokes. Many try_compile and CMake functions that wrapped this and headers failed to be recognised due to missing msan symbols when linking. Also without the -L path, they where applying a link test to the default path libraries rather than the MSAN instrumented ones. The CMake policy enabled is CMP0056, added CMake 3.2, applies CMAKE_EXE_LINKER_FLAGS to try_compile. With this change the MY_CHECK_AND_SET_COMPILER_FLAG remove explict build types resulting in just CMAKE_{C,CXX}_FLAGS being set rather than CMAKE_{C,CXX}_FLAGS_{DEBUG,RELWITHDEBINFO}. These are needed for the default CMP0066 policy to be correctly applied and the msan flags of -fsanitizer=memory are applied to all compile checks. Likewise with MY_CHECK_AND_SET_LINKER_FLAG for CMAKE_{EXE,MODULE,SHARED}_LINKER_FLAGS for those check that involve full linking and CHECK_CXX_SOURCE_RUNS for example. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37e7d929200..7e4d188bc49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ ENDIF() # in RPM's: #set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true") -FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0067 CMP0074 CMP0075 CMP0069 CMP0135) +FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0056 CMP0067 CMP0074 CMP0075 CMP0069 CMP0135) IF(POLICY ${p}) CMAKE_POLICY(SET ${p} NEW) ENDIF() @@ -245,7 +245,7 @@ ENDIF() OPTION(WITH_MSAN "Enable memory sanitizer" OFF) IF (WITH_MSAN) - MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO) + MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE") IF(NOT (have_C__fsanitize_memory__fsanitize_memory_track_origins__U_FORTIFY_SOURCE AND have_CXX__fsanitize_memory__fsanitize_memory_track_origins__U_FORTIFY_SOURCE)) MESSAGE(FATAL_ERROR "Compiler doesn't support -fsanitize=memory flags") @@ -255,7 +255,7 @@ IF (WITH_MSAN) MESSAGE(FATAL_ERROR "C++ Compiler requires support for -stdlib=libc++") ENDIF() SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - MY_CHECK_AND_SET_LINKER_FLAG("-fsanitize=memory" DEBUG RELWITHDEBINFO) + MY_CHECK_AND_SET_LINKER_FLAG("-fsanitize=memory") IF(NOT HAVE_LINK_FLAG__fsanitize_memory) MESSAGE(FATAL_ERROR "Linker doesn't support -fsanitize=memory flags") ENDIF() From 3deac2ea77c78c653b47774a7551a02760ed0806 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Fri, 28 Feb 2025 19:16:14 +0100 Subject: [PATCH 32/65] galera_inject_bf_log_wait mtr test: more stable test Added explicit checkpoint wait instead of implicit assumption that statement sent via --send will already be executed when lock-contesting statement is started in another session. --- mysql-test/suite/galera/r/galera_inject_bf_long_wait.result | 4 ++++ mysql-test/suite/galera/t/galera_inject_bf_long_wait.test | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/mysql-test/suite/galera/r/galera_inject_bf_long_wait.result b/mysql-test/suite/galera/r/galera_inject_bf_long_wait.result index eeacc9ab212..9ee8a4893c4 100644 --- a/mysql-test/suite/galera/r/galera_inject_bf_long_wait.result +++ b/mysql-test/suite/galera/r/galera_inject_bf_long_wait.result @@ -3,8 +3,11 @@ connection node_1; CREATE TABLE t1(id int not null primary key, b int) engine=InnoDB; INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3); BEGIN; +SET DEBUG_SYNC = 'wsrep_after_statement_enter SIGNAL blocked'; UPDATE t1 set b = 100 where id between 1 and 2;; connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET DEBUG_SYNC = 'now WAIT_FOR blocked'; +SET DEBUG_SYNC = 'wsrep_after_statement_enter CLEAR'; connection node_1b; SET @save_dbug = @@SESSION.debug_dbug; SET @@SESSION.innodb_lock_wait_timeout=2; @@ -20,5 +23,6 @@ id b 1 100 2 100 3 3 +SET DEBUG_SYNC = 'RESET'; disconnect node_1b; DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_inject_bf_long_wait.test b/mysql-test/suite/galera/t/galera_inject_bf_long_wait.test index f4aac7fd795..1aeb1981150 100644 --- a/mysql-test/suite/galera/t/galera_inject_bf_long_wait.test +++ b/mysql-test/suite/galera/t/galera_inject_bf_long_wait.test @@ -6,9 +6,14 @@ CREATE TABLE t1(id int not null primary key, b int) engine=InnoDB; INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3); BEGIN; +SET DEBUG_SYNC = 'wsrep_after_statement_enter SIGNAL blocked'; --send UPDATE t1 set b = 100 where id between 1 and 2; --connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 + +SET DEBUG_SYNC = 'now WAIT_FOR blocked'; +SET DEBUG_SYNC = 'wsrep_after_statement_enter CLEAR'; + --connection node_1b SET @save_dbug = @@SESSION.debug_dbug; SET @@SESSION.innodb_lock_wait_timeout=2; @@ -21,5 +26,6 @@ SET @@SESSION.debug_dbug = @save_dbug; --reap COMMIT; SELECT * FROM t1; +SET DEBUG_SYNC = 'RESET'; --disconnect node_1b DROP TABLE t1; From 7544fd4caeb959bdb573a4b09fbfa225a1ab37a6 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 20 Feb 2025 00:06:09 +0100 Subject: [PATCH 33/65] fix problem of reallocated string --- sql/filesort.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index af03067257c..a0e16791f89 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -634,6 +634,9 @@ static uchar *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count, } #ifndef DBUG_OFF + +static char dbug_row_print_buf[4096]; + /* Print table's current row into a buffer and return a pointer to it. @@ -649,11 +652,9 @@ static uchar *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count, const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names) { Field **pfield; - const size_t alloc_size= 512; - char *row_buff= (char *) alloc_root(&table->mem_root, alloc_size); - char *row_buff_tmp= (char *) alloc_root(&table->mem_root, alloc_size); - String tmp(row_buff_tmp, alloc_size, &my_charset_bin); - String output(row_buff, alloc_size, &my_charset_bin); + char row_buff_tmp[512]; + String tmp(row_buff_tmp, sizeof(row_buff_tmp), &my_charset_bin); + String output(dbug_row_print_buf, sizeof(dbug_row_print_buf), &my_charset_bin); auto move_back_lambda= [table, rec]() mutable { table->move_fields(table->field, table->record[0], rec); @@ -717,8 +718,10 @@ const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names) } } output.append(")"); - - return output.c_ptr_safe(); + if (output.c_ptr() == dbug_row_print_buf) + return dbug_row_print_buf; + else + return "Couldn't fit into buffer"; } From 3a4c0295ae0973a068eaac5f1edef6c69bbf5e48 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 4 Mar 2025 03:22:19 +0100 Subject: [PATCH 34/65] galera: synchronization between branches and editions --- mysql-test/suite/galera/r/galera_nonPK_and_PA.result | 4 ++-- mysql-test/suite/galera/t/galera_nonPK_and_PA.test | 6 ++---- mysql-test/suite/galera/t/galera_sync_wait_upto.test | 2 -- sql/handler.cc | 6 ++++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_nonPK_and_PA.result b/mysql-test/suite/galera/r/galera_nonPK_and_PA.result index 5ad55417fd1..d440d66e8d7 100644 --- a/mysql-test/suite/galera/r/galera_nonPK_and_PA.result +++ b/mysql-test/suite/galera/r/galera_nonPK_and_PA.result @@ -8,7 +8,7 @@ connection node_2; SET SESSION wsrep_sync_wait = 0; SET GLOBAL wsrep_slave_threads = 2; *************************************************************** -scenario 1, conflicting UPDATE +scenario 1, conflicting UPDATE *************************************************************** SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_slave_enter_sync'; connection node_1; @@ -31,7 +31,7 @@ SET SESSION wsrep_on = 1; SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync'; SET GLOBAL wsrep_provider_options = 'dbug='; *************************************************************** -scenario 2, conflicting DELETE +scenario 2, conflicting DELETE *************************************************************** SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_slave_enter_sync'; connection node_1; diff --git a/mysql-test/suite/galera/t/galera_nonPK_and_PA.test b/mysql-test/suite/galera/t/galera_nonPK_and_PA.test index dbd516e9b31..c7592d8fe88 100644 --- a/mysql-test/suite/galera/t/galera_nonPK_and_PA.test +++ b/mysql-test/suite/galera/t/galera_nonPK_and_PA.test @@ -26,7 +26,6 @@ --source include/have_debug_sync.inc --source include/galera_have_debug_sync.inc - # Setup CREATE TABLE t1 (f1 VARCHAR(32) NOT NULL) ENGINE=InnoDB; @@ -44,7 +43,7 @@ SET SESSION wsrep_sync_wait = 0; SET GLOBAL wsrep_slave_threads = 2; --echo *************************************************************** ---echo scenario 1, conflicting UPDATE +--echo scenario 1, conflicting UPDATE --echo *************************************************************** # Set up a synchronization point to catch the first transaction @@ -99,9 +98,8 @@ COMMIT; --source include/galera_signal_sync_point.inc --source include/galera_clear_sync_point.inc - --echo *************************************************************** ---echo scenario 2, conflicting DELETE +--echo scenario 2, conflicting DELETE --echo *************************************************************** # Set up a synchronization point to catch the first transaction diff --git a/mysql-test/suite/galera/t/galera_sync_wait_upto.test b/mysql-test/suite/galera/t/galera_sync_wait_upto.test index aaecd8760f5..56d5aac73a7 100644 --- a/mysql-test/suite/galera/t/galera_sync_wait_upto.test +++ b/mysql-test/suite/galera/t/galera_sync_wait_upto.test @@ -4,7 +4,6 @@ --source include/galera_cluster.inc --source include/have_debug.inc ---source include/have_debug_sync.inc CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); @@ -44,7 +43,6 @@ SELECT WSREP_SYNC_WAIT_UPTO_GTID('1-1-1,1-1-2'); --eval SELECT WSREP_SYNC_WAIT_UPTO_GTID('$wsrep_last_committed_gtid') AS WSREP_SYNC_WAIT_UPTO; --enable_query_log - # Timeout if GTID is not received on time --disable_query_log diff --git a/sql/handler.cc b/sql/handler.cc index 2be0740fdd8..75c79f2bb5a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -668,6 +668,8 @@ int ha_initialize_handlerton(void *plugin_) DBUG_EXECUTE_IF("unstable_db_type", { static int i= (int) DB_TYPE_FIRST_DYNAMIC; + while (installed_htons[i]) + i++; hton->db_type= (enum legacy_db_type)++i; }); @@ -2164,7 +2166,7 @@ int ha_rollback_trans(THD *thd, bool all) "conf %d wsrep_err %s SQL %s", thd->thread_id, thd->query_id, thd->wsrep_trx().state(), wsrep::to_c_string(thd->wsrep_cs().current_error()), - thd->query()); + wsrep_thd_query(thd)); } #endif /* WITH_WSREP */ } @@ -2180,7 +2182,7 @@ int ha_rollback_trans(THD *thd, bool all) if (WSREP(thd) && thd->is_error()) { WSREP_DEBUG("ha_rollback_trans(%lld, %s) rolled back: msg %s is_real %d wsrep_err %s", - thd->thread_id, all? "TRUE" : "FALSE", + thd->thread_id, all ? "TRUE" : "FALSE", thd->get_stmt_da()->message(), is_real_trans, wsrep::to_c_string(thd->wsrep_cs().current_error())); } From 868bc463c04948b649d907c731ca126b7f68fe4c Mon Sep 17 00:00:00 2001 From: Akshat Nehra Date: Fri, 24 Jan 2025 20:18:46 +0000 Subject: [PATCH 35/65] MDEV-4151 Mixed MySQL/MariaDB references in RPM upgrade error message Update pre-install script to fix package detection and standardize MariaDB/MySQL terminology in messages for improved upgrade reliability and reduced user confusion. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- support-files/rpm/server-prein.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/support-files/rpm/server-prein.sh b/support-files/rpm/server-prein.sh index 17cce6b5ba8..af04b343910 100644 --- a/support-files/rpm/server-prein.sh +++ b/support-files/rpm/server-prein.sh @@ -28,10 +28,11 @@ startup script in %{_sysconfdir}/init.d/. if [ "$old_family" != "$new_family" ]; then error_text="$error_text -Upgrading directly from MySQL $old_family to MariaDB $new_family may not -be safe in all cases. A manual dump and restore using mysqldump is -recommended. It is important to review the MariaDB manual's Upgrading -section for version-specific incompatibilities. +Upgrading directly from MariaDB or MySQL $old_family +to MariaDB $new_family may not be safe in all cases. +A manual dump and restore using mariadb-dump (or mysqldump) is recommended. +It is important to review the MariaDB manual's Upgrading section for +version-specific incompatibilities. " fi @@ -39,23 +40,23 @@ section for version-specific incompatibilities. cat <&2 ****************************************************************** -A MySQL or MariaDB server package ($installed) is installed. +A MariaDB or MySQL server package ($installed) is installed. $error_text A manual upgrade is required. - Ensure that you have a complete, working backup of your data and my.cnf files -- Shut down the MySQL server cleanly -- Remove the existing MySQL packages. Usually this command will +- Shut down the MariaDB or MySQL server cleanly +- Remove the existing MariaDB or MySQL packages. Usually this command will list the packages you should remove: - rpm -qa | grep -i '^mysql-' + rpm -qa | grep -iE '^(mariadb|mysql)-' You may choose to use 'rpm --nodeps -ev ' to remove the package which contains the mysqlclient shared library. The library will be reinstalled by the MariaDB-shared package. - Install the new MariaDB packages supplied by $myvendor - Ensure that the MariaDB server is started -- Run the 'mysql_upgrade' program +- Run the 'mariadb-upgrade' program This is a brief description of the upgrade process. Important details can be found in the MariaDB manual, in the Upgrading section. @@ -65,8 +66,8 @@ HERE fi fi -# Create a MySQL user and group. Do not report any problems if it already exists. +# Create a MariaDB user and group. Do not report any problems if it already exists. groupadd -r %{mysqld_group} 2> /dev/null || true -useradd -M -r --home %{mysqldatadir} --shell /sbin/nologin --comment "MySQL server" --gid %{mysqld_group} %{mysqld_user} 2> /dev/null || true +useradd -M -r --home %{mysqldatadir} --shell /sbin/nologin --comment "MariaDB server" --gid %{mysqld_group} %{mysqld_user} 2> /dev/null || true # The user may already exist, make sure it has the proper group nevertheless (BUG#12823) usermod --gid %{mysqld_group} %{mysqld_user} 2> /dev/null || true From cc4d9200c497dc763b9c9bb8855a3ab17e9a9590 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 26 Feb 2025 16:32:06 +0200 Subject: [PATCH 36/65] MDEV-33813 ERROR 1021 (HY000): Disk full (./org/test1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") The problem with MariaDB waiting was fixed earlier. However the server still gives the old error,in case of disk full, that includes "waiting for someone to free some space" even if there is now wait. This commit changes the error message for the non waiting case to: Disk got full writing 'db.table' (Errcode: 28 "No space left on device") Disk got full writing 'test.t1' (Errcode: 28 "No space left on device")Disk got full writing 'test.t1' (Errcode: 28 "No space left on device")Disk got full writing 'test.t1' (Errcode: 28 "No space left on device") --- mysql-test/main/myisam-big.result | 8 ++++++++ mysql-test/main/myisam-big.test | 13 +++++++++++++ mysys/my_pread.c | 9 +++++++++ sql/handler.cc | 8 ++++++-- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/myisam-big.result b/mysql-test/main/myisam-big.result index fd0bcb1224b..a1e483b4473 100644 --- a/mysql-test/main/myisam-big.result +++ b/mysql-test/main/myisam-big.result @@ -1,4 +1,7 @@ drop table if exists t1,t2; +call mtr.add_suppression("Index.*try to repair it"); +call mtr.add_suppression("Disk got full"); +call mtr.add_suppression("Got an error from thread_id"); create table t1 (id int, sometext varchar(100)) engine=myisam; insert into t1 values (1, "hello"),(2, "hello2"),(4, "hello3"),(4, "hello4"); create table t2 like t1; @@ -43,4 +46,9 @@ connection default; connection con2; disconnect con2; connection default; +SET @saved_dbug = @@SESSION.debug_dbug; +SET debug_dbug='+d,simulate_file_pwrite_error'; +insert into t1 select * from t2; +ERROR HY000: Disk got full writing 'test.t1' (Errcode: 28 "No space left on device") +SET debug_dbug= @saved_dbug; drop table t1,t2; diff --git a/mysql-test/main/myisam-big.test b/mysql-test/main/myisam-big.test index 2fec2450ecd..30267b2b3c7 100644 --- a/mysql-test/main/myisam-big.test +++ b/mysql-test/main/myisam-big.test @@ -1,12 +1,17 @@ # # Test bugs in the MyISAM code that require more space/time --source include/big_test.inc +--source include/have_debug.inc # Initialise --disable_warnings drop table if exists t1,t2; --enable_warnings +call mtr.add_suppression("Index.*try to repair it"); +call mtr.add_suppression("Disk got full"); +call mtr.add_suppression("Got an error from thread_id"); + # # BUG#925377: # Querying myisam table metadata while 'alter table..enable keys' is @@ -61,4 +66,12 @@ connection con2; reap; disconnect con2; connection default; + +# +# Test error message from disk full +SET @saved_dbug = @@SESSION.debug_dbug; +SET debug_dbug='+d,simulate_file_pwrite_error'; +--error ER_DISK_FULL +insert into t1 select * from t2; +SET debug_dbug= @saved_dbug; drop table t1,t2; diff --git a/mysys/my_pread.c b/mysys/my_pread.c index 56cc91ae083..28d7fc18f1b 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -158,6 +158,15 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count, #else writtenbytes= pwrite(Filedes, Buffer, Count, offset); #endif + + DBUG_EXECUTE_IF ("simulate_file_pwrite_error", + if (writtenbytes == Count && + my_seek(Filedes, 0, SEEK_END, MYF(0)) > 1024*1024L) + { + errno= ENOSPC; + writtenbytes= (size_t) -1; + }); + if (writtenbytes == Count) break; my_errno= errno; diff --git a/sql/handler.cc b/sql/handler.cc index ab18414e33f..ed53416157a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -499,7 +499,7 @@ int ha_init_errors(void) SETMSG(HA_ERR_INDEX_COL_TOO_LONG, ER_DEFAULT(ER_INDEX_COLUMN_TOO_LONG)); SETMSG(HA_ERR_INDEX_CORRUPT, ER_DEFAULT(ER_INDEX_CORRUPT)); SETMSG(HA_FTS_INVALID_DOCID, "Invalid InnoDB FTS Doc ID"); - SETMSG(HA_ERR_DISK_FULL, ER_DEFAULT(ER_DISK_FULL)); + SETMSG(HA_ERR_DISK_FULL, "Disk got full writing '%s'"); SETMSG(HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE, "Too many words in a FTS phrase or proximity search"); SETMSG(HA_ERR_FK_DEPTH_EXCEEDED, "Foreign key cascade delete/update exceeds"); SETMSG(HA_ERR_TABLESPACE_MISSING, ER_DEFAULT(ER_TABLESPACE_MISSING)); @@ -4456,8 +4456,12 @@ void handler::print_error(int error, myf errflag) break; case ENOSPC: case HA_ERR_DISK_FULL: - textno= ER_DISK_FULL; SET_FATAL_ERROR; // Ensure error is logged + my_printf_error(ER_DISK_FULL, "Disk got full writing '%s.%s' (Errcode: %M)", + MYF(errflag | ME_ERROR_LOG), + table_share->db.str, table_share->table_name.str, + error); + DBUG_VOID_RETURN; break; case HA_ERR_KEY_NOT_FOUND: case HA_ERR_NO_ACTIVE_RECORD: From 1331c7324326c3707536d9aa77fc789c8581c7d7 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 27 Feb 2025 10:24:05 +0200 Subject: [PATCH 37/65] Moved server_threads.erase(thd) to end of handle_slave_sql() The effect is that 'show processlist' will show the Slave SQL thread until the thread ends. This may help finding cases where the Slave SQL thread could hang for some time during the cleanup part. The Slave SQL thread will have the state "Slave SQL thread ending' during this stage. Reviewed-by: Kristian Nielsen --- sql/mysqld.cc | 2 ++ sql/mysqld.h | 1 + sql/slave.cc | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3495a300321..f1e7b786221 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9209,6 +9209,7 @@ PSI_stage_info stage_preparing= { 0, "Preparing", 0}; PSI_stage_info stage_purging_old_relay_logs= { 0, "Purging old relay logs", 0}; PSI_stage_info stage_query_end= { 0, "Query end", 0}; PSI_stage_info stage_starting_cleanup= { 0, "Starting cleanup", 0}; +PSI_stage_info stage_slave_sql_cleanup= { 0, "Slave SQL thread ending", 0}; PSI_stage_info stage_rollback= { 0, "Rollback", 0}; PSI_stage_info stage_rollback_implicit= { 0, "Rollback_implicit", 0}; PSI_stage_info stage_commit= { 0, "Commit", 0}; @@ -9442,6 +9443,7 @@ PSI_stage_info *all_server_stages[]= & stage_preparing, & stage_purging_old_relay_logs, & stage_starting_cleanup, + & stage_slave_sql_cleanup, & stage_query_end, & stage_queueing_master_event_to_the_relay_log, & stage_reading_event_from_the_relay_log, diff --git a/sql/mysqld.h b/sql/mysqld.h index 66b2a757c14..41dea67707d 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -604,6 +604,7 @@ extern PSI_stage_info stage_preparing; extern PSI_stage_info stage_purging_old_relay_logs; extern PSI_stage_info stage_query_end; extern PSI_stage_info stage_starting_cleanup; +extern PSI_stage_info stage_slave_sql_cleanup; extern PSI_stage_info stage_rollback; extern PSI_stage_info stage_rollback_implicit; extern PSI_stage_info stage_commit; diff --git a/sql/slave.cc b/sql/slave.cc index 90680144426..149b6c47bbe 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5404,6 +5404,7 @@ pthread_handler_t handle_slave_sql(void *arg) THD *thd; /* needs to be first for thread_stack */ char saved_log_name[FN_REFLEN]; char saved_master_log_name[FN_REFLEN]; + bool thd_initialized= 0; my_off_t UNINIT_VAR(saved_log_pos); my_off_t UNINIT_VAR(saved_master_log_pos); String saved_skip_gtid_pos; @@ -5506,6 +5507,7 @@ pthread_handler_t handle_slave_sql(void *arg) thd->variables.alter_algorithm= (ulong) Alter_info::ALTER_TABLE_ALGORITHM_DEFAULT; server_threads.insert(thd); + thd_initialized= 1; /* We are going to set slave_running to 1. Assuming slave I/O thread is alive and connected, this is going to make Seconds_Behind_Master be 0 @@ -5883,7 +5885,7 @@ pthread_handler_t handle_slave_sql(void *arg) } THD_STAGE_INFO(thd, stage_waiting_for_slave_mutex_on_exit); thd->add_status_to_global(); - server_threads.erase(thd); + THD_STAGE_INFO(thd, stage_slave_sql_cleanup); mysql_mutex_lock(&rli->run_lock); err_during_init: @@ -5954,6 +5956,8 @@ err_during_init: rpl_parallel_resize_pool_if_no_slaves(); delete serial_rgi; + if (thd_initialized) + server_threads.erase(thd); delete thd; DBUG_LEAVE; // Must match DBUG_ENTER() From b12e8d90955179f43bc0c4aa46c3e4d0522fb603 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 3 Mar 2025 12:27:43 +0200 Subject: [PATCH 38/65] MENT-2235 Aria engine: log initialization failed Some thing causes the aria_log_control file to be larger than the expected 52 bytes. The control file has the correct information but somehow it is filled up with ox00 bytes up to 512 bytes. This could have happened in case of a file system crash that enlarged the file to the sector boundary. Fixed that aria will ignore bytes outside of it's expected Other things: - Fixed wrong DBUG_ASSERT() in my_malloc_size_cb_func() that could cause crashes in debug binaries during Aria recovery. --- sql/mysqld.cc | 10 ++++---- storage/maria/ma_control_file.c | 45 +++++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f1e7b786221..3d63fc82afd 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3635,12 +3635,12 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific) #endif /* - When thread specific is set, both mysqld_server_initialized and thd - must be set, and we check that with DBUG_ASSERT. - - However, do not crash, if current_thd is NULL, in release version. + is_thread_specific is only relevant when a THD exist and the server + has fully started. is_thread_specific can be set during recovery by + Aria for functions that are normally only run in one thread. + However InnoDB sets thd early, so we can use it. */ - DBUG_ASSERT(!is_thread_specific || (mysqld_server_initialized && thd)); + DBUG_ASSERT(!is_thread_specific || thd || !plugins_are_initialized); if (is_thread_specific && likely(thd)) /* If thread specific memory */ { diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c index a6daa8bef24..76b0ec2c0b7 100644 --- a/storage/maria/ma_control_file.c +++ b/storage/maria/ma_control_file.c @@ -275,7 +275,7 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing, my_bool wait_for_lock) { uchar buffer[CF_MAX_SIZE]; - char name[FN_REFLEN], errmsg_buff[256]; + char name[FN_REFLEN], errmsg_buff[512]; const char *errmsg, *lock_failed_errmsg= "Could not get an exclusive lock;" " file is probably in use by another process"; uint new_cf_create_time_size, new_cf_changeable_size, new_block_size; @@ -399,10 +399,14 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing, if (new_cf_create_time_size < CF_MIN_CREATE_TIME_TOTAL_SIZE || new_cf_changeable_size < CF_MIN_CHANGEABLE_TOTAL_SIZE || - new_cf_create_time_size + new_cf_changeable_size != file_size) + new_cf_create_time_size + new_cf_changeable_size > file_size) { error= CONTROL_FILE_INCONSISTENT_INFORMATION; - errmsg= "Sizes stored in control file are inconsistent"; + sprintf(errmsg_buff, + "Sizes stored in control file are inconsistent. " + "create_time_size: %u changeable_size: %u file_size: %llu", + new_cf_create_time_size, new_cf_changeable_size, (ulonglong) file_size); + errmsg= errmsg_buff; goto err; } @@ -613,6 +617,20 @@ my_bool ma_control_file_inited(void) return (control_file_fd >= 0); } + + +static int check_zerofill(uchar *buffer, ulonglong offset, ulonglong length) +{ + uchar *pos= buffer + offset, *end= buffer+length; + while (pos < end) + { + if (*pos++) + return 1; + } + return 0; +} + + /** Print content of aria_log_control file */ @@ -620,6 +638,7 @@ my_bool ma_control_file_inited(void) my_bool print_aria_log_control() { uchar buffer[CF_MAX_SIZE]; + char errmsg_buff[512]; char name[FN_REFLEN], uuid_str[MY_UUID_STRING_LENGTH+1]; const char *errmsg; uint new_cf_create_time_size, new_cf_changeable_size; @@ -696,10 +715,14 @@ my_bool print_aria_log_control() if (new_cf_create_time_size < CF_MIN_CREATE_TIME_TOTAL_SIZE || new_cf_changeable_size < CF_MIN_CHANGEABLE_TOTAL_SIZE || - new_cf_create_time_size + new_cf_changeable_size != file_size) + new_cf_create_time_size + new_cf_changeable_size > file_size) { error= CONTROL_FILE_INCONSISTENT_INFORMATION; - errmsg= "Sizes stored in control file are inconsistent"; + sprintf(errmsg_buff, + "Sizes stored in control file are inconsistent. " + "create_time_size: %u changeable_size: %u file_size: %llu", + new_cf_create_time_size, new_cf_changeable_size, (ulonglong) file_size); + errmsg= errmsg_buff; goto err; } checkpoint_lsn= lsn_korr(buffer + new_cf_create_time_size + @@ -723,6 +746,18 @@ my_bool print_aria_log_control() (buffer + new_cf_create_time_size + CF_RECOV_FAIL_OFFSET)[0]; printf("recovery_failures: %u\n", recovery_fails); } + if (check_zerofill(buffer, new_cf_create_time_size + new_cf_changeable_size, file_size)) + { + printf("Warning: %s file_size is %llu (should be %llu) and contains unknown data.\n" + "It will still work but should be examined.\n", + name, (ulonglong) file_size, + (ulonglong) (new_cf_create_time_size + new_cf_changeable_size)); + } + else if (new_cf_create_time_size + new_cf_changeable_size < file_size) + printf("Note: file_size (%llu) is bigger than the expected file size %llu.\n" + "This is unexpected but will not cause any issues.\n", + (ulonglong) file_size, + (ulonglong) (new_cf_create_time_size + new_cf_changeable_size)); mysql_file_close(file, MYF(0)); DBUG_RETURN(0); From 64a14588477245c2a64a202c20ef80a88be0302f Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 7 Mar 2025 19:24:10 +0200 Subject: [PATCH 39/65] Ensure that ER_CONNECTION_KILLED error message is not lost my_real_read() detects if the connection was killed and sets error to ER_CONNECTION_KILLED. However net_real_write() overrides the error with ER_NET_READ_INTERRUPTED or ER_NET_READ_ERROR when it tries to send the 'Connection was killed' to the user on a closed connection. Fixed by not overwriting the original error code if the connection was shutdown. Rewiewed-by: Kristian Nielsen --- sql/net_serv.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index e0fad74288a..35b2a24a2d2 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -773,18 +773,22 @@ net_real_write(NET *net,const uchar *packet, size_t len) } #endif /* !defined(MYSQL_SERVER) */ net->error= 2; /* Close socket */ - net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED : - ER_NET_ERROR_ON_WRITE); -#ifdef MYSQL_SERVER - if (global_system_variables.log_warnings > 3) + + if (net->vio->state != VIO_STATE_SHUTDOWN || net->last_errno == 0) { - sql_print_warning("Could not write packet: fd: %lld state: %d " - "errno: %d vio_errno: %d length: %ld", - (longlong) vio_fd(net->vio), (int) net->vio->state, - vio_errno(net->vio), net->last_errno, - (ulong) (end-pos)); - } + net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED : + ER_NET_ERROR_ON_WRITE); +#ifdef MYSQL_SERVER + if (global_system_variables.log_warnings > 3) + { + sql_print_warning("Could not write packet: fd: %lld state: %d " + "errno: %d vio_errno: %d length: %ld", + (longlong) vio_fd(net->vio), (int) net->vio->state, + vio_errno(net->vio), net->last_errno, + (ulong) (end-pos)); + } #endif + } MYSQL_SERVER_my_error(net->last_errno, MYF(0)); break; } From eef94c9d460019c05daffea9cbe0009e3556cf5d Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 9 Mar 2025 14:34:54 +0200 Subject: [PATCH 40/65] MDEV-36248 Connect crashes server because of duplicate 'free()' in GetUser If connect engineis not able to allocate connect_work_space memory for GetUser() it will call free() twice with the same value (g). g was freed first in user_connect::user_init() which calls PlugExit() on errors and then again in ~user_connect() which also calls PlugExit(). Fixed by setting g to 0 in user_init() after calling PlugExit() This code was tested 'by hand' by setting connect.work_space=600G Other things: - Removed some very old not relevant comments in touched code - Added comments to clarify how some memory was freed - Fixed indentation in changed functions. --- storage/connect/connect.cc | 8 ++++---- storage/connect/user_connect.cc | 19 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 72b12552b95..9cd142e9efa 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -92,11 +92,11 @@ void CntEndDB(PGLOBAL g) free(dbuserp); - if (trace(1)) - htrc("CntEndDB: Freeing Dup\n"); + if (trace(1)) + htrc("CntEndDB: Freeing Dup\n"); - g->Activityp->Aptr = NULL; - } // endif dbuserp + g->Activityp->Aptr = NULL; // Free PlgGetUser() data + } // endif dbuserp } // end of CntEndDB diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc index ba446a3e2f3..23acd173f6b 100644 --- a/storage/connect/user_connect.cc +++ b/storage/connect/user_connect.cc @@ -101,9 +101,6 @@ bool user_connect::user_init() PACTIVITY ap= NULL; PDBUSER dup= NULL; - // Areasize= 64M because of VEC tables. Should be parameterisable -//g= PlugInit(NULL, 67108864); -//g= PlugInit(NULL, 134217728); // 128M was because of old embedded tests g= PlugInit(NULL, (size_t)worksize); // Check whether the initialization is complete @@ -113,12 +110,13 @@ bool user_connect::user_init() printf("%s\n", g->Message); (void) PlugExit(g); + g= 0; - if (dup) - free(dup); + if (dup) + free(dup); return true; - } // endif g-> + } // endif g-> dup->Catalog= new MYCAT(NULL); @@ -128,17 +126,16 @@ bool user_connect::user_init() g->Activityp= ap; g->Activityp->Aptr= dup; - pthread_mutex_lock(&usrmut); + pthread_mutex_lock(&usrmut); next= to_users; to_users= this; if (next) next->previous= this; - count = 1; - pthread_mutex_unlock(&usrmut); - - last_query_id= thdp->query_id; + count = 1; + pthread_mutex_unlock(&usrmut); + last_query_id= thdp->query_id; return false; } // end of user_init From 2641409731adac014425e7a4f81c30add3962cc5 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Sat, 8 Mar 2025 11:11:58 +0100 Subject: [PATCH 41/65] Fix redundant ER_PRIOR_COMMIT_FAILED in parallel replication wait_for_prior_commit() can be called multiple times per event group, only do my_error() the first time the call fails. Remove redundant set_overwrite_status() calls. Signed-off-by: Kristian Nielsen Reviewed-by: Monty --- sql/rpl_parallel.cc | 8 -------- sql/sql_class.cc | 18 ++++++++++++++++++ sql/sql_class.h | 5 +++-- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index f2633c3e1d1..502a0501553 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -157,8 +157,6 @@ finish_event_group(rpl_parallel_thread *rpt, uint64 sub_id, wait_for_commit *wfc= &rgi->commit_orderer; int err; - thd->get_stmt_da()->set_overwrite_status(true); - if (unlikely(rgi->worker_error)) { /* @@ -317,10 +315,6 @@ finish_event_group(rpl_parallel_thread *rpt, uint64 sub_id, wait_for_pending_deadlock_kill(thd, rgi); thd->clear_error(); thd->reset_killed(); - /* - Would do thd->get_stmt_da()->set_overwrite_status(false) here, but - reset_diagnostics_area() already does that. - */ thd->get_stmt_da()->reset_diagnostics_area(); wfc->wakeup_subsequent_commits(rgi->worker_error); } @@ -1567,9 +1561,7 @@ handle_rpl_parallel_thread(void *arg) else { delete qev->ev; - thd->get_stmt_da()->set_overwrite_status(true); err= thd->wait_for_prior_commit(); - thd->get_stmt_da()->set_overwrite_status(false); } end_of_group= diff --git a/sql/sql_class.cc b/sql/sql_class.cc index b20e1052e30..0effdbfcdb5 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -8365,6 +8365,24 @@ end: } +void +wait_for_commit::prior_commit_error(THD *thd) +{ + /* + Only raise a "prior commit failed" error if we didn't already raise + an error. + + The ER_PRIOR_COMMIT_FAILED is just an internal mechanism to ensure that a + transaction does not commit successfully if a prior commit failed, so that + the parallel replication worker threads stop in an orderly fashion when + one of them get an error. Thus, if another worker already got another real + error, overriding it with ER_PRIOR_COMMIT_FAILED is not useful. + */ + if (!thd->get_stmt_da()->is_set()) + my_error(ER_PRIOR_COMMIT_FAILED, MYF(0)); +} + + /* Wakeup anyone waiting for us to have committed. diff --git a/sql/sql_class.h b/sql/sql_class.h index 4cee31b296e..69b021cd41d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2398,8 +2398,8 @@ struct wait_for_commit return wait_for_prior_commit2(thd, allow_kill); else { - if (wakeup_error) - my_error(ER_PRIOR_COMMIT_FAILED, MYF(0)); + if (unlikely(wakeup_error)) + prior_commit_error(thd); return wakeup_error; } } @@ -2450,6 +2450,7 @@ struct wait_for_commit void wakeup(int wakeup_error); int wait_for_prior_commit2(THD *thd, bool allow_kill); + void prior_commit_error(THD *thd); void wakeup_subsequent_commits2(int wakeup_error); void unregister_wait_for_prior_commit2(); From 6810cdae1be9033cb59d5cd1ad3feb69b43c8ca4 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 13 Mar 2025 11:25:40 +0100 Subject: [PATCH 42/65] Add --source include/long_test.inc to a few long-running tests Signed-off-by: Kristian Nielsen --- mysql-test/main/mysql_upgrade.test | 2 +- mysql-test/main/mysqldump.test | 2 +- mysql-test/suite/atomic/alter_table.test | 1 + mysql-test/suite/atomic/create_table.test | 1 + mysql-test/suite/atomic/drop_table.test | 1 + mysql-test/suite/atomic/rename_table.test | 1 + mysql-test/suite/innodb_gis/t/rtree_purge.test | 1 + mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test | 1 + 8 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test index 442d9c3ecaa..20e7c13f24b 100644 --- a/mysql-test/main/mysql_upgrade.test +++ b/mysql-test/main/mysql_upgrade.test @@ -1,8 +1,8 @@ +--source include/long_test.inc -- source include/mysql_upgrade_preparation.inc -- source include/have_working_dns.inc -- source include/have_innodb.inc -- source include/have_partition.inc --- source include/no_valgrind_without_big.inc set sql_mode=""; diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test index 0b109ca1770..1cf83d2351f 100644 --- a/mysql-test/main/mysqldump.test +++ b/mysql-test/main/mysqldump.test @@ -1,4 +1,4 @@ ---source include/no_valgrind_without_big.inc +--source include/long_test.inc --source include/have_utf8mb4.inc call mtr.add_suppression("@003f.frm' \\(errno: 22\\)"); diff --git a/mysql-test/suite/atomic/alter_table.test b/mysql-test/suite/atomic/alter_table.test index 1f87b7e71b8..bad3bbad2d5 100644 --- a/mysql-test/suite/atomic/alter_table.test +++ b/mysql-test/suite/atomic/alter_table.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_debug.inc --source include/have_innodb.inc --source include/have_log_bin.inc diff --git a/mysql-test/suite/atomic/create_table.test b/mysql-test/suite/atomic/create_table.test index ff53a12ebab..2feb4e85f35 100644 --- a/mysql-test/suite/atomic/create_table.test +++ b/mysql-test/suite/atomic/create_table.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_debug.inc --source include/have_sequence.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/atomic/drop_table.test b/mysql-test/suite/atomic/drop_table.test index a3635c76447..e0ad2a58622 100644 --- a/mysql-test/suite/atomic/drop_table.test +++ b/mysql-test/suite/atomic/drop_table.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_debug.inc --source include/have_innodb.inc --source include/have_csv.inc diff --git a/mysql-test/suite/atomic/rename_table.test b/mysql-test/suite/atomic/rename_table.test index ee24d1f087f..645c2d14229 100644 --- a/mysql-test/suite/atomic/rename_table.test +++ b/mysql-test/suite/atomic/rename_table.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_debug.inc --source include/have_innodb.inc --source include/have_csv.inc diff --git a/mysql-test/suite/innodb_gis/t/rtree_purge.test b/mysql-test/suite/innodb_gis/t/rtree_purge.test index 194c8a23b01..f89f590acf0 100644 --- a/mysql-test/suite/innodb_gis/t/rtree_purge.test +++ b/mysql-test/suite/innodb_gis/t/rtree_purge.test @@ -1,5 +1,6 @@ # This test case will test R-tree purge. +--source include/long_test.inc --source include/innodb_page_size.inc --source include/have_sequence.inc --source include/not_valgrind.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test index bc5c60749c0..348e6721b6b 100644 --- a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test @@ -3,6 +3,7 @@ # tables. Specifically when drop temporary tables and create temporary tables # are used. ################################################################################### +--source include/long_test.inc --source include/have_binlog_format_row.inc --source include/have_innodb.inc --source include/master-slave.inc From 04e114aec0322e7a9a96b590ee8d4a0dbae1fcf5 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 13 Mar 2025 18:58:12 +0100 Subject: [PATCH 43/65] Fix sporadic failure of rpl.parallel_backup_xa_debug The test case set debug_sync=RESET without waiting for the server thread to receive the prior signal. This can cause the signal to be lost, the thread to not wake up, and thus the test to time out. Signed-off-by: Kristian Nielsen --- mysql-test/suite/rpl/r/parallel_backup_xa_debug.result | 2 ++ mysql-test/suite/rpl/t/parallel_backup_xa_debug.test | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/parallel_backup_xa_debug.result b/mysql-test/suite/rpl/r/parallel_backup_xa_debug.result index aa5ff772552..cd3b335b540 100644 --- a/mysql-test/suite/rpl/r/parallel_backup_xa_debug.result +++ b/mysql-test/suite/rpl/r/parallel_backup_xa_debug.result @@ -4,6 +4,7 @@ connection master; CREATE TABLE t (a INT) ENGINE = innodb; connection slave; include/stop_slave.inc +SET STATEMENT sql_log_bin= 0 FOR ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads; SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode; SET @@global.slave_parallel_threads= 2; @@ -19,6 +20,7 @@ xa prepare 'x'; connection slave; SET @@global.debug_dbug="+d,hold_worker_on_schedule"; start slave; +SET debug_sync = 'now WAIT_FOR reached_pause'; connection slave1; backup stage start; backup stage block_commit; diff --git a/mysql-test/suite/rpl/t/parallel_backup_xa_debug.test b/mysql-test/suite/rpl/t/parallel_backup_xa_debug.test index 03fc66d89e7..e3df0ac69a1 100644 --- a/mysql-test/suite/rpl/t/parallel_backup_xa_debug.test +++ b/mysql-test/suite/rpl/t/parallel_backup_xa_debug.test @@ -11,6 +11,7 @@ CREATE TABLE t (a INT) ENGINE = innodb; --sync_slave_with_master --source include/stop_slave.inc +SET STATEMENT sql_log_bin= 0 FOR ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; SET @old_parallel_threads= @@GLOBAL.slave_parallel_threads; SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode; SET @@global.slave_parallel_threads= 2; @@ -28,20 +29,21 @@ xa prepare 'x'; --connection slave SET @@global.debug_dbug="+d,hold_worker_on_schedule"; start slave; +SET debug_sync = 'now WAIT_FOR reached_pause'; --let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit" --source include/wait_condition.inc --connection slave1 backup stage start; ---send backup stage block_commit +backup stage block_commit; --connection slave --let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for backup lock" SET debug_sync = 'now SIGNAL continue_worker'; +--source include/wait_condition.inc SET debug_sync = RESET; --connection slave1 -reap; backup stage end; --connection master From c3c5cd9377d9e8305c33623f4f94cfc90ade37be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 14 Mar 2025 13:06:37 +0200 Subject: [PATCH 44/65] =?UTF-8?q?MDEV-35813=20Unnecessary=20InnoDB=20log?= =?UTF-8?q?=20writes=20in=20INSERT=E2=80=A6SELECT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ha_innobase::extra(): Conditionally avoid a log write that had been added in commit e5b9dc15368c7597a70569048eebfc5e05e98ef4 (MDEV-25910) because it may be invoked as part of select_insert::prepare_eof() and not only during DDL operations. Reviewed by: Sergei Golubchik --- sql/sql_table.cc | 2 +- storage/innobase/handler/ha_innodb.cc | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9837d44adf0..bf032d3ca03 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -11135,7 +11135,7 @@ do_continue:; debug_crash_here("ddl_log_alter_after_copy"); // Use old table /* - We are new ready to use the new table. Update the state in the + We are now ready to use the new table. Update the state in the ddl log so that we recovery know that the new table is ready and in case of crash it should use the new one and log the query to the binary log. diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 1f8744465a2..f147235f669 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -15958,9 +15958,22 @@ ha_innobase::extra( break; case HA_EXTRA_END_ALTER_COPY: trx = check_trx_exists(ha_thd()); + if (!m_prebuilt->table->skip_alter_undo) { + /* This could be invoked inside INSERT...SELECT. + We do not want any extra log writes, because + they could cause a severe performance regression. */ + break; + } m_prebuilt->table->skip_alter_undo = 0; if (!m_prebuilt->table->is_temporary() && !high_level_read_only) { + /* The extra log write is necessary for + ALTER TABLE...ALGORITHM=COPY, because + a normal transaction commit would be a no-op + because no undo log records were generated. + This log write will also be unnecessarily executed + during CREATE...SELECT, which is the other caller of + handler::extra(HA_EXTRA_BEGIN_ALTER_COPY). */ log_buffer_flush_to_disk(); } break; From b6b6bb8d36b8dd72150647570833ec60a037a237 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Sat, 8 Mar 2025 07:27:04 +0100 Subject: [PATCH 45/65] Fix sporadic failures of rpl.rpl_gtid_crash - Suppress a couple errors the slave can get as the master crashes. - The mysql-test-run occasionally takes 120 seconds between crashing the master and starting it back up for some (unknown) reason. For now, work-around that by letting the slave try for 500 seconds to connect to master before giving up instead of only 100 seconds. Reviewed-by: Brandon Nesterenko Signed-off-by: Kristian Nielsen --- mysql-test/suite/rpl/r/rpl_gtid_crash.result | 2 ++ mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt | 2 +- mysql-test/suite/rpl/t/rpl_gtid_crash.test | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result index 4e74a3b25ac..181db3e28cb 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result @@ -11,6 +11,8 @@ INSERT INTO t1 VALUES (1, 0); connection server_2; SET sql_log_bin=0; call mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again'); +call mtr.add_suppression('Slave I/O: .*Lost connection to server during query'); +call mtr.add_suppression("Slave I/O thread couldn't register on master"); SET sql_log_bin=1; include/stop_slave.inc CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt b/mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt index 5b3fb44c910..13232d12992 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt @@ -1 +1 @@ ---master-retry-count=100 --slave-net-timeout=10 +--master-retry-count=500 --slave-net-timeout=10 diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index f2167911101..032150d2003 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -23,6 +23,8 @@ INSERT INTO t1 VALUES (1, 0); --sync_with_master SET sql_log_bin=0; call mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again'); +call mtr.add_suppression('Slave I/O: .*Lost connection to server during query'); +call mtr.add_suppression("Slave I/O thread couldn't register on master"); SET sql_log_bin=1; --source include/stop_slave.inc --replace_result $MASTER_MYPORT MASTER_PORT From acaf07daed13e723db29adb35a73a218f15d24b2 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 13 Mar 2025 10:43:21 +0100 Subject: [PATCH 46/65] Add --source include/long_test.inc to some tests This will make mysql-test-run.pl try to schedule these long-running (> 60 seconds) tests early in --parallel runs, which helps avoid that the testsuite gets stuck with a few long-running tests at the end while most other test workers are idle. This speed up mtr --parallel=96 with 25 seconds for me. Reviewed-by: Brandon Nesterenko Signed-off-by: Kristian Nielsen --- mysql-test/include/long_test.inc | 2 +- mysql-test/main/backup_locks.test | 1 + mysql-test/suite/binlog_encryption/encrypted_master.test | 1 + mysql-test/suite/funcs_2/t/innodb_charset.test | 2 +- mysql-test/suite/innodb/t/innodb_bug52663.test | 1 + mysql-test/suite/mariabackup/log_page_corruption.test | 2 +- mysql-test/suite/parts/t/partition_exchange_innodb.test | 1 + mysql-test/suite/parts/t/partition_exchange_memory.test | 1 + mysql-test/suite/parts/t/partition_exchange_myisam.test | 1 + mysql-test/suite/rpl/t/rpl_heartbeat_basic.test | 1 + mysql-test/suite/rpl/t/rpl_semi_sync.test | 1 + mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test | 1 + mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test | 1 + mysql-test/suite/rpl/t/rpl_typeconv.test | 1 + 14 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mysql-test/include/long_test.inc b/mysql-test/include/long_test.inc index 765f88b8037..7f3a3a61778 100644 --- a/mysql-test/include/long_test.inc +++ b/mysql-test/include/long_test.inc @@ -1,6 +1,6 @@ # We use this --source include to mark a test as taking long to run. # We can use this to schedule such test early (to not be left with -# only one or two long tests running, and rests of works idle), or to +# only one or two long tests running, and rests of workers idle), or to # run a quick test skipping long-running test cases. --source include/no_valgrind_without_big.inc diff --git a/mysql-test/main/backup_locks.test b/mysql-test/main/backup_locks.test index 40f12bb7ef8..6a1fe9f6094 100644 --- a/mysql-test/main/backup_locks.test +++ b/mysql-test/main/backup_locks.test @@ -2,6 +2,7 @@ # Tests BACKUP STAGE locking ######################################################################## +--source include/long_test.inc --source include/have_innodb.inc --source include/have_metadata_lock_info.inc --source include/not_embedded.inc diff --git a/mysql-test/suite/binlog_encryption/encrypted_master.test b/mysql-test/suite/binlog_encryption/encrypted_master.test index f6fc172c79e..1539ad29f00 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master.test +++ b/mysql-test/suite/binlog_encryption/encrypted_master.test @@ -18,6 +18,7 @@ # - with annotated events, default checksums and minimal binlog row image # +--source include/long_test.inc # The test can take very long time with valgrind --source include/not_valgrind.inc diff --git a/mysql-test/suite/funcs_2/t/innodb_charset.test b/mysql-test/suite/funcs_2/t/innodb_charset.test index 631c20352d4..c91a9c4d5d6 100644 --- a/mysql-test/suite/funcs_2/t/innodb_charset.test +++ b/mysql-test/suite/funcs_2/t/innodb_charset.test @@ -6,7 +6,7 @@ # Checking of other prerequisites is in charset_master.test # ################################################################################ ---source include/no_valgrind_without_big.inc +--source include/long_test.inc --source include/have_innodb.inc # Starting with MariaDB 10.6, ensure that DDL recovery will have completed diff --git a/mysql-test/suite/innodb/t/innodb_bug52663.test b/mysql-test/suite/innodb/t/innodb_bug52663.test index fcf97531e00..dd246297d94 100644 --- a/mysql-test/suite/innodb/t/innodb_bug52663.test +++ b/mysql-test/suite/innodb/t/innodb_bug52663.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_innodb.inc set session transaction isolation level read committed; diff --git a/mysql-test/suite/mariabackup/log_page_corruption.test b/mysql-test/suite/mariabackup/log_page_corruption.test index 27f2d383b47..e556cba4661 100644 --- a/mysql-test/suite/mariabackup/log_page_corruption.test +++ b/mysql-test/suite/mariabackup/log_page_corruption.test @@ -1,5 +1,5 @@ +--source include/long_test.inc --source include/have_debug.inc ---source include/no_valgrind_without_big.inc --source include/innodb_undo_tablespaces.inc --echo ######## diff --git a/mysql-test/suite/parts/t/partition_exchange_innodb.test b/mysql-test/suite/parts/t/partition_exchange_innodb.test index 31ea61bbb7b..73dd5500a43 100644 --- a/mysql-test/suite/parts/t/partition_exchange_innodb.test +++ b/mysql-test/suite/parts/t/partition_exchange_innodb.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_innodb.inc --source include/have_partition.inc --source include/have_debug_sync.inc diff --git a/mysql-test/suite/parts/t/partition_exchange_memory.test b/mysql-test/suite/parts/t/partition_exchange_memory.test index 7384a49f829..431a662f056 100644 --- a/mysql-test/suite/parts/t/partition_exchange_memory.test +++ b/mysql-test/suite/parts/t/partition_exchange_memory.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_partition.inc --source include/have_debug_sync.inc diff --git a/mysql-test/suite/parts/t/partition_exchange_myisam.test b/mysql-test/suite/parts/t/partition_exchange_myisam.test index 68e55090a9c..ab3fb388efd 100644 --- a/mysql-test/suite/parts/t/partition_exchange_myisam.test +++ b/mysql-test/suite/parts/t/partition_exchange_myisam.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_partition.inc --source include/have_debug_sync.inc diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index a8857091ef6..0e1ac93882d 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -9,6 +9,7 @@ # * Various states of master and heartbeat # * Circular replication ############################################################# +--source include/long_test.inc --source include/master-slave.inc # # The test runs long and does not have any specifics to diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index c3cd918b5fc..0c8c797af56 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -4,6 +4,7 @@ # Please check all dependent tests after modifying it # +source include/long_test.inc; source include/not_embedded.inc; source include/have_innodb.inc; source include/master-slave.inc; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test index 2d91d2e4118..015dcceb043 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_binlog_format_statement.inc set global rpl_semi_sync_master_wait_point=AFTER_SYNC; source rpl_semi_sync.test; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test index 47af6c34fcf..0ce94b82a67 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_after_sync_row.test @@ -1,3 +1,4 @@ +--source include/long_test.inc --source include/have_binlog_format_row.inc set global rpl_semi_sync_master_wait_point=AFTER_SYNC; source rpl_semi_sync.test; diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test index 9e566258882..5d8dc67c463 100644 --- a/mysql-test/suite/rpl/t/rpl_typeconv.test +++ b/mysql-test/suite/rpl/t/rpl_typeconv.test @@ -4,6 +4,7 @@ # Please check all dependent tests after modifying it # +--source include/long_test.inc --source include/have_binlog_format_row.inc --source include/master-slave.inc From d931bb8174dd09998493547799a627e92603e863 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 13 Mar 2025 14:50:25 +0100 Subject: [PATCH 47/65] MDEV-36287: Server crash in SHOW SLAVE STATUS concurrent with STOP SLAVE In SHOW SLAVE STATUS, do not access members of the SQL thread's THD without holding mi->run_lock. Otherwise the THD can go away in case of concurrent STOP SLAVE, leading to invalid memory references and server crash. Reviewed-by: Monty Reviewed-by: Brandon Nesterenko Signed-off-by: Kristian Nielsen --- sql/slave.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index 6f4176f233d..8006c528195 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3162,19 +3162,24 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full, if (full) protocol->store(mi->connection_name.str, mi->connection_name.length, &my_charset_bin); + mysql_mutex_lock(&mi->run_lock); + THD *sql_thd= mi->rli.sql_driver_thd; + const char *slave_sql_running_state= + sql_thd ? sql_thd->get_proc_info() : ""; + THD *io_thd= mi->io_thd; + const char *slave_io_running_state= io_thd ? io_thd->get_proc_info() : ""; + mysql_mutex_unlock(&mi->run_lock); + if (full) { /* Show what the sql driver replication thread is doing This is only meaningful if there is only one slave thread. */ - protocol->store(mi->rli.sql_driver_thd ? - mi->rli.sql_driver_thd->get_proc_info() : "", - &my_charset_bin); + protocol->store(slave_sql_running_state, &my_charset_bin); } - protocol->store(mi->io_thd ? mi->io_thd->get_proc_info() : "", &my_charset_bin); - mysql_mutex_unlock(&mi->run_lock); + protocol->store(slave_io_running_state, &my_charset_bin); mysql_mutex_lock(&mi->data_lock); mysql_mutex_lock(&mi->rli.data_lock); @@ -3341,10 +3346,6 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full, protocol->store((uint32) mi->rli.get_sql_delay()); // SQL_Remaining_Delay - // THD::proc_info is not protected by any lock, so we read it once - // to ensure that we use the same value throughout this function. - const char *slave_sql_running_state= - mi->rli.sql_driver_thd ? mi->rli.sql_driver_thd->proc_info : ""; if (slave_sql_running_state == stage_sql_thd_waiting_until_delay.m_name) { time_t t= my_time(0), sql_delay_end= mi->rli.get_sql_delay_end(); From 0e8e0065d61e6666992864f77b2ef532db8370e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 17 Mar 2025 16:21:09 +0200 Subject: [PATCH 48/65] MDEV-35813 test case --- mysql-test/suite/innodb/r/log_write.result | 11 +++++++++++ mysql-test/suite/innodb/t/log_write.test | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 mysql-test/suite/innodb/r/log_write.result create mode 100644 mysql-test/suite/innodb/t/log_write.test diff --git a/mysql-test/suite/innodb/r/log_write.result b/mysql-test/suite/innodb/r/log_write.result new file mode 100644 index 00000000000..5a9739edf98 --- /dev/null +++ b/mysql-test/suite/innodb/r/log_write.result @@ -0,0 +1,11 @@ +# MDEV-35813 Unnecessary InnoDB log writes in INSERT…SELECT +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; +SET GLOBAL innodb_max_purge_lag_wait=0; +SELECT variable_value INTO @log_writes FROM information_schema.global_status +WHERE variable_name='innodb_log_writes'; +INSERT INTO t1 SELECT * FROM t1; +SELECT variable_value-@log_writes FROM information_schema.global_status +WHERE variable_name='innodb_log_writes'; +variable_value-@log_writes +0 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/log_write.test b/mysql-test/suite/innodb/t/log_write.test new file mode 100644 index 00000000000..0527f1f8f89 --- /dev/null +++ b/mysql-test/suite/innodb/t/log_write.test @@ -0,0 +1,12 @@ +--source include/have_innodb.inc + +--echo # MDEV-35813 Unnecessary InnoDB log writes in INSERT…SELECT + +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; +SET GLOBAL innodb_max_purge_lag_wait=0; +SELECT variable_value INTO @log_writes FROM information_schema.global_status +WHERE variable_name='innodb_log_writes'; +INSERT INTO t1 SELECT * FROM t1; +SELECT variable_value-@log_writes FROM information_schema.global_status +WHERE variable_name='innodb_log_writes'; +DROP TABLE t1; From 1756b0f37dd8e5ce8c9cdb9fec8299ba64dd5dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 18 Mar 2025 10:41:38 +0200 Subject: [PATCH 49/65] MDEV-35813: more robust test case Let us integrate the test case with innodb.page_cleaner so that there will be less interference from log writes due to checkpoints. Also, make the test compatible with ./mtr --cursor-protocol. --- mysql-test/suite/innodb/r/log_write.result | 11 -------- mysql-test/suite/innodb/r/page_cleaner.result | 25 ++++++++++++++++- mysql-test/suite/innodb/t/log_write.test | 12 -------- mysql-test/suite/innodb/t/page_cleaner.test | 28 ++++++++++++++++++- 4 files changed, 51 insertions(+), 25 deletions(-) delete mode 100644 mysql-test/suite/innodb/r/log_write.result delete mode 100644 mysql-test/suite/innodb/t/log_write.test diff --git a/mysql-test/suite/innodb/r/log_write.result b/mysql-test/suite/innodb/r/log_write.result deleted file mode 100644 index 5a9739edf98..00000000000 --- a/mysql-test/suite/innodb/r/log_write.result +++ /dev/null @@ -1,11 +0,0 @@ -# MDEV-35813 Unnecessary InnoDB log writes in INSERT…SELECT -CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; -SET GLOBAL innodb_max_purge_lag_wait=0; -SELECT variable_value INTO @log_writes FROM information_schema.global_status -WHERE variable_name='innodb_log_writes'; -INSERT INTO t1 SELECT * FROM t1; -SELECT variable_value-@log_writes FROM information_schema.global_status -WHERE variable_name='innodb_log_writes'; -variable_value-@log_writes -0 -DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/page_cleaner.result b/mysql-test/suite/innodb/r/page_cleaner.result index 97dd012054b..93c986a93c9 100644 --- a/mysql-test/suite/innodb/r/page_cleaner.result +++ b/mysql-test/suite/innodb/r/page_cleaner.result @@ -2,8 +2,31 @@ SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct; SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm; SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0; SET GLOBAL innodb_max_dirty_pages_pct=0.0; +CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; +connect prevent_purge,localhost,root; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection default; +SET GLOBAL innodb_max_purge_lag_wait=0; SET GLOBAL innodb_max_dirty_pages_pct=90.0; -CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_10000; +SELECT variable_value INTO @log_writes FROM information_schema.global_status +WHERE variable_name='innodb_log_writes'; +BEGIN; +INSERT INTO t SELECT * FROM seq_1_to_500; +INSERT INTO t SELECT * FROM seq_501_to_1000; +INSERT INTO t SELECT * FROM seq_1001_to_1500; +INSERT INTO t SELECT * FROM seq_1501_to_2000; +INSERT INTO t SELECT * FROM seq_2001_to_2500; +INSERT INTO t SELECT * FROM seq_2501_to_3000; +INSERT INTO t SELECT * FROM seq_3001_to_3500; +INSERT INTO t SELECT * FROM seq_3501_to_4000; +INSERT INTO t SELECT * FROM seq_4001_to_4500; +INSERT INTO t SELECT * FROM seq_4501_to_5000; +ROLLBACK; +SELECT if(variable_value-@log_writes<10,'ok',variable_value-@log_writes) +FROM information_schema.global_status WHERE variable_name='innodb_log_writes'; +if(variable_value-@log_writes<10,'ok',variable_value-@log_writes) +ok +disconnect prevent_purge; SELECT variable_value>0 FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'; variable_value>0 diff --git a/mysql-test/suite/innodb/t/log_write.test b/mysql-test/suite/innodb/t/log_write.test deleted file mode 100644 index 0527f1f8f89..00000000000 --- a/mysql-test/suite/innodb/t/log_write.test +++ /dev/null @@ -1,12 +0,0 @@ ---source include/have_innodb.inc - ---echo # MDEV-35813 Unnecessary InnoDB log writes in INSERT…SELECT - -CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; -SET GLOBAL innodb_max_purge_lag_wait=0; -SELECT variable_value INTO @log_writes FROM information_schema.global_status -WHERE variable_name='innodb_log_writes'; -INSERT INTO t1 SELECT * FROM t1; -SELECT variable_value-@log_writes FROM information_schema.global_status -WHERE variable_name='innodb_log_writes'; -DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/page_cleaner.test b/mysql-test/suite/innodb/t/page_cleaner.test index f597619aa08..8568bc7ae6f 100644 --- a/mysql-test/suite/innodb/t/page_cleaner.test +++ b/mysql-test/suite/innodb/t/page_cleaner.test @@ -7,6 +7,12 @@ SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm; SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0; SET GLOBAL innodb_max_dirty_pages_pct=0.0; +CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; +--connect (prevent_purge,localhost,root) +START TRANSACTION WITH CONSISTENT SNAPSHOT; +--connection default +SET GLOBAL innodb_max_purge_lag_wait=0; + let $wait_condition = SELECT variable_value = 0 FROM information_schema.global_status @@ -15,7 +21,27 @@ WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'; SET GLOBAL innodb_max_dirty_pages_pct=90.0; -CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_10000; +--disable_cursor_protocol +SELECT variable_value INTO @log_writes FROM information_schema.global_status +WHERE variable_name='innodb_log_writes'; +--enable_cursor_protocol + +BEGIN; +INSERT INTO t SELECT * FROM seq_1_to_500; +INSERT INTO t SELECT * FROM seq_501_to_1000; +INSERT INTO t SELECT * FROM seq_1001_to_1500; +INSERT INTO t SELECT * FROM seq_1501_to_2000; +INSERT INTO t SELECT * FROM seq_2001_to_2500; +INSERT INTO t SELECT * FROM seq_2501_to_3000; +INSERT INTO t SELECT * FROM seq_3001_to_3500; +INSERT INTO t SELECT * FROM seq_3501_to_4000; +INSERT INTO t SELECT * FROM seq_4001_to_4500; +INSERT INTO t SELECT * FROM seq_4501_to_5000; +ROLLBACK; + +SELECT if(variable_value-@log_writes<10,'ok',variable_value-@log_writes) +FROM information_schema.global_status WHERE variable_name='innodb_log_writes'; +--disconnect prevent_purge SELECT variable_value>0 FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'; From 2ae721f2ad391e7b18a56aed2e18d0f12670dfab Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 19 Mar 2025 16:05:35 +0400 Subject: [PATCH 50/65] MDEV-36179 Assertion `0' failed in virtual bool Type_handler_row::Item_save_in_value(THD*, Item*, st_value*) const sp_head::execute_procedure() and sp_head::execute_function() did not check that Item_param could be passed as an actual parameter to a ROW type formal parameter of a stored routine. Example: CREATE PROCEDURE p0(OUT a ROW(a INT,b INT)) ...; PREPARE s0 'CALL p0(?)'; EXECUTE p0 USING @a; In case of passing a user variable as an OUT parameter it led to a crash after executing routine instructions, when copying formal OUT parameters to the bound actual parameters. Fix: Check cases when Item_param is being bound to a ROW type formal parameter. Raise an error if so. The new check is done for all parameter modes: IN, OUT, INOUT, for a consistent error message. The new check is done before executing the routine instructions. --- mysql-test/main/sp-row.result | 41 +++++++++++++++++++++++ mysql-test/main/sp-row.test | 61 +++++++++++++++++++++++++++++++++++ sql/sp_head.cc | 37 +++++++++++++++++++++ 3 files changed, 139 insertions(+) diff --git a/mysql-test/main/sp-row.result b/mysql-test/main/sp-row.result index 36a371d8c04..48b33eebc7a 100644 --- a/mysql-test/main/sp-row.result +++ b/mysql-test/main/sp-row.result @@ -2313,3 +2313,44 @@ SELECT 1 LIKE 2 ESCAPE a; END; $$ ERROR 21000: Operand should contain 1 column(s) +# Start of 10.6 tests +# +# MDEV-36179 Assertion `0' failed in virtual bool Type_handler_row::Item_save_in_value(THD*, Item*, st_value*) const +# +CREATE PROCEDURE p0 (IN a ROW(a INT,b INT)) +BEGIN +SET a=ROW(0,0); +END; +/ +PREPARE s0 FROM 'CALL p0(?)'; +EXECUTE s0 USING @a; +ERROR HY000: Illegal parameter data type row for operation 'EXECUTE ... USING ?' +DROP PROCEDURE p0; +CREATE PROCEDURE p0 (INOUT a ROW(a INT,b INT)) +BEGIN +SET a=ROW(0,0); +END; +/ +PREPARE s0 FROM 'CALL p0(?)'; +EXECUTE s0 USING @a; +ERROR HY000: Illegal parameter data type row for operation 'EXECUTE ... USING ?' +DROP PROCEDURE p0; +CREATE PROCEDURE p0 (OUT a ROW(a INT,b INT)) +BEGIN +SET a=ROW(0,0); +END; +/ +PREPARE s0 FROM 'CALL p0(?)'; +EXECUTE s0 USING @a; +ERROR HY000: Illegal parameter data type row for operation 'EXECUTE ... USING ?' +DROP PROCEDURE p0; +CREATE FUNCTION f0(a ROW(a INT,b INT)) RETURNS BOOLEAN +BEGIN +RETURN FALSE; +END; +/ +PREPARE s0 FROM 'SELECT f0(?)'; +EXECUTE s0 USING @a; +ERROR HY000: Illegal parameter data type row for operation 'EXECUTE ... USING ?' +DROP FUNCTION f0; +# End of 10.6 tests diff --git a/mysql-test/main/sp-row.test b/mysql-test/main/sp-row.test index 527ff9455bd..f6bad0011d1 100644 --- a/mysql-test/main/sp-row.test +++ b/mysql-test/main/sp-row.test @@ -1544,3 +1544,64 @@ BEGIN NOT ATOMIC END; $$ DELIMITER ;$$ + + +--echo # Start of 10.6 tests + + +--echo # +--echo # MDEV-36179 Assertion `0' failed in virtual bool Type_handler_row::Item_save_in_value(THD*, Item*, st_value*) const +--echo # + +DELIMITER /; +CREATE PROCEDURE p0 (IN a ROW(a INT,b INT)) +BEGIN + SET a=ROW(0,0); +END; +/ +DELIMITER ;/ +PREPARE s0 FROM 'CALL p0(?)'; +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +EXECUTE s0 USING @a; +DROP PROCEDURE p0; + + +DELIMITER /; +CREATE PROCEDURE p0 (INOUT a ROW(a INT,b INT)) +BEGIN + SET a=ROW(0,0); +END; +/ +DELIMITER ;/ +PREPARE s0 FROM 'CALL p0(?)'; +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +EXECUTE s0 USING @a; +DROP PROCEDURE p0; + + +DELIMITER /; +CREATE PROCEDURE p0 (OUT a ROW(a INT,b INT)) +BEGIN + SET a=ROW(0,0); +END; +/ +DELIMITER ;/ +PREPARE s0 FROM 'CALL p0(?)'; +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +EXECUTE s0 USING @a; +DROP PROCEDURE p0; + + +DELIMITER /; +CREATE FUNCTION f0(a ROW(a INT,b INT)) RETURNS BOOLEAN +BEGIN + RETURN FALSE; +END; +/ +DELIMITER ;/ +PREPARE s0 FROM 'SELECT f0(?)'; +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +EXECUTE s0 USING @a; +DROP FUNCTION f0; + +--echo # End of 10.6 tests diff --git a/sql/sp_head.cc b/sql/sp_head.cc index dcd46a55e13..926da91ae0b 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2114,6 +2114,27 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, /* Arguments must be fixed in Item_func_sp::fix_fields */ DBUG_ASSERT(argp[arg_no]->fixed()); + sp_variable *spvar= m_pcont->find_variable(arg_no); + + if (!spvar) + continue; + + /* + When you get a merge conflict, please move this code + into bind_input_param(). This also applies to the similar + code in execute_procedure(). + */ + if (!spvar->field_def.type_handler()->is_scalar_type() && + dynamic_cast(argp[arg_no])) + { + // Item_param cannot store values of non-scalar data types yet + my_error(ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION, MYF(0), + spvar->field_def.type_handler()->name().ptr(), + "EXECUTE ... USING ?"); + err_status= true; + goto err_with_cleanup; + } + if ((err_status= (*func_ctx)->set_parameter(thd, arg_no, &(argp[arg_no])))) goto err_with_cleanup; } @@ -2359,11 +2380,27 @@ sp_head::execute_procedure(THD *thd, List *args) if (!arg_item) break; + /* + When you get a merge conflict, please move this code + into bind_input_param(). This also applies to the similar + code in execute_function(). + */ sp_variable *spvar= m_pcont->find_variable(i); if (!spvar) continue; + if (!spvar->field_def.type_handler()->is_scalar_type() && + dynamic_cast(arg_item)) + { + // Item_param cannot store values of non-scalar data types yet + my_error(ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION, MYF(0), + spvar->field_def.type_handler()->name().ptr(), + "EXECUTE ... USING ?"); + err_status= true; + break; + } + if (spvar->mode != sp_variable::MODE_IN) { Settable_routine_parameter *srp= From 64ea539f7666eca7151b23587fe8903b45f67876 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Mon, 17 Mar 2025 11:46:34 +0300 Subject: [PATCH 51/65] MDEV-36208 dbug_print_table_row is broken: prints empty rows in debugger --- sql/filesort.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index a0e16791f89..442597efe49 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -667,7 +667,7 @@ const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names) move_back_guard.engage(); } - SCOPE_VALUE(table->read_set, (table->read_set && table->write_set) ? + SCOPE_VALUE(table->read_set, (table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE) ? table->write_set : table->read_set); output.length(0); From 56bc6901d6b3fda9fbf7798ed6c764cb0e09f879 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Wed, 19 Mar 2025 00:03:03 +0700 Subject: [PATCH 52/65] MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables Attempt to create a procedure with the DEFINER clause resulted in abnormal server termination in case the server run with the option --skip-grant-tables=1. The reason of abnormal termination is that on handling of the DEFINER clause, not initialized data members of acl_cache is accessed, that led to server crash. Behaviour of the server for considered use case must be the same as for embedded server. Than means, if a security subsytem wasn't initialized (server is started with the option --skip-grant-tables=1) return success from get_current_user() without further access to the acl_cache that obviously not initialized. Additionlly, AUTHID::is_role was modified to handle the case when a host part of the user name isn't provided. Treat this case as if the empty host name is provided. --- mysql-test/main/skip_grants.result | 8 ++++++++ mysql-test/main/skip_grants.test | 11 +++++++++++ mysql-test/main/sp-bugs.result | 9 +++++++++ mysql-test/main/sp-bugs.test | 20 ++++++++++++++++++++ sql/sql_acl.cc | 3 +++ sql/structs.h | 2 +- 6 files changed, 52 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/skip_grants.result b/mysql-test/main/skip_grants.result index a8633807571..daf4191a555 100644 --- a/mysql-test/main/skip_grants.result +++ b/mysql-test/main/skip_grants.result @@ -139,3 +139,11 @@ drop user baz@baz; # # End of 10.3 tests # +# +# MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables +# +CREATE DEFINER=a PROCEDURE p() SELECT 1; +CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100; +DROP PROCEDURE p; +DROP FUNCTION f; +# End of 10.5 tests diff --git a/mysql-test/main/skip_grants.test b/mysql-test/main/skip_grants.test index eb8d3c3df88..2c4eddda2b2 100644 --- a/mysql-test/main/skip_grants.test +++ b/mysql-test/main/skip_grants.test @@ -164,3 +164,14 @@ drop user baz@baz; --echo # --echo # End of 10.3 tests --echo # + +--echo # +--echo # MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables +--echo # +CREATE DEFINER=a PROCEDURE p() SELECT 1; +CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100; + +DROP PROCEDURE p; +DROP FUNCTION f; + +--echo # End of 10.5 tests diff --git a/mysql-test/main/sp-bugs.result b/mysql-test/main/sp-bugs.result index bd5883f0a04..c1f64a1fa14 100644 --- a/mysql-test/main/sp-bugs.result +++ b/mysql-test/main/sp-bugs.result @@ -388,5 +388,14 @@ ERROR 23000: Column 'c2' in from clause is ambiguous DROP PROCEDURE p2; DROP TABLE t1, t2; # +# MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables +# +# This test is a duplicate of the one located in the file skip_grants.test +# and placed here to check the same test case against embedded-server +CREATE DEFINER=a PROCEDURE p() SELECT 1; +CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100; +DROP PROCEDURE p; +DROP FUNCTION f; +# # End of 10.5 tests # diff --git a/mysql-test/main/sp-bugs.test b/mysql-test/main/sp-bugs.test index f44216fbf46..9a4b867a92b 100644 --- a/mysql-test/main/sp-bugs.test +++ b/mysql-test/main/sp-bugs.test @@ -414,6 +414,26 @@ CALL p2 (@a,@c); DROP PROCEDURE p2; DROP TABLE t1, t2; +--echo # +--echo # MDEV-34501: SIGSEGV in pfs_start_mutex_wait_v1, __strlen_avx2, or __strlen_evex from safe_mutex_lock on CREATE DEFINER when using skip-grant-tables +--echo # +--echo # This test is a duplicate of the one located in the file skip_grants.test +--echo # and placed here to check the same test case against embedded-server + +# Disable warnings before running the following CREATE PROCEDURE/FUNCTION +# statement since the warning message +# "The user specified as a definer ('a'@'%') does not exist" +# is output in case the test be run against a regular server +# and isn't output if embedded server is used (@sa sp_process_definer() +# in sql_parse.cc). +--disable_warnings +CREATE DEFINER=a PROCEDURE p() SELECT 1; +CREATE DEFINER=a FUNCTION f() RETURNS INT RETURN 100; +--enable_warnings + +DROP PROCEDURE p; +DROP FUNCTION f; + --echo # --echo # End of 10.5 tests --echo # diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index a7e9ea7d6f7..385d3da18e2 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -12944,6 +12944,9 @@ LEX_USER *get_current_user(THD *thd, LEX_USER *user, bool lock) if (is_invalid_role_name(user->user.str)) return 0; + if (!initialized) + return dup; + if (lock) mysql_mutex_lock(&acl_cache->lock); if (find_acl_role(dup->user.str)) diff --git a/sql/structs.h b/sql/structs.h index aa50035ac7a..2fbd263c825 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -227,7 +227,7 @@ struct AUTHID LEX_CSTRING user, host; void init() { memset(this, 0, sizeof(*this)); } void copy(MEM_ROOT *root, const LEX_CSTRING *usr, const LEX_CSTRING *host); - bool is_role() const { return user.str[0] && !host.str[0]; } + bool is_role() const { return user.str[0] && (!host.str || !host.str[0]); } void set_lex_string(LEX_CSTRING *l, char *buf) { if (is_role()) From f1deebbb0bcff9bd83c057c3164eefb345619a6f Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Fri, 14 Mar 2025 13:45:09 +0530 Subject: [PATCH 53/65] MDEV-35420 Server aborts while deleting the record in spatial index - This issue caused by commit a032f14b342c782b82dfcd9235805bee446e6fe8(MDEV-33559). In MDEV-33559, matched_rec::block was changed to pointer and assinged with the help of buf_block_alloc(). But patch fails to check for the block can be nullptr in rtr_check_discard_page(). rtr_cur_search_with_match(): Acquire rtr_match_mutex before creating shadow block for the matched records rtr_pcur_move_to_next(): Copy the shadow block to page cursor block under rtr_match_mutex --- mysql-test/suite/innodb_gis/r/rollback.result | 13 ++++++++++ mysql-test/suite/innodb_gis/t/rollback.test | 13 ++++++++++ storage/innobase/gis/gis0sea.cc | 26 +++++++++++++------ 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/innodb_gis/r/rollback.result b/mysql-test/suite/innodb_gis/r/rollback.result index 9e0db79667e..29d4f0884ba 100644 --- a/mysql-test/suite/innodb_gis/r/rollback.result +++ b/mysql-test/suite/innodb_gis/r/rollback.result @@ -412,3 +412,16 @@ update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3; ERROR HY000: Lost connection to MySQL server during query insert into t1 values(5, point(5,5), point(5,5), 5); drop table t1; +# +# MDEV-35420 Server aborts while deleting the record +# in spatial index +# +CREATE TABLE t1 (c POINT NOT NULL, SPATIAL(c)) engine=InnoDB; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR +START TRANSACTION; +INSERT INTO t1 SELECT ST_GeomFromText('POINT(114368751 656950466)') FROM seq_1_to_512; +ROLLBACK; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_gis/t/rollback.test b/mysql-test/suite/innodb_gis/t/rollback.test index a09986692ee..06fe6591a9a 100644 --- a/mysql-test/suite/innodb_gis/t/rollback.test +++ b/mysql-test/suite/innodb_gis/t/rollback.test @@ -8,6 +8,7 @@ # Avoid CrashReporter popup on Mac --source include/not_crashrep.inc --source include/have_innodb_16k.inc +--source include/have_sequence.inc CREATE TABLE t4 (id bigint(12) unsigned NOT NULL auto_increment, c2 varchar(15) collate utf8_bin default NULL, @@ -475,3 +476,15 @@ update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3; insert into t1 values(5, point(5,5), point(5,5), 5); drop table t1; + +--echo # +--echo # MDEV-35420 Server aborts while deleting the record +--echo # in spatial index +--echo # +CREATE TABLE t1 (c POINT NOT NULL, SPATIAL(c)) engine=InnoDB; +CHECK TABLE t1; +SET STATEMENT unique_checks=0,foreign_key_checks=0 FOR +START TRANSACTION; +INSERT INTO t1 SELECT ST_GeomFromText('POINT(114368751 656950466)') FROM seq_1_to_512; +ROLLBACK; +DROP TABLE t1; diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc index b9567ff03c3..66537a1ee11 100644 --- a/storage/innobase/gis/gis0sea.cc +++ b/storage/innobase/gis/gis0sea.cc @@ -495,10 +495,10 @@ rtr_pcur_move_to_next( rtr_rec_t rec; rec = rtr_info->matches->matched_recs->back(); rtr_info->matches->matched_recs->pop_back(); + cursor->btr_cur.page_cur.block = rtr_info->matches->block; mutex_exit(&rtr_info->matches->rtr_match_mutex); cursor->btr_cur.page_cur.rec = rec.r_rec; - cursor->btr_cur.page_cur.block = rtr_info->matches->block; DEBUG_SYNC_C("rtr_pcur_move_to_next_return"); return(true); @@ -1204,8 +1204,11 @@ rtr_check_discard_page( if (rtr_info->matches) { mutex_enter(&rtr_info->matches->rtr_match_mutex); - if (rtr_info->matches->block->page.id().page_no() - == pageno) { + /* matches->block could be nullptr when cursor + encounters empty table */ + if (rtr_info->matches->block + && rtr_info->matches->block->page.id().page_no() + == pageno) { if (!rtr_info->matches->matched_recs->empty()) { rtr_info->matches->matched_recs->clear(); } @@ -1849,6 +1852,15 @@ rtr_cur_search_with_match( ut_ad(orig_mode != PAGE_CUR_RTREE_LOCATE); + /* Collect matched records on page */ + offsets = rec_get_offsets( + rec, index, offsets, + index->n_fields, + ULINT_UNDEFINED, &heap); + + mutex_enter( + &rtr_info->matches->rtr_match_mutex); + if (!match_init) { rtr_init_match( rtr_info->matches, @@ -1856,14 +1868,12 @@ rtr_cur_search_with_match( match_init = true; } - /* Collect matched records on page */ - offsets = rec_get_offsets( - rec, index, offsets, - index->n_fields, - ULINT_UNDEFINED, &heap); rtr_leaf_push_match_rec( rec, rtr_info, offsets, page_is_comp(page)); + + mutex_exit( + &rtr_info->matches->rtr_match_mutex); } last_match_rec = rec; From 05be1865a9c16e34296ea0fa28b9bee921f0b907 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 7 Mar 2025 02:04:01 -0500 Subject: [PATCH 54/65] Fix building with Clang and GCC on RISC-V Clang does not have the builtin __builtin_riscv_pause(). --- include/my_cpu.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/my_cpu.h b/include/my_cpu.h index bd5fca5f21b..2b34e03fce3 100644 --- a/include/my_cpu.h +++ b/include/my_cpu.h @@ -97,7 +97,12 @@ static inline void MY_RELAX_CPU(void) /* Changed from __ppc_get_timebase for musl and clang compatibility */ __builtin_ppc_get_timebase(); #elif defined __GNUC__ && defined __riscv - __builtin_riscv_pause(); + /* The GCC-only __builtin_riscv_pause() or the pause instruction is + encoded like a fence instruction with special parameters. On RISC-V + implementations that do not support arch=+zihintpause this + instruction could be interpreted as a more expensive memory fence; + it should not be an illegal instruction. */ + __asm__ volatile(".long 0x0100000f" ::: "memory"); #elif defined __GNUC__ /* Mainly, prevent the compiler from optimizing away delay loops */ __asm__ __volatile__ ("":::"memory"); From 1277f9b4513a0f4c3303a41e142465dc7e403ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 24 Mar 2025 12:00:30 +0200 Subject: [PATCH 55/65] MDEV-36372: Compilation is broken with the PLUGIN_PARTITION=NO Fixed a compilation error caused by MDEV-27861 that occurs when building with cmake -DPLUGIN_PARTITION=NO, because the default_part_plugin variable is only visible when WITH_PARTITION_STORAGE_ENGINE is defined. Signed-off-by: Julius Goryavsky --- sql/sql_truncate.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index e86325d31a5..863c1bd795e 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -271,7 +271,7 @@ Sql_cmd_truncate_table::handler_truncate(THD *thd, TABLE_LIST *table_ref, bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref, bool *hton_can_recreate) { - handlerton *hton; + const handlerton *hton; bool versioned; bool sequence= false; TABLE *table= NULL; @@ -342,8 +342,12 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref, table we need to find out default partition handlerton. */ - const handlerton *ht= share->default_part_plugin ? - plugin_hton(share->default_part_plugin) : hton; + const handlerton* const ht= +#ifdef WITH_PARTITION_STORAGE_ENGINE + share->default_part_plugin ? + plugin_hton(share->default_part_plugin) : +#endif + hton; if (ht && !wsrep_should_replicate_ddl(thd, ht)) { From 3d54cd6cf56447b9e9783092f51b67352a6b78d8 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 25 Mar 2025 10:13:47 +1100 Subject: [PATCH 56/65] update C/C --- libmariadb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb b/libmariadb index 2d56f340c4a..a7ad25b01bd 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit 2d56f340c4a0f2c636e317a3efd41b8c5f554088 +Subproject commit a7ad25b01bd7716d24181657abd4fb203a883371 From d84ceb586a38992ea846dc419961a1473a7d4f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 25 Mar 2025 12:15:46 +0200 Subject: [PATCH 57/65] MDEV-36378 Recognize innodb_purge_rseg_truncate_frequency In commit bda40ccb854cc1531ec7bd1ab779504c7e00bd87 (MDEV-34803) there was a spelling mistake that somehow causes the deprecated parameter innodb_purge_rseg_truncate_frequency to be rejected at server startup. --- mysql-test/suite/sys_vars/t/sysvars_innodb.opt | 4 +++- mysql-test/suite/sys_vars/t/sysvars_innodb.test | 4 ++++ sql/mysqld.cc | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.opt b/mysql-test/suite/sys_vars/t/sysvars_innodb.opt index c3eec59bc17..19ecb6c65f9 100644 --- a/mysql-test/suite/sys_vars/t/sysvars_innodb.opt +++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.opt @@ -1,2 +1,4 @@ ---loose-innodb-flush-log-at-timeout=3 +--innodb +--innodb-purge-rseg-truncate-frequency=64 +--innodb-flush-log-at-timeout=3 --table_open_cache=200 diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.test b/mysql-test/suite/sys_vars/t/sysvars_innodb.test index 15fd99e9984..83869fb96b3 100644 --- a/mysql-test/suite/sys_vars/t/sysvars_innodb.test +++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.test @@ -3,6 +3,10 @@ --source include/not_valgrind.inc --source include/word_size.inc +--disable_query_log +call mtr.add_suppression("'innodb-purge-rseg-truncate-frequency' was removed"); +--enable_query_log + --vertical_results --replace_regex /^\/\S+/PATH/ /\.\//PATH/ select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT, NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT from information_schema.system_variables diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3d63fc82afd..a3b48bc20d7 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5220,7 +5220,7 @@ static int init_server_components() MARIADB_REMOVED_OPTION("innodb-log-optimize-ddl"), MARIADB_REMOVED_OPTION("innodb-lru-flush-size"), MARIADB_REMOVED_OPTION("innodb-page-cleaners"), - MARIADB_REMOVED_OPTION("innodb-purge-truncate-frequency"), + MARIADB_REMOVED_OPTION("innodb-purge-rseg-truncate-frequency"), MARIADB_REMOVED_OPTION("innodb-replication-delay"), MARIADB_REMOVED_OPTION("innodb-scrub-log"), MARIADB_REMOVED_OPTION("innodb-scrub-log-speed"), From 2469963f052b4dcb11ecfc0fcf5a38881c426df0 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Fri, 14 Mar 2025 11:32:27 +0530 Subject: [PATCH 58/65] MDEV-36270 mariabackup.incremental_compressed fails in 10.11+ - During prepare of incremental backup, mariabackup does create new file in target directory with default file size of 4 * innodb_page_size. While applying .delta file to corresponding data file, it encounters the FSP_SIZE modification on page0 and tries to extend the file to the size which is 4 in our case. Since the table is in compressed row format, page_size for the table is 8k. This lead to shrinking of tablespace file from 65536 to 32768. This issue happens only in windows because os_file_set_size() doesn't check for the current size and shrinks the file. Solution: ======== xtrabackup_apply_delta(): Check for the current size before doing setting size for the file. --- extra/mariabackup/xtrabackup.cc | 13 +++++++++++++ .../suite/mariabackup/incremental_compressed.result | 3 +++ .../suite/mariabackup/incremental_compressed.test | 12 +++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index a59e8f0858f..9b6a8b4c316 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -5508,9 +5508,22 @@ xtrabackup_apply_delta( buf + FSP_HEADER_OFFSET + FSP_SIZE); if (mach_read_from_4(buf + FIL_PAGE_SPACE_ID)) { +#ifdef _WIN32 + os_offset_t last_page = + os_file_get_size(dst_file) / + page_size; + + /* os_file_set_size() would + shrink the size of the file */ + if (last_page < n_pages && + !os_file_set_size( + dst_path, dst_file, + n_pages * page_size)) +#else if (!os_file_set_size( dst_path, dst_file, n_pages * page_size)) +#endif /* _WIN32 */ goto error; } else if (fil_space_t* space = fil_system.sys_space) { diff --git a/mysql-test/suite/mariabackup/incremental_compressed.result b/mysql-test/suite/mariabackup/incremental_compressed.result index f8b01808642..aeb52019aa0 100644 --- a/mysql-test/suite/mariabackup/incremental_compressed.result +++ b/mysql-test/suite/mariabackup/incremental_compressed.result @@ -4,6 +4,9 @@ # CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; ALTER TABLE t PARTITION BY KEY(pk); +# Incremental backup +# Prepare fullbackup +# Prepare incremental backup # shutdown server # remove datadir # xtrabackup move back diff --git a/mysql-test/suite/mariabackup/incremental_compressed.test b/mysql-test/suite/mariabackup/incremental_compressed.test index 15aff909a43..de7f588290f 100644 --- a/mysql-test/suite/mariabackup/incremental_compressed.test +++ b/mysql-test/suite/mariabackup/incremental_compressed.test @@ -16,12 +16,18 @@ CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; ALTER TABLE t PARTITION BY KEY(pk); +--echo # Incremental backup --exec $XTRABACKUP --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --protocol=tcp --port=$MASTER_MYPORT --user=root > $incremental_dir.log 2>&1 +--echo # Prepare fullbackup --exec $XTRABACKUP --prepare --target-dir=$basedir --user=root > $MYSQL_TMP_DIR/backup_prepare_0.log 2>&1 ---exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir --user=root > $MYSQL_TMP_DIR/backup_prepare_1.log ---cat_file $MYSQL_TMP_DIR/backup_prepare_1.log +--echo # Prepare incremental backup +--exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir --user=root > $MYSQL_TMP_DIR/backup_prepare_1.log 2>&1 let $targetdir=$basedir; -- source include/restart_and_restore.inc - SHOW CREATE TABLE t; DROP TABLE t; +remove_file $incremental_dir.log; +remove_file $MYSQL_TMP_DIR/backup_prepare_0.log; +remove_file $MYSQL_TMP_DIR/backup_prepare_1.log; +rmdir $basedir; +rmdir $incremental_dir; From 85ecb80fa3192035b3beff9578dc254a857175dc Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 6 Mar 2025 15:29:17 +1100 Subject: [PATCH 59/65] MDEV-36229: Remove CAP_DAC_OVERRIDE CAP_AUDIT_WRITE from AmbientCapabilities In resolving MDEV-33301 (76a27155b4cd8174e900577dd01df2db1327b120) we moved all the capabilities from CapabilityBoundingSet to AmbientCapabilities where only add/moving CAP_IPC_LOCK was intended. The effect of this is the defaulting running MariaDB HAS the capabiltiy CAP_DAC_OVERRIDE CAP_AUDIT_WRITE allowing it to access any file, even while running as a non-root user. Resolve this by making CAP_IPC_LOCK apply to AmbientCapabilities and leave the remaining CAP_DAC_OVERRIDE CAP_AUDIT_WRITE to CapabilityBoundingSet for the use by auth_pam_tool. --- support-files/mariadb.service.in | 5 ++++- support-files/mariadb@.service.in | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index 27e6ac08184..f53a0b8ceda 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -48,10 +48,13 @@ User=mysql Group=mysql # CAP_IPC_LOCK To allow memlock to be used as non-root user +# These are enabled by default +AmbientCapabilities=CAP_IPC_LOCK + # CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0 # does nothing for non-root, not needed if /etc/shadow is u+r # CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason -AmbientCapabilities=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE +CapabilityBoundingSet=CAP_DAC_OVERRIDE CAP_AUDIT_WRITE # PrivateDevices=true implies NoNewPrivileges=true and # SUID auth_pam_tool suddenly doesn't do setuid anymore diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index b53711ef7e0..cb5e885e1aa 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -178,10 +178,13 @@ PrivateNetwork=false ## # CAP_IPC_LOCK To allow memlock to be used as non-root user +# These are enabled by default +AmbientCapabilities=CAP_IPC_LOCK + # CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0 # does nothing for non-root, not needed if /etc/shadow is u+r # CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason -AmbientCapabilities=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE +CapabilityBoundingSet=CAP_DAC_OVERRIDE CAP_AUDIT_WRITE # PrivateDevices=true implies NoNewPrivileges=true and # SUID auth_pam_tool suddenly doesn't do setuid anymore From 19c4e1abe48bed3eca0f743080b99adf248c6699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 20 Mar 2025 15:20:44 +0200 Subject: [PATCH 60/65] MDEV-24035 fixup: GCC 4.8.5 CMAKE_BUILD_TYPE=Debug --- storage/innobase/trx/trx0trx.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index ade8dea929a..560489cd9d0 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -452,7 +452,7 @@ void trx_t::free() /** Transition to committed state, to release implicit locks. */ TRANSACTIONAL_INLINE inline void trx_t::commit_state() { - ut_d(auto trx_state{state}); + ut_d(auto trx_state= state); ut_ad(trx_state == TRX_STATE_PREPARED || trx_state == TRX_STATE_PREPARED_RECOVERED || trx_state == TRX_STATE_ACTIVE); From a390aaaf23f147f597d059e3f75c5c1ea100fdf1 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 26 Mar 2025 11:15:09 +0530 Subject: [PATCH 61/65] MDEV-36180 Doublewrite recovery of innodb_checksum_algorithm=full_crc32 page_compressed pages does not work - InnoDB fails to recover the full crc32 page_compressed page from doublewrite buffer. The reason is that buf_dblwr_t::recover() fails to identify the space id from the page because the page has compressed from FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION bytes. Fix: === recv_dblwr_t::find_deferred_page(): Find the page which has the same page number and try to decompress/decrypt the page based on the tablespace metadata. After the decompression/decryption, compare the space id and write the recovered page back to the file. buf_page_t::read_complete(): Page read from disk is corrupted then try to read the page from deferred pages in doublewrite buffer. --- .../encryption/r/doublewrite_debug.result | 24 +++++++++++--- .../suite/encryption/t/doublewrite_debug.opt | 2 +- .../suite/encryption/t/doublewrite_debug.test | 28 ++++++++++++++--- storage/innobase/buf/buf0buf.cc | 7 ++--- storage/innobase/buf/buf0dblwr.cc | 15 ++++----- storage/innobase/include/log0recv.h | 12 ++++--- storage/innobase/log/log0recv.cc | 31 ++++++++++++++----- 7 files changed, 85 insertions(+), 34 deletions(-) diff --git a/mysql-test/suite/encryption/r/doublewrite_debug.result b/mysql-test/suite/encryption/r/doublewrite_debug.result index b289df9f77d..da97fd92360 100644 --- a/mysql-test/suite/encryption/r/doublewrite_debug.result +++ b/mysql-test/suite/encryption/r/doublewrite_debug.result @@ -3,8 +3,9 @@ call mtr.add_suppression("InnoDB: Unable to apply log to corrupted page "); call mtr.add_suppression("InnoDB: Plugin initialization aborted"); call mtr.add_suppression("Plugin 'InnoDB' init function returned error"); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed"); -create table t1 (f1 int primary key, f2 blob)page_compressed = 1 engine=innodb stats_persistent=0; -create table t2(f1 int primary key, f2 blob)engine=innodb stats_persistent=0; +create table t1 (f1 int primary key, f2 blob)page_compressed=1 engine=innodb encrypted=yes stats_persistent=0; +create table t2(f1 int primary key, f2 blob)engine=innodb encrypted=yes stats_persistent=0; +create table t3(f1 int primary key, f2 blob)page_compressed=1 engine=innodb encrypted=no stats_persistent=0; start transaction; insert into t1 values(1, repeat('#',12)); insert into t1 values(2, repeat('+',12)); @@ -12,29 +13,37 @@ insert into t1 values(3, repeat('/',12)); insert into t1 values(4, repeat('-',12)); insert into t1 values(5, repeat('.',12)); insert into t2 select * from t1; +insert into t3 select * from t1; commit work; SET GLOBAL innodb_fast_shutdown = 0; # restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0 select space into @t1_space_id from information_schema.innodb_sys_tablespaces where name='test/t1'; select space into @t2_space_id from information_schema.innodb_sys_tablespaces where name='test/t2'; +select space into @t3_space_id from information_schema.innodb_sys_tablespaces where name='test/t3'; begin; insert into t1 values (6, repeat('%', 400)); insert into t2 values (6, repeat('%', 400)); +insert into t3 values (6, repeat('%', 400)); # xtrabackup prepare set global innodb_saved_page_number_debug = 3; set global innodb_fil_make_page_dirty_debug = @t1_space_id; set global innodb_saved_page_number_debug = 3; set global innodb_fil_make_page_dirty_debug = @t2_space_id; +set global innodb_saved_page_number_debug = 3; +set global innodb_fil_make_page_dirty_debug = @t3_space_id; set global innodb_buf_flush_list_now = 1; # Kill the server # restart -FOUND 2 /InnoDB: Recovered page \[page id: space=[1-9]*, page number=3\]/ in mysqld.1.err +FOUND 3 /InnoDB: Recovered page \[page id: space=[1-9]*, page number=3\]/ in mysqld.1.err check table t1; Table Op Msg_type Msg_text test.t1 check status OK check table t2; Table Op Msg_type Msg_text test.t2 check status OK +check table t3; +Table Op Msg_type Msg_text +test.t3 check status OK select f1, f2 from t1; f1 f2 1 ############ @@ -49,6 +58,13 @@ f1 f2 3 //////////// 4 ------------ 5 ............ +select f1, f2 from t3; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ SET GLOBAL innodb_fast_shutdown = 0; # shutdown server # remove datadir @@ -78,4 +94,4 @@ f1 f2 3 //////////// 4 ------------ 5 ............ -drop table t2, t1; +drop table t3, t2, t1; diff --git a/mysql-test/suite/encryption/t/doublewrite_debug.opt b/mysql-test/suite/encryption/t/doublewrite_debug.opt index ed86654270b..827b043547b 100644 --- a/mysql-test/suite/encryption/t/doublewrite_debug.opt +++ b/mysql-test/suite/encryption/t/doublewrite_debug.opt @@ -1,3 +1,3 @@ --innodb-use-atomic-writes=0 ---innodb-encrypt-tables=FORCE +--innodb-encrypt-tables=on --innodb_sys_tablespaces diff --git a/mysql-test/suite/encryption/t/doublewrite_debug.test b/mysql-test/suite/encryption/t/doublewrite_debug.test index 761f9cd3e47..6ca29161d56 100644 --- a/mysql-test/suite/encryption/t/doublewrite_debug.test +++ b/mysql-test/suite/encryption/t/doublewrite_debug.test @@ -12,8 +12,9 @@ let INNODB_PAGE_SIZE=`select @@innodb_page_size`; let MYSQLD_DATADIR=`select @@datadir`; let ALGO=`select @@innodb_checksum_algorithm`; -create table t1 (f1 int primary key, f2 blob)page_compressed = 1 engine=innodb stats_persistent=0; -create table t2(f1 int primary key, f2 blob)engine=innodb stats_persistent=0; +create table t1 (f1 int primary key, f2 blob)page_compressed=1 engine=innodb encrypted=yes stats_persistent=0; +create table t2(f1 int primary key, f2 blob)engine=innodb encrypted=yes stats_persistent=0; +create table t3(f1 int primary key, f2 blob)page_compressed=1 engine=innodb encrypted=no stats_persistent=0; start transaction; insert into t1 values(1, repeat('#',12)); @@ -22,6 +23,7 @@ insert into t1 values(3, repeat('/',12)); insert into t1 values(4, repeat('-',12)); insert into t1 values(5, repeat('.',12)); insert into t2 select * from t1; +insert into t3 select * from t1; commit work; # Slow shutdown and restart to make sure ibuf merge is finished @@ -33,12 +35,14 @@ let $restart_parameters=--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_fl select space into @t1_space_id from information_schema.innodb_sys_tablespaces where name='test/t1'; select space into @t2_space_id from information_schema.innodb_sys_tablespaces where name='test/t2'; +select space into @t3_space_id from information_schema.innodb_sys_tablespaces where name='test/t3'; begin; insert into t1 values (6, repeat('%', 400)); insert into t2 values (6, repeat('%', 400)); +insert into t3 values (6, repeat('%', 400)); -# Copy the t1.ibd, t2.ibd file +# Copy the t1.ibd, t2.ibd, t3.ibd file let $targetdir=$MYSQLTEST_VARDIR/tmp/backup_1; --disable_result_log exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; @@ -54,8 +58,11 @@ set global innodb_fil_make_page_dirty_debug = @t1_space_id; set global innodb_saved_page_number_debug = 3; set global innodb_fil_make_page_dirty_debug = @t2_space_id; +set global innodb_saved_page_number_debug = 3; +set global innodb_fil_make_page_dirty_debug = @t3_space_id; + set global innodb_buf_flush_list_now = 1; ---let CLEANUP_IF_CHECKPOINT=drop table t1, t2, unexpected_checkpoint; +--let CLEANUP_IF_CHECKPOINT=drop table t1, t2, t3, unexpected_checkpoint; --source ../../suite/innodb/include/no_checkpoint_end.inc # Corrupt the page 3 in t1.ibd, t2.ibd file perl; @@ -103,6 +110,15 @@ binmode FILE; sysseek(FILE, 3*$page_size, 0); print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); close FILE; + +# Zero the complete page +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t3.ibd"; +open(FILE, "+<", $fname) or die; +FILE->autoflush(1); +binmode FILE; +sysseek(FILE, 3*$page_size, 0); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; EOF # Successful recover from doublewrite buffer @@ -114,8 +130,10 @@ let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=[1-9]*, page number= check table t1; check table t2; +check table t3; select f1, f2 from t1; select f1, f2 from t2; +select f1, f2 from t3; SET GLOBAL innodb_fast_shutdown = 0; let $shutdown_timeout=; @@ -220,4 +238,4 @@ select * from t1; --source ../../mariabackup/include/restart_and_restore.inc select * from t1; -drop table t2, t1; +drop table t3, t2, t1; diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index f9388a11d23..2ea1909036d 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -3766,10 +3766,9 @@ database_corrupted_compressed: if (err == DB_PAGE_CORRUPTED || err == DB_DECRYPTION_FAILED) { release_page: - if (node.space->full_crc32() && node.space->crypt_data && - recv_recovery_is_on() && - recv_sys.dblwr.find_encrypted_page(node, id().page_no(), - const_cast(read_frame))) + if (node.space->full_crc32() && recv_recovery_is_on() && + recv_sys.dblwr.find_deferred_page(node, id().page_no(), + const_cast(read_frame))) { /* Recover from doublewrite buffer */ err= DB_SUCCESS; diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 9165f8e4a02..b04460a020f 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -377,7 +377,7 @@ void buf_dblwr_t::recover() noexcept srv_page_size)); byte *const buf= read_buf + srv_page_size; - std::deque encrypted_pages; + std::deque deferred_pages; for (recv_dblwr_t::list::iterator i= recv_sys.dblwr.pages.begin(); i != recv_sys.dblwr.pages.end(); ++i, ++page_no_dblwr) { @@ -396,11 +396,12 @@ void buf_dblwr_t::recover() noexcept { /* These pages does not appear to belong to any tablespace. There is a possibility that this page could be - encrypted using full_crc32 format. If innodb encounters - any corrupted encrypted page during recovery then - InnoDB should use this page to find the valid page. - See find_encrypted_page() */ - encrypted_pages.push_back(*i); + encrypted/compressed using full_crc32 format. + If innodb encounters any corrupted encrypted/compressed + page during recovery then InnoDB should use this page to + find the valid page. + See find_encrypted_page()/find_page_compressed() */ + deferred_pages.push_back(*i); continue; } @@ -481,7 +482,7 @@ next_page: } recv_sys.dblwr.pages.clear(); - for (byte *page : encrypted_pages) + for (byte *page : deferred_pages) recv_sys.dblwr.pages.push_back(page); fil_flush_file_spaces(); aligned_free(read_buf); diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index f58543d7683..a4365706d5b 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -150,15 +150,17 @@ struct recv_dblwr_t const fil_space_t *space= nullptr, byte *tmp_buf= nullptr) const noexcept; - /** Find the doublewrite copy of an encrypted page with the - smallest FIL_PAGE_LSN that is large enough for recovery. + /** Find the doublewrite copy of an encrypted/page_compressed + page with the smallest FIL_PAGE_LSN that is large enough for + recovery. @param space tablespace object @param page_no page number to find - @param buf buffer for unencrypted page + @param buf buffer for unencrypted/uncompressed page @return buf @retval nullptr if the page was not found in doublewrite buffer */ - byte *find_encrypted_page(const fil_node_t &space, uint32_t page_no, - byte *buf) noexcept; + ATTRIBUTE_COLD byte *find_deferred_page(const fil_node_t &space, + uint32_t page_no, + byte *buf) noexcept; /** Restore the first page of the given tablespace from doublewrite buffer. diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 96c964e6de7..9a71521d707 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -4842,28 +4842,43 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id, lsn_t max_lsn, goto check_if_corrupted; } -byte *recv_dblwr_t::find_encrypted_page(const fil_node_t &node, - uint32_t page_no, - byte *buf) noexcept +ATTRIBUTE_COLD +byte *recv_dblwr_t::find_deferred_page(const fil_node_t &node, + uint32_t page_no, + byte *buf) noexcept { - ut_ad(node.space->crypt_data); ut_ad(node.space->full_crc32()); mysql_mutex_lock(&recv_sys.mutex); byte *result_page= nullptr; + bool is_encrypted= node.space->crypt_data && + node.space->crypt_data->is_encrypted(); for (list::iterator page_it= pages.begin(); page_it != pages.end(); page_it++) { if (page_get_page_no(*page_it) != page_no || buf_page_is_corrupted(true, *page_it, node.space->flags)) continue; + + if (is_encrypted && + !mach_read_from_4(*page_it + FIL_PAGE_FCRC32_KEY_VERSION)) + continue; + memcpy(buf, *page_it, node.space->physical_size()); buf_tmp_buffer_t *slot= buf_pool.io_buf_reserve(false); ut_a(slot); slot->allocate(); - bool invalidate= - !fil_space_decrypt(node.space, slot->crypt_buf, buf) || - (node.space->is_compressed() && - !fil_page_decompress(slot->crypt_buf, buf, node.space->flags)); + + bool invalidate= false; + if (is_encrypted) + { + invalidate= !fil_space_decrypt(node.space, slot->crypt_buf, buf); + if (!invalidate && node.space->is_compressed()) + goto decompress; + } + else +decompress: + invalidate= !fil_page_decompress(slot->crypt_buf, buf, + node.space->flags); slot->release(); if (invalidate || From 1f4a90157639bdb73e023997e46b701b3b9bd835 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Tue, 25 Mar 2025 20:03:14 +0530 Subject: [PATCH 62/65] MDEV-36281 DML aborts during online virtual index Reason: ======= - InnoDB DML commit aborts the server when InnoDB does online virtual index. During online DDL, concurrent DML commit operation does read the undo log record and their related current version of the clustered index record. Based on the operation, InnoDB do build the old tuple and new tuple for the table. If the concurrent online index can be affected by the operation, InnoDB does build the entry for the index and log the operation. Problematic case is update operation, InnoDB does build the update vector. But while building the old row, InnoDB fails to fill the non-affected virtual column. This lead to server abort while build the entry for index. Fix: === - First, fill the virtual column entries for the new row. Duplicate the old row based on new row and change only the affected fields in old row based on the update vector. --- .../suite/innodb/r/innodb-index-online.result | 26 ++++++++++++++++++- .../suite/innodb/t/innodb-index-online.test | 25 +++++++++++++++++- storage/innobase/row/row0log.cc | 15 +++++------ 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-index-online.result b/mysql-test/suite/innodb/r/innodb-index-online.result index 5a287e58d8a..eb1daa5a2d3 100644 --- a/mysql-test/suite/innodb/r/innodb-index-online.result +++ b/mysql-test/suite/innodb/r/innodb-index-online.result @@ -534,7 +534,6 @@ INSERT INTO t1 VALUES(1,1); ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL inserted'; connection con1; -disconnect con1; connection default; SELECT * FROM t1; a b @@ -543,6 +542,31 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +# +# MDEV-36281 DML aborts during online virtual index +# +CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY, f2 INT NOT NULL, +f3 INT NOT NULL, f4 INT AS (f3) VIRTUAL, +f5 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB; +INSERT INTO t1(f1, f2, f3) VALUES(1, 2, 3); +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL dml_start WAIT_FOR dml_finish'; +ALTER TABLE t1 ADD INDEX v1(f5, f2, f4), ADD INDEX v2(f3, f5); +connection con1; +set DEBUG_SYNC="now WAIT_FOR dml_start"; +UPDATE t1 SET f3= f3 + 1; +set DEBUG_SYNC="now SIGNAL dml_finish"; +disconnect con1; +connection default; +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT f5, f2, f4 FROM t1 USE INDEX(v1); +f5 f2 f4 +1 2 4 +SELECT f3, f5 FROM t1 USE INDEX(v2); +f3 f5 +4 1 +DROP TABLE t1; SET DEBUG_SYNC = 'RESET'; SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig; SET GLOBAL innodb_monitor_enable = default; diff --git a/mysql-test/suite/innodb/t/innodb-index-online.test b/mysql-test/suite/innodb/t/innodb-index-online.test index 96ee3149518..97ca25b1420 100644 --- a/mysql-test/suite/innodb/t/innodb-index-online.test +++ b/mysql-test/suite/innodb/t/innodb-index-online.test @@ -510,12 +510,35 @@ SET DEBUG_SYNC = 'now SIGNAL inserted'; connection con1; reap; -disconnect con1; connection default; SELECT * FROM t1; CHECK TABLE t1; DROP TABLE t1; + +--echo # +--echo # MDEV-36281 DML aborts during online virtual index +--echo # +CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY, f2 INT NOT NULL, + f3 INT NOT NULL, f4 INT AS (f3) VIRTUAL, + f5 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB; +INSERT INTO t1(f1, f2, f3) VALUES(1, 2, 3); +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL dml_start WAIT_FOR dml_finish'; +send ALTER TABLE t1 ADD INDEX v1(f5, f2, f4), ADD INDEX v2(f3, f5); + +connection con1; +set DEBUG_SYNC="now WAIT_FOR dml_start"; +UPDATE t1 SET f3= f3 + 1; +set DEBUG_SYNC="now SIGNAL dml_finish"; + +disconnect con1; +connection default; +reap; +CHECK TABLE t1 EXTENDED; +SELECT f5, f2, f4 FROM t1 USE INDEX(v1); +SELECT f3, f5 FROM t1 USE INDEX(v2); +DROP TABLE t1; + SET DEBUG_SYNC = 'RESET'; # Check that all connections opened by test cases in this file are really diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 6f3425aab17..702e7098839 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -4065,14 +4065,7 @@ void UndorecApplier::log_update(const dtuple_t &tuple, if (!(this->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) { for (ulint i = 0; i < dict_table_get_n_v_cols(table); i++) - dfield_get_type( - dtuple_get_nth_v_field(row, i))->mtype = DATA_MISSING; - } - - if (is_update) - { - old_row= dtuple_copy(row, heap); - row_upd_replace(old_row, &old_ext, clust_index, update, heap); + dfield_get_type(dtuple_get_nth_v_field(row, i))->mtype = DATA_MISSING; } if (table->n_v_cols) @@ -4080,6 +4073,12 @@ void UndorecApplier::log_update(const dtuple_t &tuple, (cmpl_info & UPD_NODE_NO_ORD_CHANGE) ? nullptr : undo_rec); + if (is_update) + { + old_row= dtuple_copy(row, heap); + row_upd_replace(old_row, &old_ext, clust_index, update, heap); + } + bool success= true; dict_index_t *index= dict_table_get_next_index(clust_index); while (index) From 337bf8ac4bb9a89f51cd35ec867c74fbb8d23faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Mar 2025 14:22:40 +0200 Subject: [PATCH 63/65] MDEV-36122 Assertion ctx0->old_table->get_ref_count() == 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit trx_purge_close_tables(): Before releasing any metadata locks (MDL), release all table references, in case an ALTER TABLE…ALGORITHM=COPY operation has confused our logic. trx_purge_table_acquire(), trx_purge_table_open(): Do not acquire any table reference before successfully acquiring a necessary metadata lock. In this way, if purge is waiting for MDL, a concurrent ha_innobase::commit_inplace_alter_table(commit=true) that is holding a conflicting MDL_EXCLUSIVE will only observe its own reference on the table that it may need to replace. dict_acquire_mdl_shared(): Unless we hold an MDL or one is not needed, do not hold a table reference when releasing dict_sys.latch. After loading a table into the dictionary cache, we will look up the table again, because the table could be evicted or dropped while we were not holding any dict_sys.latch. Reviewed by: Debarun Banerjee --- storage/innobase/dict/dict0dict.cc | 80 +++++++++++++++++------------- storage/innobase/trx/trx0purge.cc | 70 ++++++++++++++------------ 2 files changed, 84 insertions(+), 66 deletions(-) diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index dd0b4c714bf..328d2b9be84 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -694,35 +694,37 @@ dict_acquire_mdl_shared(dict_table_t *table, MDL_context *mdl_context, MDL_ticket **mdl, dict_table_op_t table_op) { - table_id_t table_id= table->id; char db_buf[NAME_LEN + 1], db_buf1[NAME_LEN + 1]; char tbl_buf[NAME_LEN + 1], tbl_buf1[NAME_LEN + 1]; size_t db_len, tbl_len; - bool unaccessible= false; if (!table->parse_name(db_buf, tbl_buf, &db_len, &tbl_len)) /* The name of an intermediate table starts with #sql */ return table; retry: - if (!unaccessible && (!table->is_readable() || table->corrupted)) + ut_ad(!trylock == dict_sys.frozen()); + ut_ad(trylock || table->get_ref_count()); + + if (!table->is_readable() || table->corrupted) { + if (!trylock) + table->release(); if (*mdl) { mdl_context->release_lock(*mdl); *mdl= nullptr; } - unaccessible= true; + return nullptr; } + const table_id_t table_id{table->id}; + if (!trylock) + { table->release(); - - if (unaccessible) - return nullptr; - - if (!trylock) dict_sys.unfreeze(); + } { MDL_request request; @@ -748,11 +750,37 @@ retry: } } + size_t db1_len, tbl1_len; +lookup: dict_sys.freeze(SRW_LOCK_CALL); table= dict_sys.find_table(table_id); if (table) + { + if (!table->is_accessible()) + { + table= nullptr; + unlock_and_return_without_mdl: + if (trylock) + dict_sys.unfreeze(); + return_without_mdl: + if (*mdl) + { + mdl_context->release_lock(*mdl); + *mdl= nullptr; + } + return table; + } + table->acquire(); - if (!table && table_op != DICT_TABLE_OP_OPEN_ONLY_IF_CACHED) + + if (!table->parse_name(db_buf1, tbl_buf1, &db1_len, &tbl1_len)) + { + /* The table was renamed to #sql prefix. + Release MDL (if any) for the old name and return. */ + goto unlock_and_return_without_mdl; + } + } + else if (table_op != DICT_TABLE_OP_OPEN_ONLY_IF_CACHED) { dict_sys.unfreeze(); dict_sys.lock(SRW_LOCK_CALL); @@ -760,31 +788,15 @@ retry: table_op == DICT_TABLE_OP_LOAD_TABLESPACE ? DICT_ERR_IGNORE_RECOVER_LOCK : DICT_ERR_IGNORE_FK_NOKEY); - if (table) - table->acquire(); dict_sys.unlock(); - dict_sys.freeze(SRW_LOCK_CALL); - } - - if (!table || !table->is_accessible()) - { -return_without_mdl: - if (trylock) - dict_sys.unfreeze(); - if (*mdl) - { - mdl_context->release_lock(*mdl); - *mdl= nullptr; - } - return nullptr; - } - - size_t db1_len, tbl1_len; - - if (!table->parse_name(db_buf1, tbl_buf1, &db1_len, &tbl1_len)) - { - /* The table was renamed to #sql prefix. - Release MDL (if any) for the old name and return. */ + /* At this point, the freshly loaded table may already have been evicted. + We must look it up again while holding a shared dict_sys.latch. We keep + trying this until the table is found in the cache or it cannot be found + in the dictionary (because the table has been dropped or rebuilt). */ + if (table) + goto lookup; + if (!trylock) + dict_sys.freeze(SRW_LOCK_CALL); goto return_without_mdl; } diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 08134665fb7..ef85dd7dbda 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1051,16 +1051,25 @@ inline trx_purge_rec_t purge_sys_t::fetch_next_rec() /** Close all tables that were opened in a purge batch for a worker. @param node purge task context @param thd purge coordinator thread handle */ -static void trx_purge_close_tables(purge_node_t *node, THD *thd) +static void trx_purge_close_tables(purge_node_t *node, THD *thd) noexcept { for (auto &t : node->tables) { - if (!t.second.first); - else if (t.second.first == reinterpret_cast(-1)); - else + dict_table_t *table= t.second.first; + if (table != nullptr && table != reinterpret_cast(-1)) + dict_table_close(table); + } + + MDL_context *mdl_context= static_cast(thd_mdl_context(thd)); + + for (auto &t : node->tables) + { + dict_table_t *table= t.second.first; + if (table != nullptr && table != reinterpret_cast(-1)) { - dict_table_close(t.second.first, false, thd, t.second.second); t.second.first= reinterpret_cast(-1); + if (mdl_context != nullptr && t.second.second != nullptr) + mdl_context->release_lock(t.second.second); } } } @@ -1072,36 +1081,35 @@ void purge_sys_t::wait_FTS(bool also_sys) } __attribute__((nonnull)) -/** Aqcuire a metadata lock on a table. +/** Acquire a metadata lock on a table. @param table table handle @param mdl_context metadata lock acquisition context -@param mdl metadata lcok +@param mdl metadata lock @return table handle @retval nullptr if the table is not found or accessible @retval -1 if the purge of history must be suspended due to DDL */ static dict_table_t *trx_purge_table_acquire(dict_table_t *table, MDL_context *mdl_context, - MDL_ticket **mdl) + MDL_ticket **mdl) noexcept { ut_ad(dict_sys.frozen_not_locked()); *mdl= nullptr; if (!table->is_readable() || table->corrupted) - { - table->release(); return nullptr; - } size_t db_len= dict_get_db_name_len(table->name.m_name); if (db_len == 0) - return table; /* InnoDB system tables are not covered by MDL */ + { + /* InnoDB system tables are not covered by MDL */ + got_table: + table->acquire(); + return table; + } if (purge_sys.must_wait_FTS()) - { must_wait: - table->release(); return reinterpret_cast(-1); - } char db_buf[NAME_LEN + 1]; char tbl_buf[NAME_LEN + 1]; @@ -1109,7 +1117,7 @@ static dict_table_t *trx_purge_table_acquire(dict_table_t *table, if (!table->parse_name(db_buf, tbl_buf, &db_len, &tbl_len)) /* The name of an intermediate table starts with #sql */ - return table; + goto got_table; { MDL_request request; @@ -1122,37 +1130,38 @@ static dict_table_t *trx_purge_table_acquire(dict_table_t *table, goto must_wait; } - return table; + goto got_table; } /** Open a table handle for the purge of committed transaction history @param table_id InnoDB table identifier @param mdl_context metadata lock acquisition context -@param mdl metadata lcok +@param mdl metadata lock @return table handle @retval nullptr if the table is not found or accessible @retval -1 if the purge of history must be suspended due to DDL */ static dict_table_t *trx_purge_table_open(table_id_t table_id, MDL_context *mdl_context, - MDL_ticket **mdl) + MDL_ticket **mdl) noexcept { - dict_sys.freeze(SRW_LOCK_CALL); + dict_table_t *table; - dict_table_t *table= dict_sys.find_table(table_id); - - if (table) - table->acquire(); - else + for (;;) { + dict_sys.freeze(SRW_LOCK_CALL); + table= dict_sys.find_table(table_id); + if (table) + break; dict_sys.unfreeze(); dict_sys.lock(SRW_LOCK_CALL); table= dict_load_table_on_id(table_id, DICT_ERR_IGNORE_FK_NOKEY); - if (table) - table->acquire(); dict_sys.unlock(); if (!table) return nullptr; - dict_sys.freeze(SRW_LOCK_CALL); + /* At this point, the freshly loaded table may already have been evicted. + We must look it up again while holding a shared dict_sys.latch. We keep + trying this until the table is found in the cache or it cannot be found + in the dictionary (because the table has been dropped or rebuilt). */ } table= trx_purge_table_acquire(table, mdl_context, mdl); @@ -1171,10 +1180,7 @@ dict_table_t *purge_sys_t::close_and_reopen(table_id_t id, THD *thd, for (que_thr_t *thr= UT_LIST_GET_FIRST(purge_sys.query->thrs); thr; thr= UT_LIST_GET_NEXT(thrs, thr)) - { - purge_node_t *node= static_cast(thr->child); - trx_purge_close_tables(node, thd); - } + trx_purge_close_tables(static_cast(thr->child), thd); m_active= false; wait_FTS(false); From 67caeca2849384b4e77f8741c6461a5162e3b7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Mar 2025 14:22:58 +0200 Subject: [PATCH 64/65] MDEV-36122: Protect table references with a lock dict_table_open_on_id(): Simplify the logic. dict_stats: A helper for acquiring MDL and opening the tables mysql.innodb_table_stats and mysql.innodb_index_stats. innodb_ft_aux_table_validate(): Contiguously hold dict_sys.latch while accessing the table that we open with dict_table_open_on_name(). lock_table_children(): Do not hold a table reference while invoking dict_acquire_mdl_shared(), which may temporarily release and reacquire the shared dict_sys.latch that we are holding. With these changes, no caller of dict_acquire_mdl_shared should be holding a table reference. All remaining calls to dict_table_open_on_name(dict_locked=false) except the one in fts_lock_table() and possibly in the DDL recovery predicate innodb_check_version() should be protected by MDL, but there currently is no assertion that would enforce this. Reviewed by: Debarun Banerjee --- storage/innobase/dict/dict0defrag_bg.cc | 90 ++-------- storage/innobase/dict/dict0dict.cc | 93 +++++++--- storage/innobase/dict/dict0stats.cc | 98 ++--------- storage/innobase/handler/ha_innodb.cc | 202 ++++++---------------- storage/innobase/handler/handler0alter.cc | 69 +++----- storage/innobase/include/dict0dict.h | 21 +++ storage/innobase/lock/lock0lock.cc | 5 +- 7 files changed, 192 insertions(+), 386 deletions(-) diff --git a/storage/innobase/dict/dict0defrag_bg.cc b/storage/innobase/dict/dict0defrag_bg.cc index bec6da8e6af..7771335b6d2 100644 --- a/storage/innobase/dict/dict0defrag_bg.cc +++ b/storage/innobase/dict/dict0defrag_bg.cc @@ -217,47 +217,17 @@ dberr_t dict_stats_save_defrag_summary(dict_index_t *index, THD *thd) if (index->is_ibuf()) return DB_SUCCESS; - MDL_ticket *mdl_table= nullptr, *mdl_index= nullptr; - dict_table_t *table_stats= dict_table_open_on_name(TABLE_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (table_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats= dict_acquire_mdl_shared(table_stats, thd, &mdl_table); - dict_sys.unfreeze(); - } - if (!table_stats || strcmp(table_stats->name.m_name, TABLE_STATS_NAME)) - { -release_and_exit: - if (table_stats) - dict_table_close(table_stats, false, thd, mdl_table); + dict_stats stats; + if (stats.open(thd)) return DB_STATS_DO_NOT_EXIST; - } - - dict_table_t *index_stats= dict_table_open_on_name(INDEX_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (index_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats= dict_acquire_mdl_shared(index_stats, thd, &mdl_index); - dict_sys.unfreeze(); - } - if (!index_stats) - goto release_and_exit; - if (strcmp(index_stats->name.m_name, INDEX_STATS_NAME)) - { - dict_table_close(index_stats, false, thd, mdl_index); - goto release_and_exit; - } - trx_t *trx= trx_create(); trx->mysql_thd= thd; trx_start_internal(trx); dberr_t ret= trx->read_only ? DB_READ_ONLY - : lock_table_for_trx(table_stats, trx, LOCK_X); + : lock_table_for_trx(stats.table(), trx, LOCK_X); if (ret == DB_SUCCESS) - ret= lock_table_for_trx(index_stats, trx, LOCK_X); + ret= lock_table_for_trx(stats.index(), trx, LOCK_X); row_mysql_lock_data_dictionary(trx); if (ret == DB_SUCCESS) ret= dict_stats_save_index_stat(index, time(nullptr), "n_pages_freed", @@ -271,13 +241,9 @@ release_and_exit: else trx->rollback(); - if (table_stats) - dict_table_close(table_stats, true, thd, mdl_table); - if (index_stats) - dict_table_close(index_stats, true, thd, mdl_index); - row_mysql_unlock_data_dictionary(trx); trx->free(); + stats.close(); return ret; } @@ -353,49 +319,18 @@ dict_stats_save_defrag_stats( if (n_leaf_reserved == ULINT_UNDEFINED) return DB_SUCCESS; - THD *thd= current_thd; - MDL_ticket *mdl_table= nullptr, *mdl_index= nullptr; - dict_table_t* table_stats= dict_table_open_on_name(TABLE_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (table_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats= dict_acquire_mdl_shared(table_stats, thd, &mdl_table); - dict_sys.unfreeze(); - } - if (!table_stats || strcmp(table_stats->name.m_name, TABLE_STATS_NAME)) - { -release_and_exit: - if (table_stats) - dict_table_close(table_stats, false, thd, mdl_table); + THD *const thd= current_thd; + dict_stats stats; + if (stats.open(thd)) return DB_STATS_DO_NOT_EXIST; - } - - dict_table_t *index_stats= dict_table_open_on_name(INDEX_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (index_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats= dict_acquire_mdl_shared(index_stats, thd, &mdl_index); - dict_sys.unfreeze(); - } - if (!index_stats) - goto release_and_exit; - - if (strcmp(index_stats->name.m_name, INDEX_STATS_NAME)) - { - dict_table_close(index_stats, false, thd, mdl_index); - goto release_and_exit; - } - trx_t *trx= trx_create(); trx->mysql_thd= thd; trx_start_internal(trx); dberr_t ret= trx->read_only ? DB_READ_ONLY - : lock_table_for_trx(table_stats, trx, LOCK_X); + : lock_table_for_trx(stats.table(), trx, LOCK_X); if (ret == DB_SUCCESS) - ret= lock_table_for_trx(index_stats, trx, LOCK_X); + ret= lock_table_for_trx(stats.index(), trx, LOCK_X); row_mysql_lock_data_dictionary(trx); @@ -423,12 +358,9 @@ release_and_exit: else trx->rollback(); - if (table_stats) - dict_table_close(table_stats, true, thd, mdl_table); - if (index_stats) - dict_table_close(index_stats, true, thd, mdl_index); row_mysql_unlock_data_dictionary(trx); trx->free(); + stats.close(); return ret; } diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 328d2b9be84..a08b8812e6d 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -704,12 +704,9 @@ dict_acquire_mdl_shared(dict_table_t *table, retry: ut_ad(!trylock == dict_sys.frozen()); - ut_ad(trylock || table->get_ref_count()); if (!table->is_readable() || table->corrupted) { - if (!trylock) - table->release(); if (*mdl) { mdl_context->release_lock(*mdl); @@ -721,10 +718,7 @@ retry: const table_id_t table_id{table->id}; if (!trylock) - { - table->release(); dict_sys.unfreeze(); - } { MDL_request request; @@ -771,7 +765,8 @@ lookup: return table; } - table->acquire(); + if (trylock) + table->acquire(); if (!table->parse_name(db_buf1, tbl_buf1, &db1_len, &tbl1_len)) { @@ -885,6 +880,7 @@ dict_table_t *dict_table_open_on_id(table_id_t table_id, bool dict_locked, dict_table_op_t table_op, THD *thd, MDL_ticket **mdl) { +retry: if (!dict_locked) dict_sys.freeze(SRW_LOCK_CALL); @@ -892,9 +888,21 @@ dict_table_t *dict_table_open_on_id(table_id_t table_id, bool dict_locked, if (table) { - table->acquire(); - if (thd && !dict_locked) - table= dict_acquire_mdl_shared(table, thd, mdl, table_op); + if (!dict_locked) + { + if (thd) + { + table= dict_acquire_mdl_shared(table, thd, mdl, table_op); + if (table) + goto acquire; + } + else + acquire: + table->acquire(); + dict_sys.unfreeze(); + } + else + table->acquire(); } else if (table_op != DICT_TABLE_OP_OPEN_ONLY_IF_CACHED) { @@ -907,24 +915,16 @@ dict_table_t *dict_table_open_on_id(table_id_t table_id, bool dict_locked, table_op == DICT_TABLE_OP_LOAD_TABLESPACE ? DICT_ERR_IGNORE_RECOVER_LOCK : DICT_ERR_IGNORE_FK_NOKEY); - if (table) - table->acquire(); if (!dict_locked) { dict_sys.unlock(); - if (table && thd) - { - dict_sys.freeze(SRW_LOCK_CALL); - table= dict_acquire_mdl_shared(table, thd, mdl, table_op); - dict_sys.unfreeze(); - } - return table; + if (table) + goto retry; } + else if (table) + table->acquire(); } - if (!dict_locked) - dict_sys.unfreeze(); - return table; } @@ -1119,6 +1119,55 @@ dict_table_open_on_name( DBUG_RETURN(table); } +bool dict_stats::open(THD *thd) noexcept +{ + ut_ad(!mdl_table); + ut_ad(!mdl_index); + ut_ad(!table_stats); + ut_ad(!index_stats); + ut_ad(!mdl_context); + + mdl_context= static_cast(thd_mdl_context(thd)); + if (!mdl_context) + return true; + /* FIXME: use compatible type, and maybe remove this parameter altogether! */ + const double timeout= double(global_system_variables.lock_wait_timeout); + MDL_request request; + MDL_REQUEST_INIT(&request, MDL_key::TABLE, "mysql", "innodb_table_stats", + MDL_SHARED, MDL_EXPLICIT); + if (UNIV_UNLIKELY(mdl_context->acquire_lock(&request, timeout))) + return true; + mdl_table= request.ticket; + MDL_REQUEST_INIT(&request, MDL_key::TABLE, "mysql", "innodb_index_stats", + MDL_SHARED, MDL_EXPLICIT); + if (UNIV_UNLIKELY(mdl_context->acquire_lock(&request, timeout))) + goto release_mdl; + mdl_index= request.ticket; + table_stats= dict_table_open_on_name("mysql/innodb_table_stats", false, + DICT_ERR_IGNORE_NONE); + if (!table_stats) + goto release_mdl; + index_stats= dict_table_open_on_name("mysql/innodb_index_stats", false, + DICT_ERR_IGNORE_NONE); + if (index_stats) + return false; + + dict_table_close(table_stats); +release_mdl: + if (mdl_index) + mdl_context->release_lock(mdl_index); + mdl_context->release_lock(mdl_table); + return true; +} + +void dict_stats::close() noexcept +{ + dict_table_close(table_stats); + dict_table_close(index_stats); + mdl_context->release_lock(mdl_table); + mdl_context->release_lock(mdl_index); +} + /**********************************************************************//** Adds system columns to a table object. */ void diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index 4d1e28b912a..ddd5ee03f0d 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -2896,11 +2896,12 @@ dict_stats_save( pars_info_t* pinfo; char db_utf8[MAX_DB_UTF8_LEN]; char table_utf8[MAX_TABLE_UTF8_LEN]; + THD* const thd = current_thd; #ifdef ENABLED_DEBUG_SYNC DBUG_EXECUTE_IF("dict_stats_save_exit_notify", - SCOPE_EXIT([] { - debug_sync_set_action(current_thd, + SCOPE_EXIT([thd] { + debug_sync_set_action(thd, STRING_WITH_LEN("now SIGNAL dict_stats_save_finished")); }); ); @@ -2914,41 +2915,10 @@ dict_stats_save( return (dict_stats_report_error(table)); } - THD* thd = current_thd; - MDL_ticket *mdl_table = nullptr, *mdl_index = nullptr; - dict_table_t* table_stats = dict_table_open_on_name( - TABLE_STATS_NAME, false, DICT_ERR_IGNORE_NONE); - if (table_stats) { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats = dict_acquire_mdl_shared(table_stats, thd, - &mdl_table); - dict_sys.unfreeze(); - } - if (!table_stats - || strcmp(table_stats->name.m_name, TABLE_STATS_NAME)) { -release_and_exit: - if (table_stats) { - dict_table_close(table_stats, false, thd, mdl_table); - } + dict_stats stats; + if (stats.open(thd)) { return DB_STATS_DO_NOT_EXIST; } - - dict_table_t* index_stats = dict_table_open_on_name( - INDEX_STATS_NAME, false, DICT_ERR_IGNORE_NONE); - if (index_stats) { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats = dict_acquire_mdl_shared(index_stats, thd, - &mdl_index); - dict_sys.unfreeze(); - } - if (!index_stats) { - goto release_and_exit; - } - if (strcmp(index_stats->name.m_name, INDEX_STATS_NAME)) { - dict_table_close(index_stats, false, thd, mdl_index); - goto release_and_exit; - } - dict_fs2utf8(table->name.m_name, db_utf8, sizeof(db_utf8), table_utf8, sizeof(table_utf8)); const time_t now = time(NULL); @@ -2957,9 +2927,9 @@ release_and_exit: trx_start_internal(trx); dberr_t ret = trx->read_only ? DB_READ_ONLY - : lock_table_for_trx(table_stats, trx, LOCK_X); + : lock_table_for_trx(stats.table(), trx, LOCK_X); if (ret == DB_SUCCESS) { - ret = lock_table_for_trx(index_stats, trx, LOCK_X); + ret = lock_table_for_trx(stats.index(), trx, LOCK_X); } if (ret != DB_SUCCESS) { if (trx->state != TRX_STATE_NOT_STARTED) { @@ -3014,8 +2984,7 @@ free_and_exit: dict_sys.unlock(); unlocked_free_and_exit: trx->free(); - dict_table_close(table_stats, false, thd, mdl_table); - dict_table_close(index_stats, false, thd, mdl_index); + stats.close(); return ret; } @@ -3495,42 +3464,11 @@ dict_stats_fetch_from_ps( stats. */ dict_stats_empty_table(table, true); - THD* thd = current_thd; - MDL_ticket *mdl_table = nullptr, *mdl_index = nullptr; - dict_table_t* table_stats = dict_table_open_on_name( - TABLE_STATS_NAME, false, DICT_ERR_IGNORE_NONE); - if (!table_stats) { + THD* const thd = current_thd; + dict_stats stats; + if (stats.open(thd)) { return DB_STATS_DO_NOT_EXIST; } - dict_table_t* index_stats = dict_table_open_on_name( - INDEX_STATS_NAME, false, DICT_ERR_IGNORE_NONE); - if (!index_stats) { - dict_table_close(table_stats); - return DB_STATS_DO_NOT_EXIST; - } - - dict_sys.freeze(SRW_LOCK_CALL); - table_stats = dict_acquire_mdl_shared(table_stats, thd, - &mdl_table); - if (!table_stats - || strcmp(table_stats->name.m_name, TABLE_STATS_NAME)) { -release_and_exit: - if (table_stats) { - dict_table_close(table_stats, true, thd, mdl_table); - } - if (index_stats) { - dict_table_close(index_stats, true, thd, mdl_index); - } - dict_sys.unfreeze(); - return DB_STATS_DO_NOT_EXIST; - } - - index_stats = dict_acquire_mdl_shared(index_stats, thd, - &mdl_index); - if (!index_stats - || strcmp(index_stats->name.m_name, INDEX_STATS_NAME)) { - goto release_and_exit; - } #ifdef ENABLED_DEBUG_SYNC DEBUG_SYNC(thd, "dict_stats_mdl_acquired"); @@ -3556,7 +3494,6 @@ release_and_exit: "fetch_index_stats_step", dict_stats_fetch_index_stats_step, &index_fetch_arg); - dict_sys.unfreeze(); dict_sys.lock(SRW_LOCK_CALL); que_t* graph = pars_sql( pinfo, @@ -3622,18 +3559,11 @@ release_and_exit: trx_start_internal_read_only(trx); que_run_threads(que_fork_start_command(graph)); que_graph_free(graph); - - dict_table_close(table_stats, false, thd, mdl_table); - dict_table_close(index_stats, false, thd, mdl_index); - trx_commit_for_mysql(trx); - dberr_t ret = trx->error_state; + dberr_t ret = index_fetch_arg.stats_were_modified + ? trx->error_state : DB_STATS_DO_NOT_EXIST; trx->free(); - - if (!index_fetch_arg.stats_were_modified) { - return DB_STATS_DO_NOT_EXIST; - } - + stats.close(); return ret; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f147235f669..4d2b179738f 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1357,38 +1357,17 @@ static void innodb_drop_database(handlerton*, char *path) dict_sys.unlock(); - dict_table_t *table_stats, *index_stats; - MDL_ticket *mdl_table= nullptr, *mdl_index= nullptr; - table_stats= dict_table_open_on_name(TABLE_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (table_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats= dict_acquire_mdl_shared(table_stats, - thd, &mdl_table); - dict_sys.unfreeze(); - } - index_stats= dict_table_open_on_name(INDEX_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (index_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats= dict_acquire_mdl_shared(index_stats, - thd, &mdl_index); - dict_sys.unfreeze(); - } - + dict_stats stats; + const bool stats_failed{stats.open(thd)}; trx_start_for_ddl(trx); uint errors= 0; char db[NAME_LEN + 1]; strconvert(&my_charset_filename, namebuf, len, system_charset_info, db, sizeof db, &errors); - if (!errors && table_stats && index_stats && - !strcmp(table_stats->name.m_name, TABLE_STATS_NAME) && - !strcmp(index_stats->name.m_name, INDEX_STATS_NAME) && - lock_table_for_trx(table_stats, trx, LOCK_X) == DB_SUCCESS && - lock_table_for_trx(index_stats, trx, LOCK_X) == DB_SUCCESS) + if (!errors && !stats_failed && + lock_table_for_trx(stats.table(), trx, LOCK_X) == DB_SUCCESS && + lock_table_for_trx(stats.index(), trx, LOCK_X) == DB_SUCCESS) { row_mysql_lock_data_dictionary(trx); if (dict_stats_delete(db, trx)) @@ -1484,19 +1463,16 @@ static void innodb_drop_database(handlerton*, char *path) if (err != DB_SUCCESS) { trx->rollback(); - namebuf[len] = '\0'; - ib::error() << "DROP DATABASE " << namebuf << ": " << err; + sql_print_error("InnoDB: DROP DATABASE %.*s: %s", + int(len), namebuf, ut_strerr(err)); } else trx->commit(); - if (table_stats) - dict_table_close(table_stats, true, thd, mdl_table); - if (index_stats) - dict_table_close(index_stats, true, thd, mdl_index); row_mysql_unlock_data_dictionary(trx); - trx->free(); + if (!stats_failed) + stats.close(); if (err == DB_SUCCESS) { @@ -13682,8 +13658,6 @@ int ha_innobase::delete_table(const char *name) err= lock_table_children(table, trx); } - dict_table_t *table_stats= nullptr, *index_stats= nullptr; - MDL_ticket *mdl_table= nullptr, *mdl_index= nullptr; if (err == DB_SUCCESS) err= lock_table_for_trx(table, trx, LOCK_X); @@ -13722,37 +13696,18 @@ int ha_innobase::delete_table(const char *name) #endif DEBUG_SYNC(thd, "before_delete_table_stats"); + dict_stats stats; + bool stats_failed= true; if (err == DB_SUCCESS && dict_stats_is_persistent_enabled(table) && !table->is_stats_table()) { - table_stats= dict_table_open_on_name(TABLE_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (table_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats= dict_acquire_mdl_shared(table_stats, - thd, &mdl_table); - dict_sys.unfreeze(); - } - - index_stats= dict_table_open_on_name(INDEX_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (index_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats= dict_acquire_mdl_shared(index_stats, - thd, &mdl_index); - dict_sys.unfreeze(); - } - + stats_failed= stats.open(thd); const bool skip_wait{table->name.is_temporary()}; - if (table_stats && index_stats && - !strcmp(table_stats->name.m_name, TABLE_STATS_NAME) && - !strcmp(index_stats->name.m_name, INDEX_STATS_NAME) && - !(err= lock_table_for_trx(table_stats, trx, LOCK_X, skip_wait))) - err= lock_table_for_trx(index_stats, trx, LOCK_X, skip_wait); + if (!stats_failed && + !(err= lock_table_for_trx(stats.table(), trx, LOCK_X, skip_wait))) + err= lock_table_for_trx(stats.index(), trx, LOCK_X, skip_wait); if (err != DB_SUCCESS && skip_wait) { @@ -13761,10 +13716,8 @@ int ha_innobase::delete_table(const char *name) ut_ad(err == DB_LOCK_WAIT); ut_ad(trx->error_state == DB_SUCCESS); err= DB_SUCCESS; - dict_table_close(table_stats, false, thd, mdl_table); - dict_table_close(index_stats, false, thd, mdl_index); - table_stats= nullptr; - index_stats= nullptr; + stats.close(); + stats_failed= true; } } @@ -13835,13 +13788,11 @@ err_exit: else if (rollback_add_partition) purge_sys.resume_FTS(); #endif - if (table_stats) - dict_table_close(table_stats, true, thd, mdl_table); - if (index_stats) - dict_table_close(index_stats, true, thd, mdl_index); row_mysql_unlock_data_dictionary(trx); if (trx != parent_trx) trx->free(); + if (!stats_failed) + stats.close(); DBUG_RETURN(convert_error_code_to_mysql(err, 0, NULL)); } @@ -13856,7 +13807,7 @@ err_exit: err= trx->drop_table_foreign(table->name); } - if (err == DB_SUCCESS && table_stats && index_stats) + if (err == DB_SUCCESS && !stats_failed) err= trx->drop_table_statistics(table->name); if (err != DB_SUCCESS) goto err_exit; @@ -13867,11 +13818,9 @@ err_exit: std::vector deleted; trx->commit(deleted); - if (table_stats) - dict_table_close(table_stats, true, thd, mdl_table); - if (index_stats) - dict_table_close(index_stats, true, thd, mdl_index); row_mysql_unlock_data_dictionary(trx); + if (!stats_failed) + stats.close(); for (pfs_os_file_t d : deleted) os_file_close(d); log_write_up_to(trx->commit_lsn, true); @@ -14067,9 +14016,6 @@ int ha_innobase::truncate() ib_table->name.m_name, ib_table->id); const char *name= mem_heap_strdup(heap, ib_table->name.m_name); - dict_table_t *table_stats = nullptr, *index_stats = nullptr; - MDL_ticket *mdl_table = nullptr, *mdl_index = nullptr; - dberr_t error= lock_table_children(ib_table, trx); if (error == DB_SUCCESS) @@ -14096,33 +14042,16 @@ int ha_innobase::truncate() std::this_thread::sleep_for(std::chrono::milliseconds(50)); } + dict_stats stats; + bool stats_failed= true; + if (error == DB_SUCCESS && dict_stats_is_persistent_enabled(ib_table) && !ib_table->is_stats_table()) { - table_stats= dict_table_open_on_name(TABLE_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (table_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats= dict_acquire_mdl_shared(table_stats, m_user_thd, - &mdl_table); - dict_sys.unfreeze(); - } - index_stats= dict_table_open_on_name(INDEX_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (index_stats) - { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats= dict_acquire_mdl_shared(index_stats, m_user_thd, - &mdl_index); - dict_sys.unfreeze(); - } - - if (table_stats && index_stats && - !strcmp(table_stats->name.m_name, TABLE_STATS_NAME) && - !strcmp(index_stats->name.m_name, INDEX_STATS_NAME) && - !(error= lock_table_for_trx(table_stats, trx, LOCK_X))) - error= lock_table_for_trx(index_stats, trx, LOCK_X); + stats_failed= stats.open(m_user_thd); + if (!stats_failed && + !(error= lock_table_for_trx(stats.table(), trx, LOCK_X))) + error= lock_table_for_trx(stats.index(), trx, LOCK_X); } if (error == DB_SUCCESS) @@ -14214,14 +14143,9 @@ int ha_innobase::truncate() } trx->free(); - + if (!stats_failed) + stats.close(); mem_heap_free(heap); - - if (table_stats) - dict_table_close(table_stats, false, m_user_thd, mdl_table); - if (index_stats) - dict_table_close(index_stats, false, m_user_thd, mdl_index); - DBUG_RETURN(err); } @@ -14247,8 +14171,6 @@ ha_innobase::rename_table( trx_t* trx = innobase_trx_allocate(thd); trx_start_for_ddl(trx); - dict_table_t *table_stats = nullptr, *index_stats = nullptr; - MDL_ticket *mdl_table = nullptr, *mdl_index = nullptr; char norm_from[MAX_FULL_NAME_LEN]; char norm_to[MAX_FULL_NAME_LEN]; @@ -14269,34 +14191,19 @@ ha_innobase::rename_table( table->release(); } + dict_stats stats; + bool stats_fail = true; + if (strcmp(norm_from, TABLE_STATS_NAME) && strcmp(norm_from, INDEX_STATS_NAME) && strcmp(norm_to, TABLE_STATS_NAME) && strcmp(norm_to, INDEX_STATS_NAME)) { - table_stats = dict_table_open_on_name(TABLE_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (table_stats) { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats = dict_acquire_mdl_shared( - table_stats, thd, &mdl_table); - dict_sys.unfreeze(); - } - index_stats = dict_table_open_on_name(INDEX_STATS_NAME, false, - DICT_ERR_IGNORE_NONE); - if (index_stats) { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats = dict_acquire_mdl_shared( - index_stats, thd, &mdl_index); - dict_sys.unfreeze(); - } - - if (error == DB_SUCCESS && table_stats && index_stats - && !strcmp(table_stats->name.m_name, TABLE_STATS_NAME) - && !strcmp(index_stats->name.m_name, INDEX_STATS_NAME)) { - error = lock_table_for_trx(table_stats, trx, LOCK_X, - from_temp); + stats_fail = stats.open(thd); + if (!stats_fail && error == DB_SUCCESS) { + error = lock_table_for_trx(stats.table(), trx, + LOCK_X, from_temp); if (error == DB_SUCCESS) { - error = lock_table_for_trx(index_stats, trx, + error = lock_table_for_trx(stats.index(), trx, LOCK_X, from_temp); } if (error != DB_SUCCESS && from_temp) { @@ -14307,12 +14214,8 @@ ha_innobase::rename_table( we cannot lock the tables, when the table is being renamed from from a temporary name. */ - dict_table_close(table_stats, false, thd, - mdl_table); - dict_table_close(index_stats, false, thd, - mdl_index); - table_stats = nullptr; - index_stats = nullptr; + stats.close(); + stats_fail = true; } } } @@ -14339,7 +14242,7 @@ ha_innobase::rename_table( DEBUG_SYNC(thd, "after_innobase_rename_table"); - if (error == DB_SUCCESS && table_stats && index_stats) { + if (error == DB_SUCCESS && !stats_fail) { error = dict_stats_rename_table(norm_from, norm_to, trx); if (error == DB_DUPLICATE_KEY) { /* The duplicate may also occur in @@ -14357,18 +14260,15 @@ ha_innobase::rename_table( trx->rollback(); } - if (table_stats) { - dict_table_close(table_stats, true, thd, mdl_table); - } - if (index_stats) { - dict_table_close(index_stats, true, thd, mdl_index); - } row_mysql_unlock_data_dictionary(trx); if (error == DB_SUCCESS) { log_write_up_to(trx->commit_lsn, true); } trx->flush_log_later = false; trx->free(); + if (!stats_fail) { + stats.close(); + } if (error == DB_DUPLICATE_KEY) { /* We are not able to deal with handler::get_dup_key() @@ -17615,11 +17515,16 @@ static int innodb_ft_aux_table_validate(THD *thd, st_mysql_sys_var*, int len = sizeof buf; if (const char* table_name = value->val_str(value, buf, &len)) { + /* Because we are not acquiring MDL on the table name, + we must contiguously hold dict_sys.latch while we are + examining the table, to protect us against concurrent DDL. */ + dict_sys.lock(SRW_LOCK_CALL); if (dict_table_t* table = dict_table_open_on_name( - table_name, false, DICT_ERR_IGNORE_NONE)) { + table_name, true, DICT_ERR_IGNORE_NONE)) { + table->release(); const table_id_t id = dict_table_has_fts_index(table) ? table->id : 0; - dict_table_close(table); + dict_sys.unlock(); if (id) { innodb_ft_aux_table_id = id; if (table_name == buf) { @@ -17630,12 +17535,11 @@ static int innodb_ft_aux_table_validate(THD *thd, st_mysql_sys_var*, len); } - *static_cast(save) = table_name; return 0; } } - + dict_sys.unlock(); return 1; } else { *static_cast(save) = NULL; diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 5749049da03..09c1febf61d 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -11547,34 +11547,16 @@ err_index: } } - dict_table_t *table_stats = nullptr, *index_stats = nullptr; - MDL_ticket *mdl_table = nullptr, *mdl_index = nullptr; + dict_stats stats; + bool stats_failed = true; dberr_t error = DB_SUCCESS; if (!ctx0->old_table->is_stats_table() && !ctx0->new_table->is_stats_table()) { - table_stats = dict_table_open_on_name( - TABLE_STATS_NAME, false, DICT_ERR_IGNORE_NONE); - if (table_stats) { - dict_sys.freeze(SRW_LOCK_CALL); - table_stats = dict_acquire_mdl_shared( - table_stats, m_user_thd, &mdl_table); - dict_sys.unfreeze(); - } - index_stats = dict_table_open_on_name( - INDEX_STATS_NAME, false, DICT_ERR_IGNORE_NONE); - if (index_stats) { - dict_sys.freeze(SRW_LOCK_CALL); - index_stats = dict_acquire_mdl_shared( - index_stats, m_user_thd, &mdl_index); - dict_sys.unfreeze(); - } - - if (table_stats && index_stats - && !strcmp(table_stats->name.m_name, TABLE_STATS_NAME) - && !strcmp(index_stats->name.m_name, INDEX_STATS_NAME) - && !(error = lock_table_for_trx(table_stats, + stats_failed = stats.open(m_user_thd); + if (!stats_failed + && !(error = lock_table_for_trx(stats.table(), trx, LOCK_X))) { - error = lock_table_for_trx(index_stats, trx, LOCK_X); + error = lock_table_for_trx(stats.index(), trx, LOCK_X); } } @@ -11588,15 +11570,9 @@ err_index: error = lock_sys_tables(trx); } if (error != DB_SUCCESS) { - if (table_stats) { - dict_table_close(table_stats, false, m_user_thd, - mdl_table); + if (!stats_failed) { + stats.close(); } - if (index_stats) { - dict_table_close(index_stats, false, m_user_thd, - mdl_index); - } - my_error_innodb(error, table_share->table_name.str, 0); if (fts_exist) { purge_sys.resume_FTS(); } @@ -11612,6 +11588,7 @@ err_index: trx_start_for_ddl(trx); } + my_error_innodb(error, table_share->table_name.str, 0); DBUG_RETURN(true); } @@ -11629,15 +11606,10 @@ err_index: fail: trx->rollback(); ut_ad(!trx->fts_trx); - if (table_stats) { - dict_table_close(table_stats, true, m_user_thd, - mdl_table); - } - if (index_stats) { - dict_table_close(index_stats, true, m_user_thd, - mdl_index); - } row_mysql_unlock_data_dictionary(trx); + if (!stats_failed) { + stats.close(); + } if (fts_exist) { purge_sys.resume_FTS(); } @@ -11657,14 +11629,14 @@ fail: if (commit_try_rebuild(ha_alter_info, ctx, altered_table, table, - table_stats && index_stats, + !stats_failed, trx, table_share->table_name.str)) { goto fail; } } else if (commit_try_norebuild(ha_alter_info, ctx, altered_table, table, - table_stats && index_stats, + !stats_failed, trx, table_share->table_name.str)) { goto fail; @@ -11687,13 +11659,6 @@ fail: #endif } - if (table_stats) { - dict_table_close(table_stats, true, m_user_thd, mdl_table); - } - if (index_stats) { - dict_table_close(index_stats, true, m_user_thd, mdl_index); - } - /* Commit or roll back the changes to the data dictionary. */ DEBUG_SYNC(m_user_thd, "innodb_alter_inplace_before_commit"); @@ -11843,6 +11808,9 @@ foreign_fail: DBUG_EXECUTE_IF("innodb_alter_commit_crash_after_commit", DBUG_SUICIDE();); trx->free(); + if (!stats_failed) { + stats.close(); + } if (fts_exist) { purge_sys.resume_FTS(); } @@ -11900,6 +11868,9 @@ foreign_fail: DBUG_EXECUTE_IF("innodb_alter_commit_crash_after_commit", DBUG_SUICIDE();); trx->free(); + if (!stats_failed) { + stats.close(); + } if (fts_exist) { purge_sys.resume_FTS(); } diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 519e1c5bd10..64050d26d44 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1660,6 +1660,27 @@ bool dict_table_have_virtual_index( dict_table_t* table); +/** Helper for opening the InnoDB persistent statistics tables */ +class dict_stats final +{ + MDL_context *mdl_context= nullptr; + MDL_ticket *mdl_table= nullptr, *mdl_index= nullptr; + dict_table_t *table_stats= nullptr, *index_stats= nullptr; + +public: + dict_stats()= default; + + /** Open the statistics tables. + @return whether the operation failed */ + bool open(THD *thd) noexcept; + + /** Close the statistics tables after !open_tables(thd). */ + void close() noexcept; + + dict_table_t *table() const noexcept { return table_stats; } + dict_table_t *index() const noexcept { return index_stats; } +}; + #include "dict0dict.inl" #endif diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 4601fb4394d..d258e5c6b27 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -4140,13 +4140,12 @@ dberr_t lock_table_children(dict_table_t *table, trx_t *trx) children.end()) continue; /* We already acquired MDL on this child table. */ MDL_ticket *mdl= nullptr; - child->acquire(); child= dict_acquire_mdl_shared(child, mdl_context, &mdl, DICT_TABLE_OP_NORMAL); if (child) { - if (!mdl) - child->release(); + if (mdl) + child->acquire(); children.emplace_back(table_mdl{child, mdl}); goto rescan; } From 6066e5d13c2154e4348f40d59eb3af32eb5734c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Mar 2025 14:23:45 +0200 Subject: [PATCH 65/65] MDEV-36122: Work around missing MDL in purge prepare_inplace_alter_table_dict(): If an unexpected reference to the table exists, wait for the purge subsystem to release its table handle, similar to how we would do in case FULLTEXT INDEX existed. This function is supposed to be protected by MDL_EXCLUSIVE on the table name. If purge is going to access the table again later during is ALTER TABLE operation, it will have access to an MDL compatible name for it and therefore should conflict with any MDL_EXCLUSIVE that would cover ha_innobase::commit_inplace_alter_table(commit=true). This change should prevent race conditions where purge had initially looked up a table for which row-level undo log records had been written by ALTER IGNORE TABLE, and purge did not finish before a subsequent ALTER TABLE is trying to rebuild the table. trx_purge_attach_undo_recs(), purge_sys_t::batch_cleanup(): Clear purge_sys.m_active only after all table handles have been released. ha_innobase::truncate(): Before locking the data dictionary, ensure that the purge subsystem is not holding a reference to the table due to insufficient metadata locking related to an earlier ALTER IGNORE TABLE operation. Reviewed by: Debarun Banerjee --- storage/innobase/handler/ha_innodb.cc | 3 +++ storage/innobase/handler/handler0alter.cc | 18 ++++++++++++------ storage/innobase/trx/trx0purge.cc | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4d2b179738f..fdfd0cb395d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -14023,6 +14023,7 @@ int ha_innobase::truncate() const bool fts= error == DB_SUCCESS && ib_table->flags2 & (DICT_TF2_FTS_HAS_DOC_ID | DICT_TF2_FTS); + const bool pause_purge= error == DB_SUCCESS && ib_table->get_ref_count() > 1; if (fts) { @@ -14030,6 +14031,8 @@ int ha_innobase::truncate() purge_sys.stop_FTS(*ib_table); error= fts_lock_tables(trx, *ib_table); } + else if (pause_purge) + purge_sys.stop_FTS(); /* Wait for purge threads to stop using the table. */ for (uint n = 15; ib_table->get_ref_count() > 1; ) diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 09c1febf61d..3fe02af5beb 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -6603,8 +6603,9 @@ prepare_inplace_alter_table_dict( mem_heap_alloc(ctx->heap, ctx->num_to_add_index * sizeof *ctx->add_key_numbers)); - const bool fts_exist = ctx->new_table->flags2 + const bool have_fts = user_table->flags2 & (DICT_TF2_FTS_HAS_DOC_ID | DICT_TF2_FTS); + const bool pause_purge = have_fts || user_table->get_ref_count() > 1; /* Acquire a lock on the table before creating any indexes. */ bool table_lock_failed = false; @@ -6631,13 +6632,18 @@ acquire_lock: user_table->lock_shared_unlock(); } - if (fts_exist) { - purge_sys.stop_FTS(*ctx->new_table); + if (pause_purge) { + purge_sys.stop_FTS(); + if (have_fts) { + purge_sys.stop_FTS(*user_table, true); + } if (error == DB_SUCCESS) { - error = fts_lock_tables(ctx->trx, *ctx->new_table); + error = fts_lock_tables(ctx->trx, *user_table); } } + ut_ad(user_table->get_ref_count() == 1); + if (error == DB_SUCCESS) { error = lock_sys_tables(ctx->trx); } @@ -7470,7 +7476,7 @@ error_handling_drop_uncached: /* fts_create_common_tables() may drop old common tables, whose files would be deleted here. */ commit_unlock_and_unlink(ctx->trx); - if (fts_exist) { + if (pause_purge) { purge_sys.resume_FTS(); } @@ -7566,7 +7572,7 @@ err_exit: ctx->trx->free(); } trx_commit_for_mysql(ctx->prebuilt->trx); - if (fts_exist) { + if (pause_purge) { purge_sys.resume_FTS(); } diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index ef85dd7dbda..8292bb063b4 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1292,8 +1292,6 @@ static purge_sys_t::iterator trx_purge_attach_undo_recs(THD *thd, break; } - purge_sys.m_active= false; - #ifdef UNIV_DEBUG thr= UT_LIST_GET_FIRST(purge_sys.query->thrs); for (ulint i= 0; thr && i < *n_work_items; @@ -1342,6 +1340,8 @@ static void trx_purge_wait_for_workers_to_complete() TRANSACTIONAL_INLINE void purge_sys_t::batch_cleanup(const purge_sys_t::iterator &head) { + m_active= false; + /* Release the undo pages. */ for (auto p : pages) p.second->unfix();