summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-28 11:25:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-28 11:25:21 +0300
commit4ce6e78059c1a91765c91afa5330737bd7568d0a (patch)
tree94e684c003fa5e171e62bc59178b72ae107b2ba9 /sql/slave.cc
parent0149abf66ff8fd7893cd24cd7381ea5e59f6b91b (diff)
parentf53f64b7b9edaef8e413add322225dc33ebc8131 (diff)
downloadmariadb-git-4ce6e78059c1a91765c91afa5330737bd7568d0a.tar.gz
Merge 10.9 into 10.10
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc31
1 files changed, 16 insertions, 15 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 616e1248738..26743e1c781 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -5111,6 +5111,7 @@ err_during_init:
mi->abort_slave= 0;
mi->slave_running= MYSQL_SLAVE_NOT_RUN;
mi->io_thd= 0;
+ mi->do_accept_own_server_id= false;
/*
Note: the order of the two following calls (first broadcast, then unlock)
is important. Otherwise a killer_thread can execute between the calls and
@@ -6252,15 +6253,6 @@ static int queue_event(Master_info* mi, const uchar *buf, ulong event_len)
bool is_malloc = false;
bool is_rows_event= false;
/*
- The flag has replicate_same_server_id semantics and is raised to accept
- a same-server-id event group by the gtid strict mode semisync slave.
- Own server-id events can appear as result of this server crash-recovery:
- the transaction was created on this server then being master, got replicated
- elsewhere right before the crash before commit;
- finally at recovery the transaction gets evicted from the server's binlog.
- */
- bool do_accept_own_server_id;
- /*
FD_q must have been prepared for the first R_a event
inside get_master_version_and_clock()
Show-up of FD:s affects checksum_alg at once because
@@ -6867,6 +6859,19 @@ dbug_gtid_accept:
++mi->events_queued_since_last_gtid;
inc_pos= event_len;
+
+ /*
+ To compute `true` is normal for this *now* semisync slave server when
+ it has passed its crash-recovery as a former master.
+ */
+ mi->do_accept_own_server_id=
+ (s_id == global_system_variables.server_id &&
+ rpl_semi_sync_slave_enabled && opt_gtid_strict_mode &&
+ mi->using_gtid != Master_info::USE_GTID_NO &&
+ !mysql_bin_log.check_strict_gtid_sequence(event_gtid.domain_id,
+ event_gtid.server_id,
+ event_gtid.seq_no,
+ true));
// ...} eof else_likely
}
break;
@@ -7049,10 +7054,6 @@ dbug_gtid_accept:
break;
}
- do_accept_own_server_id= (s_id == global_system_variables.server_id
- && rpl_semi_sync_slave_enabled && opt_gtid_strict_mode
- && mi->using_gtid != Master_info::USE_GTID_NO);
-
/*
Integrity of Rows- event group check.
A sequence of Rows- events must end with STMT_END_F flagged one.
@@ -7143,7 +7144,7 @@ dbug_gtid_accept:
else
if ((s_id == global_system_variables.server_id &&
!(mi->rli.replicate_same_server_id ||
- do_accept_own_server_id)) ||
+ mi->do_accept_own_server_id)) ||
event_that_should_be_ignored(buf) ||
/*
the following conjunction deals with IGNORE_SERVER_IDS, if set
@@ -7203,7 +7204,7 @@ dbug_gtid_accept:
}
else
{
- if (do_accept_own_server_id)
+ if (mi->do_accept_own_server_id)
{
int2store(const_cast<uchar*>(buf + FLAGS_OFFSET),
uint2korr(buf + FLAGS_OFFSET) | LOG_EVENT_ACCEPT_OWN_F);