diff options
author | mkaruza <mario.karuza@galeracluster.com> | 2021-08-18 10:13:02 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-08-18 12:20:06 +0300 |
commit | da171182b7d79d21177d113d2bbaecbca21d8bbc (patch) | |
tree | 655ee4ddff352ee2c800bef6de094d8e3265e3c8 /sql/wsrep_mysqld.cc | |
parent | cce33787c37a6a0724e518f0f74a445a3682dfc4 (diff) | |
download | mariadb-git-da171182b7d79d21177d113d2bbaecbca21d8bbc.tar.gz |
MDEV-26223 Galera cluster node consider old server_id value even after modification of server_id [wsrep_gtid_mode=ON]bb-10.5-rasmus
If cluster is bootstrapped in existing database, we should use provided
configuration variables for wsrep_gtid_domain_id and server_id instead
of recovered ones.
If 'new' combination of wsrep_gtid_domain_id & server_id already existed
somewere before in binlog we should continue from last seqno, if
combination is new we start from seqno 0.
Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r-- | sql/wsrep_mysqld.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 972876c24c2..524410152ca 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -804,17 +804,20 @@ void wsrep_init_globals() { wsrep_gtid_server.domain_id= wsrep_gtid_domain_id; wsrep_init_sidno(Wsrep_server_state::instance().connected_gtid().id()); - wsrep_init_gtid(); /* Recover last written wsrep gtid */ + wsrep_init_gtid(); if (wsrep_new_cluster) { - wsrep_server_gtid_t gtid= {wsrep_gtid_server.domain_id, - wsrep_gtid_server.server_id, 0}; - wsrep_get_binlog_gtid_seqno(gtid); - wsrep_gtid_server.seqno(gtid.seqno); + /* Start with provided domain_id & server_id found in configuration */ + 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; + /* 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); } wsrep_init_schema(); - if (WSREP_ON) { Wsrep_server_state::instance().initialized(); |