diff options
author | mkaruza <mario.karuza@galeracluster.com> | 2022-01-25 14:19:52 +0100 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2022-01-27 08:22:46 +0200 |
commit | 53173709b323abc3a409a88da27529f7382db7c5 (patch) | |
tree | dcbab6f11da43696044435a0a6eab499f029b766 /sql/wsrep_mysqld.cc | |
parent | 56f5599f09dca6d9c168f89f9b63d716d15a8675 (diff) | |
download | mariadb-git-53173709b323abc3a409a88da27529f7382db7c5.tar.gz |
MDEV-26223 Galera cluster node consider old server_id value even after modification of server_id [wsrep_gtid_mode=ON]
Variable `wsrep_new_cluster` now will be TRUE also when there is only `gcomm://` used
in configuration. This configuration, even without --wsrep-new-cluster,
is considered to bootstrap new cluster.
Updated galera GTID test to ignore warning message when non bootstrap
node have server-id different thant one cluster is initialized with.
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r-- | sql/wsrep_mysqld.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 31265a8b689..0784b1afc17 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1,5 +1,5 @@ -/* Copyright 2008-2021 Codership Oy <http://www.codership.com> - Copyright (c) 2020, 2021, MariaDB +/* Copyright (c) 2008, 2022 Codership Oy <http://www.codership.com> + Copyright (c) 2020, 2022, MariaDB 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 @@ -802,7 +802,6 @@ int wsrep_init_server() void wsrep_init_globals() { - wsrep_gtid_server.domain_id= wsrep_gtid_domain_id; wsrep_init_sidno(Wsrep_server_state::instance().connected_gtid().id()); /* Recover last written wsrep gtid */ wsrep_init_gtid(); @@ -817,6 +816,13 @@ void wsrep_init_globals() wsrep_get_binlog_gtid_seqno(new_gtid); wsrep_gtid_server.gtid(new_gtid); } + else + { + if (wsrep_gtid_mode && wsrep_gtid_server.server_id != global_system_variables.server_id) + { + WSREP_WARN("Ignoring server id for non bootstrap node."); + } + } wsrep_init_schema(); if (WSREP_ON) { @@ -1143,6 +1149,15 @@ bool wsrep_start_replication(const char *wsrep_cluster_address) DBUG_ASSERT(wsrep_cluster_address[0]); + // --wsrep-new-cluster flag is not used, checking wsrep_cluster_address + // it should match gcomm:// only to be considered as bootstrap node. + // This logic is used in galera. + if (!wsrep_new_cluster && (strlen(wsrep_cluster_address) == 8) && + !strncmp(wsrep_cluster_address, "gcomm://", 8)) + { + wsrep_new_cluster= true; + } + bool const bootstrap(TRUE == wsrep_new_cluster); WSREP_INFO("Start replication"); |