From: Date: October 9 2008 4:09pm Subject: bzr push into mysql-6.0-falcon-team branch (vvaintroub:2859 to 2860) Bug#39212 List-Archive: http://lists.mysql.com/commits/55939 X-Bug: 39212 Message-Id: <200810091409.m99E9UwB019925@u64> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 2860 Vladislav Vaintroub 2008-10-09 Bug#39212 Falcon exception on recovery when one of the log files is empty Reason is a bug in reiserfs file system. The serial log file is initially 512 bytes. On reiserfs, for files opened with O_DIRECT, read() will fail if file size is between 1 to 4095 returns error (EINVAL). The bug supposedly occurs because file size is smaller than page size. Solved with a workaround: initial size of serial log files is now 8K (we assume largest page size we need to deal with is 8KB). modified: storage/falcon/SerialLogFile.cpp 2859 Stewart Smith 2008-10-09 [merge] merge NDB INFORMATION_SCHEMA.TABLESPACES added: mysql-test/suite/ndb/r/ndb_dd_is_talbespaces.result mysql-test/suite/ndb/t/ndb_dd_is_talbespaces.test modified: sql/ha_ndbcluster.cc === 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 14:07:09 +0000 @@ -362,8 +362,12 @@ 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. + // The error is supposedly related to the file size being less than + // page size, so initial size is made 8K just in case we'll ever run on IA64 + size_t initialSize = MAX(sectorSize, 8192); + UCHAR *junk = new UCHAR[initialSize +sectorSize]; UCHAR *buffer = ALIGN(junk, sectorSize); memset(buffer, 0, sectorSize); write(0, sectorSize, (SerialLogBlock*) buffer);