Commit da171182 authored by mkaruza's avatar mkaruza Committed by Jan Lindström

MDEV-26223 Galera cluster node consider old server_id value even after...

MDEV-26223 Galera cluster node consider old server_id value even after modification of server_id [wsrep_gtid_mode=ON]

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: default avatarJan Lindström <jan.lindstrom@mariadb.com>
parent cce33787
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment