Skip to content

Commit 705b878

Browse files
committed
MDEV-18983 WIP 2
1 parent 6556570 commit 705b878

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

mysql-test/main/mysqld--help.result

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,9 +1282,14 @@ The following specify which files/extra groups are read (specified before remain
12821282
replication in the master
12831283
--rpl-semi-sync-master-trace-level=#
12841284
The tracing level for semi-sync replication
1285+
--rpl-semi-sync-master-wait-for-slave-count=#
1286+
The number of slaves that need to acknowledge that they
1287+
have received a transaction before the transaction can
1288+
complete on the master
12851289
--rpl-semi-sync-master-wait-no-slave
1286-
Wait until timeout when no semi-synchronous replication
1287-
slave is available
1290+
Wait until timeout when less than
1291+
`rpl_semi_sync_master_wait_for_slave_count`
1292+
semi-synchronous replication slaves are available
12881293
(Defaults to on; use --skip-rpl-semi-sync-master-wait-no-slave to disable.)
12891294
--rpl-semi-sync-master-wait-point=name
12901295
Should transaction wait for semi-sync ack after having
@@ -1991,6 +1996,7 @@ rowid-merge-buff-size 8388608
19911996
rpl-semi-sync-master-enabled FALSE
19921997
rpl-semi-sync-master-timeout 10000
19931998
rpl-semi-sync-master-trace-level 32
1999+
rpl-semi-sync-master-wait-for-slave-count 1
19942000
rpl-semi-sync-master-wait-no-slave TRUE
19952001
rpl-semi-sync-master-wait-point AFTER_COMMIT
19962002
rpl-semi-sync-slave-delay-master FALSE

sql/semisync_master.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -679,17 +679,14 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id,
679679

680680
if (need_copy_send_pos)
681681
{
682-
DBUG_ASSERT(m_active_tranxs);
683-
Tranx_node *entry=
684-
m_active_tranxs->get_tranx_node(log_file_name, log_file_pos);
685-
DBUG_ASSERT(entry);
682+
Tranx_node *entry;
683+
strmake_buf(m_reply_file_name, log_file_name);
684+
m_reply_file_pos = log_file_pos;
685+
m_reply_file_name_inited = true;
686686

687-
if (++(entry->acks) >= rpl_semi_sync_master_wait_for_slave_count)
687+
entry= m_active_tranxs->get_tranx_node(log_file_name, log_file_pos);
688+
if (entry && ++(entry->acks) >= rpl_semi_sync_master_wait_for_slave_count)
688689
{
689-
strmake_buf(m_reply_file_name, log_file_name);
690-
m_reply_file_pos = log_file_pos;
691-
m_reply_file_name_inited = true;
692-
693690
/* Remove all active transaction nodes before this point. */
694691
m_active_tranxs->clear_active_tranx_nodes(log_file_name, log_file_pos,
695692
signal_waiting_transaction);

sql/semisync_master.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class Tranx_node_allocator
130130
trx_node->log_pos= 0;
131131
trx_node->next= 0;
132132
trx_node->hash_next= 0;
133+
trx_node->acks= 0;
133134
return trx_node;
134135
}
135136

0 commit comments

Comments
 (0)