diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-08-30 10:53:49 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-08-30 10:53:49 +0200 |
commit | 10802c4d9046fd54bf1a27cb7611c182ecde93fb (patch) | |
tree | 7dd0f391ecde085d8f47990da25869298d14969c /include | |
parent | 0536c506ff7c3ed261abc3d02fb787bfdd228abb (diff) | |
download | mariadb-git-10802c4d9046fd54bf1a27cb7611c182ecde93fb.tar.gz |
MDEV-381: fdatasync() does not correctly flush growing binlog file.
When we append data to the binlog file, we use fdatasync() to ensure
the data gets to disk so that crash recovery can work.
Unfortunately there seems to be a bug in ext3/ext4 on linux, so that
fdatasync() does not correctly sync all data when the size of a file
is increased. This causes crash recovery to not work correctly (it
loses transactions from the binlog).
As a work-around, use fsync() for the binlog, not fdatasync(). Since
we are increasing the file size, (correct) fdatasync() will most
likely not be faster than fsync() on any file system, and fsync()
does work correctly on ext3/ext4. This avoids the need to try to
detect if we are running on buggy ext3/ext4.
Diffstat (limited to 'include')
-rw-r--r-- | include/my_sys.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index db22f55f492..ebe643abce5 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -70,6 +70,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */ #define MY_SYNC 4096 /* my_copy(): sync dst file */ #define MY_SYNC_DIR 32768 /* my_create/delete/rename: sync directory */ +#define MY_SYNC_FILESIZE 65536 /* my_sync(): safe sync when file is extended */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ |