server
server copied to clipboard
MDEV-21322: report slave progress to the master
-
We are trying to extend the command
SHOW REPLICA HOSTS
that is executed on master, with columnsGTID_state_sent
andGTID_state_ack
. In order to achieve that we have to extendthd->slave_info
struct with 2 new entries. This struct needs to be populated and must be accessable to primary. -
The first column
GTID_state_sent
:- It is populated by the last event that primary has sent to replica (only for semi-sync slave connection, but without need to know that replica actually obtained request, like it is case in asynchronous replication).
- Primary executes
mysql_binlog
that first starts thebinlog_dump
thread. That thread startsack_receiver
thread, that returns second column of interest (in first iteration we don't care about). Afterbinlog_dump
thread creating, file is sent withsend_one_binlog_file()
function. This function is sending event withsend_events()
function, during whichsend_event_to_slave()
function is executed. On that place we are creating thethd->slave_info->gtid_state_sent
struct.
-
The second column
GTID_state_ack
:- It is populated by the
reply_packet_binlog
(a.k.a.ack
) that is called, only for semi-sync replication. It is called on 2 places: a) duringbinlog_dump
creation, after thread is added toack_reciver
and after thread is added as semi-sync slave. This should be first ack received from replica to primary. b) constantly in running phase ofack_receiver
threadrun()
. - A the end of function
reply_packet_binlog
we are creating the structGTID_state_ack
- It is populated by the
- Closes PR#1427
Hi @bnestere I have created first part of your review (wip patch)- busy replica and there are some questions/problems with tests. Tests are simulating busy replica and I have 2 problems (as stated in commit message, please see the results there).
- randomnes of events for
test 7
(problem ofcorrupt_queue_event
) - cannot save the result (problem of
corrupt_queue_event
) Please let me know your opinion about :).
Hi Anel!
There are a few comments that are still relevant.
- https://github.com/MariaDB/server/pull/2374/files#r1223168309 why did you resolve this?
- https://github.com/MariaDB/server/pull/2374/files#r1510014937
- https://github.com/MariaDB/server/pull/2374/files#r1195561416
Thank you. Review is addressed with commit https://github.com/MariaDB/server/pull/2374/commits/e53ff4d34486de68d4414e8e9763a9ae8bbf5b28