[MDEV-18585] Annotate_rows_log_event written for each wsrep streaming fragment Created: 2019-02-14  Updated: 2024-01-31  Resolved: 2019-02-18

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.4
Fix Version/s: 10.4.3

Type: Bug Priority: Major
Reporter: Teemu Ollakka Assignee: Teemu Ollakka
Resolution: Fixed Votes: 0
Labels: None


 Description   

Annotate_rows_log_event is written for each wsrep streaming fragment.

To reproduce, start servers with the following options:

wsrep-trx-fragment-size=1
wsrep-trx-fragment-unit=ROWS
log-bin
log-slave-updates
log-bin-index=binlog-index

Run the following statements:

CREATE TABLE t1 (f1 INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2);

Now binlog contains INSERT statement twice:

$ .mysqlbinlog mysqld-bin.000003 | grep '#Q> INSERT INTO'
#Q> INSERT INTO t1 VALUES (1),(2)
#Q> INSERT INTO t1 VALUES (1),(2)

This behavior will effectively make replication traffic scale as N^2 with small fragment sizes and bulk inserts with N rows.



 Comments   
Comment by Teemu Ollakka [ 2019-02-14 ]

This is especially pronounced when running sysbench prepare with `binlog-annotate-row-events=ON` and streaming replication enabled:

sysbench oltp_read_write --table-size=100000 prepare

Generated at Thu Feb 08 08:45:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.