Skip to content

Commit 002330e

Browse files
akshatnehrabnestere
authored andcommitted
MDEV-37120 Improve timeout log message clarity for empty binlog state
Fixed error message confusion in semi-sync replication timeout logs. When no previous successful semi-sync replication exists, the log now shows "(none)" instead of displaying an empty filename. Additionally, changed "semi-sync up to file" to "last semi-sync at file" for better semantic accuracy. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
1 parent e02f4d7 commit 002330e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sql/semisync_master.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,8 @@ int Repl_semi_sync_master::commit_trx(const char *trx_wait_binlog_name,
964964
* semi-sync was turned off then on, so on debug builds, we track
965965
* the number of times semi-sync turned off at binlogging, and compare
966966
* to the current value. */
967-
DBUG_ASSERT(rpl_semi_sync_master_off_times > thd->expected_semi_sync_offs);
967+
DBUG_ASSERT(rpl_semi_sync_master_off_times >
968+
thd->expected_semi_sync_offs);
968969

969970
break;
970971
}
@@ -1033,10 +1034,11 @@ int Repl_semi_sync_master::commit_trx(const char *trx_wait_binlog_name,
10331034
if (wait_result != 0)
10341035
{
10351036
/* This is a real wait timeout. */
1036-
sql_print_warning("Timeout waiting for reply of binlog (file: %s, pos: %lu), "
1037-
"semi-sync up to file %s, position %lu.",
1037+
sql_print_warning("Timeout waiting for reply of binlog (file: %s, pos:"
1038+
" %lu), last semi-sync at file %s, position %lu.",
10381039
trx_wait_binlog_name, (ulong)trx_wait_binlog_pos,
1039-
m_reply_file_name, (ulong)m_reply_file_pos);
1040+
(m_reply_file_name[0] == '\0') ? "(none)" :
1041+
m_reply_file_name, (ulong)m_reply_file_pos);
10401042
rpl_semi_sync_master_wait_timeouts++;
10411043

10421044
/* switch semi-sync off */

0 commit comments

Comments
 (0)