Description:
When performing a mysqldump with the --dump-slave or --dump-replica parameters on a slave server, it writes flush tables related records to the slave's binlog. However, when I tested this on MySQL 5.7.27, it did not write any information to the binlog.
How to repeat:
(root@localhost) [as_crm]> select @@server_uuid;
+--------------------------------------+
| @@server_uuid |
+--------------------------------------+
| f6f64c24-667f-11ee-9bb7-028c98eda612 |
+--------------------------------------+
1 row in set (0.00 sec)
(root@localhost) [as_crm]> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.32 |
+-----------+
1 row in set (0.00 sec)
before:
(root@localhost) [(none)]> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000447
Position: 75365549
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: 3905460f-5c0f-11e9-8580-028c98eda612:1-4304093,
6efbca19-06ae-11ea-a0b6-0210931c4d7c:1-229872,
1 row in set (0.01 sec)
command:
mysqldump -uxxxxxx -pxxxxxx -S /tmp/mysql.sock -R --triggers --hex-blob --single-transaction --dump-slave=2 --max_allowed_packet=512M --default-character_set=utf8 --tables test01
after:
(root@localhost) [(none)]> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000447
Position: 75365549
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: 3905460f-5c0f-11e9-8580-028c98eda612:1-4304093,
6efbca19-06ae-11ea-a0b6-0210931c4d7c:1-229872,
f6f64c24-667f-11ee-9bb7-028c98eda612:1-1
1 row in set (0.01 sec)
mysqlbinlog -vv --base64-ouput=decode-rows mysql-bin.000447
......
SET @@SESSION.GTID_NEXT= 'f6f64c24-667f-11ee-9bb7-028c98eda612:1'/*!*/;
# at 1482592
#231009 2:58:37 server id 18116 end_log_pos 1482670 CRC32 0xd9808ad4 Query thread_id=68 exec_time=0 error_code=0
SET TIMESTAMP=1696845517/*!*/;
SET @@session.sql_mode=0/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=255/*!*/;
FLUSH TABLES
/*!*/;
# at 1482670
#231009 2:58:37 server id 18116 end_log_pos 1482747 CRC32 0x86f69503 GTID last_committed=1678 sequence_number=1679 rbr_only=no original_committed_timestamp=1696845517913227 immediate_commit_timestamp=1696845517913227 transaction_length=155
......