diff options
author | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2022-05-19 03:45:19 +0200 |
---|---|---|
committer | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2022-05-19 03:45:19 +0200 |
commit | a63c5e72aaf1ff30c6bac8ec668b371e0559f14d (patch) | |
tree | c474940de7e9d9070d2743eea09dea8a22cacc52 /sql/wsrep_sst.cc | |
parent | 72793435e118863ad200dd7218814396d4fc5a76 (diff) | |
download | mariadb-git-bb-10.9-MDEV-28423-v2.tar.gz |
MDEV-28423 continuation: Galera progress reporting + rolling updatesbb-10.9-MDEV-28423-v2
A new feature to support progress reporting (including progress
reporting in the JSON format) that was added in 10.9 can crash the
rolling update scenario if the old version donor node does not pass
the "total" tag in the MAGIC_FILE to the joiner node. The "grep"
utility that is used to extract this tag in this case will return
an empty string, which will then be substituted into the "if"
statement, resulting in a syntactically invalid construct.
This commit corrects this issue.
Also, when using the previous fixes (from MDEV-28423 and from
MDEV-28593), authentication errors are possible in case of mixing
versions at the opposite sides - if the donor is newer than joiner,
due to incorrect reading of the new MAGIC_FILE format by older node
versions (from the joiners side). This problem is also fixed here,
taking advantage of the fact that older versions are still able
to read GUID coordinates even if multiple strings are passed to
them at the end.
In addition, the new progress reporting exchanges the length of
the transmitted data between the donor and the joiner before the
start of the transfer, but does not use this information on the
joiner side, which can lead to incorrect calculation of progress
by the joiner (not synchronous with calculations from the donor
side) if from the joiner side reporting works in compatibility
mode with older versions. This commit moves the construction
of the command line for progress reporting to a point where
we already know the size and can use that knowledge.
Also, to facilitate SST script support in the future, the
script code now has been made unified between all versions
from 10.3 to 10.9.
Diffstat (limited to 'sql/wsrep_sst.cc')
-rw-r--r-- | sql/wsrep_sst.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 1a3df7c676e..0676ce79dfd 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -1149,12 +1149,14 @@ static ssize_t sst_prepare_other (const char* method, WSREP_SST_OPT_ADDR " '%s' " WSREP_SST_OPT_DATA " '%s' " "%s" - WSREP_SST_OPT_PARENT " '%d'" + WSREP_SST_OPT_PARENT " %d " + WSREP_SST_OPT_PROGRESS " %d" "%s" "%s", method, addr_in, mysql_real_data_home, wsrep_defaults_file, (int)getpid(), + wsrep_debug ? 1 : 0, binlog_opt_val, binlog_index_opt_val); my_free(binlog_opt_val); @@ -1957,16 +1959,18 @@ static int sst_donate_other (const char* method, "wsrep_sst_%s " WSREP_SST_OPT_ROLE " 'donor' " WSREP_SST_OPT_ADDR " '%s' " - WSREP_SST_OPT_LPORT " '%u' " + WSREP_SST_OPT_LPORT " %u " WSREP_SST_OPT_SOCKET " '%s' " + WSREP_SST_OPT_PROGRESS " %d " WSREP_SST_OPT_DATA " '%s' " "%s" WSREP_SST_OPT_GTID " '%s:%lld' " - WSREP_SST_OPT_GTID_DOMAIN_ID " '%d'" + WSREP_SST_OPT_GTID_DOMAIN_ID " %d" "%s" "%s" "%s", method, addr, mysqld_port, mysqld_unix_port, + wsrep_debug ? 1 : 0, mysql_real_data_home, wsrep_defaults_file, uuid_oss.str().c_str(), gtid.seqno().get(), wsrep_gtid_server.domain_id, |