we upgraded to MySQL8, and we started seeing replication lagging. Here are some of the configs:
binlog-format = MIXED
relay_log_info_repository = TABLE
relay_log_recovery = ON
log_replica_updates
expire_logs_days = 30
read_only = 1
There’s not a lot of details in your post. How much lag? Just 1-2s? Or ever increasing lag then suddenly catch up? Use a monitoring tool like Percona Monitoring and Management to visualize your lag issues. What type of queries are you running across replication? Mostly INSERT? UPDATE? DELETE? Any temporary tables (which are replicated in MIXED)?
This can be an issue as MIXED will default to STATEMENT unless otherwise needed. You should always be in ROW, especially now that STATEMENT is deprecated.
Thank you so much for replying ! After upgrade to MySQL8, our DBs are lagging along with traffic, the most busy DB lags the most, and it could lag up to 2 hours or more in some days, it is a mixed combination of INSERTs, UPDATEs and DELETEs.
I do not remember what were the reasons we override the below 2 parameters, but do you have any recommendations?
innodb_io_capacity = 2000
innodb_buffer_pool_chunk_size = 256M
We will definitely try
sync_binlog=0
innodb_flush_log_at_trx_commit=0
You made those changes on the replica, correct? And you changed the source to use ROW? And you have replica_parallel_workers >= 8 and have LOGICAL_CLOCK as the parallel type?