Setting log_slow_replica_statements has no immediate effect. The state of the variable applies on all subsequent START REPLICA statements. Also note that the global setting for long_query_time applies for the lifetime of the SQL thread. If you change that setting, you must stop and restart the replication SQL thread to implement the change there (for example, by issuing STOP REPLICA and START REPLICA statements with the SQL_THREAD option).
#0 Query_logger::slow_log_write (this=0xaaaaef99e760 <query_logger>, thd=0xffff3c291be0, query=0xffff34165cb8"DROP TABLE `tbl` /* generated by server */", query_length=42, aggregate=false, lock_usec=0, exec_usec=0) at /home/wslu/work/mysql/mac-mysql-server/sql/log.cc:1334 #10x0000aaaaead81368in log_slow_do(thd=0xffff3c291be0) at /home/wslu/work/mysql/mac-mysql-server/sql/log.cc:1643 #20x0000aaaaead813a0 in log_slow_statement (thd=0xffff3c291be0) at /home/wslu/work/mysql/mac-mysql-server/sql/log.cc:1660 #30x0000aaaaeb9ce438in Query_log_event::do_apply_event(this=0xffff341ce540, rli=0xffff3402ad80, query_arg=0xffff34165cb8"DROP TABLE `tbl` /* generated by server */", q_len_arg=42) at /home/wslu/work/mysql/mac-mysql-server/sql/log_event.cc:4884 #40x0000aaaaeb9cc840 in Query_log_event::do_apply_event (this=0xffff341ce540, rli=0xffff3402ad80) at /home/wslu/work/mysql/mac-mysql-server/sql/log_event.cc:4447 #50x0000aaaaeb9f43c4 in Log_event::do_apply_event_worker (this=0xffff341ce540, w=0xffff3402ad80) at /home/wslu/work/mysql/mac-mysql-server/sql/log_event.cc:1087 #60x0000aaaaebacb3a4 in Slave_worker::slave_worker_exec_event (this=0xffff3402ad80, ev=0xffff341ce540) at /home/wslu/work/mysql/mac-mysql-server/sql/rpl_rli_pdb.cc:1733 #70x0000aaaaebacda04 in slave_worker_exec_job_group (worker=0xffff3402ad80, rli=0xaaab2f98d4d0) at /home/wslu/work/mysql/mac-mysql-server/sql/rpl_rli_pdb.cc:2457 #80x0000aaaaebae84d4 in handle_slave_worker (arg=0xffff3402ad80) at /home/wslu/work/mysql/mac-mysql-server/sql/rpl_replica.cc:5913 #90x0000aaaaec8356f0 in pfs_spawn_thread (arg=0xffff784dd4e0) at /home/wslu/work/mysql/mac-mysql-server/storage/perfschema/pfs.cc:2942 #100x0000ffff928bd5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442 #110x0000ffff92925d1c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
--- a/sql/log.cc +++ b/sql/log.cc @@ -1295,6 +1295,9 @@ boolQuery_logger::slow_log_write(THD *t /* do not log slow queries from replication threads */ if (thd->slave_thread && !opt_log_slow_replica_statements) returnfalse; + /*when binlog_format=MIXED is set, or that are logged when binlog_format=ROW is set, are not added to the replica's slow query log, even if log_slow_replica_statements is enabled.*/ + if (thd->slave_thread && opt_log_slow_replica_statements && (thd->current_stmt_binlog_format == BINLOG_FORMAT_MIXED ||thd->current_stmt_binlog_format == BINLOG_FORMAT_ROW) ) returnfalse; + /* fill in user_host value: the format is "%s[%s] @ %s [%s]" */ char user_host_buff[MAX_USER_HOST_SIZE + 1]; Security_context *sctx = thd->security_context();