#At file:///media/disk/bzr/mysql-6.0-falcon-team/
2860 Vladislav Vaintroub 2008-10-09
Bug#39212 Falcon exception on recovery when one of the log files
is empty
Reason is a bug with reiserfs file system - read of a file of
size 1 to 4095 returns error (EINVAL), if file is opened with
O_DIRECT. ext3 behaves correct and returns number of bytes read.
Solved with workaround: initial size of serial log files is now
at least 4096 bytes.
modified:
storage/falcon/SerialLogFile.cpp
=== modified file 'storage/falcon/SerialLogFile.cpp'
--- a/storage/falcon/SerialLogFile.cpp 2008-09-12 17:01:24 +0000
+++ b/storage/falcon/SerialLogFile.cpp 2008-10-09 11:27:17 +0000
@@ -362,8 +362,11 @@ int64 SerialLogFile::size(void)
void SerialLogFile::zap()
{
- UCHAR *junk = new UCHAR[sectorSize * 2];
- //UCHAR *buffer = (UCHAR*) (((UIPTR) junk + sectorSize - 1) / sectorSize * sectorSize);
+ // HACK: Files of size between 1 and 4095 bytes cannot be read on
+ // linux on reiserfs file system, if file is opened with O_DIRECT.
+ // Hence initialSize below is 4K at least.
+ size_t initialSize = MAX(sectorSize, 4096);
+ UCHAR *junk = new UCHAR[initialSize +sectorSize];
UCHAR *buffer = ALIGN(junk, sectorSize);
memset(buffer, 0, sectorSize);
write(0, sectorSize, (SerialLogBlock*) buffer);
| Thread |
|---|
| • bzr commit into mysql-6.0-falcon-team branch (vvaintroub:2860) Bug#39212 | Vladislav Vaintroub | 9 Oct |