Skip to content
/ server Public

Commit 48d08d6

Browse files
committed
MDEV-38558 : MariaDB does not support writes during MySQL --> MariaDB migration
When MariaDB node has joined to MySQL Galera cluster if any writes to existing tables are done cluster requests to use protocol version 7 (max protocol version used by MySQL Galera cluster). MariaDB had support to protocol version up to 4. While writeset keys are prepared allow using protocol version 7, it has no effect on writeset key format i.e. protocol version 4 and 7 are identical on that case. Note that there is no mtr test case because currently there is no way to test both MySQL and MariaDB in mtr.
1 parent 52b1d7e commit 48d08d6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

sql/wsrep_mysqld.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright (c) 2008, 2025, Codership Oy <http://www.codership.com>
2-
Copyright (c) 2020, 2025, MariaDB
2+
Copyright (c) 2020, 2026, MariaDB
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -121,6 +121,10 @@ my_bool wsrep_restart_slave_activated= 0; // Node has dropped, and slave
121121
bool wsrep_new_cluster= false; // Bootstrap the cluster?
122122
int wsrep_slave_count_change= 0; // No. of appliers to stop/start
123123
int wsrep_to_isolation= 0; // No. of active TO isolation threads
124+
//
125+
// NOTE : MySQL Cluster has max_protocol version 7
126+
// thus protocol versions 5-7 are reserved for compatibility.
127+
//
124128
long wsrep_max_protocol_version= 4; // Maximum protocol version to use
125129
long int wsrep_protocol_version= wsrep_max_protocol_version;
126130
ulong wsrep_trx_fragment_unit= WSREP_FRAG_BYTES;
@@ -1973,6 +1977,10 @@ static bool wsrep_prepare_key_for_isolation(const char* db,
19731977
case 2:
19741978
case 3:
19751979
case 4:
1980+
// For MySQL Galera Cluster migration
1981+
case 5:
1982+
case 6:
1983+
case 7:
19761984
{
19771985
*key_len= 0;
19781986
if (db)
@@ -1990,7 +1998,6 @@ static bool wsrep_prepare_key_for_isolation(const char* db,
19901998
break;
19911999
}
19922000
default:
1993-
assert(0);
19942001
WSREP_ERROR("Unsupported protocol version: %ld", wsrep_protocol_version);
19952002
unireg_abort(1);
19962003
return false;
@@ -2153,6 +2160,10 @@ bool wsrep_prepare_key(const uchar* cache_key, size_t cache_key_len,
21532160
case 2:
21542161
case 3:
21552162
case 4:
2163+
// For MySQL Galera Cluster migration
2164+
case 5:
2165+
case 6:
2166+
case 7:
21562167
{
21572168
key[0].ptr= cache_key;
21582169
key[0].len= strlen( (char*)cache_key );
@@ -2164,6 +2175,7 @@ bool wsrep_prepare_key(const uchar* cache_key, size_t cache_key_len,
21642175
break;
21652176
}
21662177
default:
2178+
WSREP_ERROR("Unsupported protocol version : %ld", wsrep_protocol_version);
21672179
return false;
21682180
}
21692181

0 commit comments

Comments
 (0)