Fix redundant call to update_binlog_end_pos() (probably merge error).

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen 2023-07-25 11:44:16 +02:00
parent f612e1c2bc
commit 038d29258d

View file

@ -7767,15 +7767,19 @@ MYSQL_BIN_LOG::
write_binlog_checkpoint_event_already_locked(const char *name_arg, uint len)
{
my_off_t offset;
bool err;
Binlog_checkpoint_log_event ev(name_arg, len);
/*
Note that we must sync the binlog checkpoint to disk.
Otherwise a subsequent log purge could delete binlogs that XA recovery
thinks are needed (even though they are not really).
*/
if (!write_event(&ev) && !flush_and_sync(0))
err= write_event(&ev) || flush_and_sync(0);
offset= my_b_tell(&log_file);
if (!err)
{
update_binlog_end_pos();
update_binlog_end_pos(offset);
}
else
{
@ -7790,10 +7794,6 @@ write_binlog_checkpoint_event_already_locked(const char *name_arg, uint len)
sql_print_error("Failed to write binlog checkpoint event to binary log");
}
offset= my_b_tell(&log_file);
update_binlog_end_pos(offset);
/*
Take mutex to protect against a reader seeing partial writes of 64-bit
offset on 32-bit CPUs.