MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:October 9 2008 2:07pm
Subject:bzr commit into mysql-6.0-falcon-team branch (vvaintroub:2860) Bug#39212
View as plain text  
#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 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

=== 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);

Thread
bzr commit into mysql-6.0-falcon-team branch (vvaintroub:2860) Bug#39212Vladislav Vaintroub9 Oct