1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-381: fdatasync() does not correctly flush growing binlog file

Revert the old work-around for buggy fdatasync() on Linux ext3. This bug was
fixed in Linux > 10 years ago back to kernel version at least 3.0.

Reviewed-by: Marko Mäkelä <marko.makela@mariadb.com>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2023-08-03 14:20:47 +02:00
parent e9333ff03c
commit 5055490c17
4 changed files with 9 additions and 25 deletions

View File

@ -3730,7 +3730,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
bytes_written+= description_event_for_queue->data_written;
}
if (flush_io_cache(&log_file) ||
mysql_file_sync(log_file.file, MYF(MY_WME|MY_SYNC_FILESIZE)))
mysql_file_sync(log_file.file, MYF(MY_WME)))
goto err;
my_off_t offset= my_b_tell(&log_file);
@ -3768,7 +3768,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
strlen(log_file_name)) ||
my_b_write(&index_file, (uchar*) "\n", 1) ||
flush_io_cache(&index_file) ||
mysql_file_sync(index_file.file, MYF(MY_WME|MY_SYNC_FILESIZE)))
mysql_file_sync(index_file.file, MYF(MY_WME)))
goto err;
#ifdef HAVE_REPLICATION
@ -3908,7 +3908,7 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset)
}
/* The following will either truncate the file or fill the end with \n' */
if (mysql_file_chsize(file, offset - init_offset, '\n', MYF(MY_WME)) ||
mysql_file_sync(file, MYF(MY_WME|MY_SYNC_FILESIZE)))
mysql_file_sync(file, MYF(MY_WME)))
goto err;
/* Reset data in old index cache */
@ -4702,7 +4702,7 @@ int MYSQL_BIN_LOG::sync_purge_index_file()
if (unlikely((error= flush_io_cache(&purge_index_file))) ||
unlikely((error= my_sync(purge_index_file.file,
MYF(MY_WME | MY_SYNC_FILESIZE)))))
MYF(MY_WME)))))
DBUG_RETURN(error);
DBUG_RETURN(error);
@ -5462,7 +5462,7 @@ bool MYSQL_BIN_LOG::flush_and_sync(bool *synced)
if (sync_period && ++sync_counter >= sync_period)
{
sync_counter= 0;
err= mysql_file_sync(fd, MYF(MY_WME|MY_SYNC_FILESIZE));
err= mysql_file_sync(fd, MYF(MY_WME));
if (synced)
*synced= 1;
#ifndef DBUG_OFF
@ -6142,7 +6142,7 @@ MYSQL_BIN_LOG::write_state_to_file()
log_inited= false;
if ((err= end_io_cache(&cache)))
goto err;
if ((err= mysql_file_sync(file_no, MYF(MY_WME|MY_SYNC_FILESIZE))))
if ((err= mysql_file_sync(file_no, MYF(MY_WME))))
goto err;
goto end;