From a0bfdef5e6f8a26d9fdb0f518feee697312a6482 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 4 Dec 2024 11:31:00 +0200 Subject: [PATCH] Added more information to errors reported by report_reply_packet() In particular ""Read semi-sync reply magic number error" now prints out what was wrong with the packet. Reviewed-by: Sergei Golubchik --- sql/semisync_master.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sql/semisync_master.cc b/sql/semisync_master.cc index 7694c2cfd49..437b9bb99b4 100644 --- a/sql/semisync_master.cc +++ b/sql/semisync_master.cc @@ -608,13 +608,17 @@ int Repl_semi_sync_master::report_reply_packet(uint32 server_id, DBUG_RETURN(-1); } else - sql_print_error("Read semi-sync reply magic number error"); + sql_print_error("Read semi-sync reply magic number error. " + "Got magic: %u command %u length: %lu", + (uint) packet[REPLY_MAGIC_NUM_OFFSET], (uint) packet[0], + packet_len); goto l_end; } if (unlikely(packet_len < REPLY_BINLOG_NAME_OFFSET)) { - sql_print_error("Read semi-sync reply length error: packet is too small"); + sql_print_error("Read semi-sync reply length error: packet is too small: %lu", + packet_len); goto l_end; } @@ -622,7 +626,8 @@ int Repl_semi_sync_master::report_reply_packet(uint32 server_id, log_file_len = packet_len - REPLY_BINLOG_NAME_OFFSET; if (unlikely(log_file_len >= FN_REFLEN)) { - sql_print_error("Read semi-sync reply binlog file length too large"); + sql_print_error("Read semi-sync reply binlog file length too large: %llu", + (ulonglong) log_file_pos); goto l_end; } strncpy(log_file_name, (const char*)packet + REPLY_BINLOG_NAME_OFFSET, log_file_len);