Bug #60788 | InnoDB crashes with an assertion failure when receiving a signal on pwrite() | ||
---|---|---|---|
Submitted: | 7 Apr 2011 7:10 | Modified: | 17 Dec 2012 18:32 |
Reporter: | Alexey Kopytov | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[7 Apr 2011 7:10]
Alexey Kopytov
[10 Apr 2011 11:56]
Valeriy Kravchuk
Verified by code review. This is what we see in my_pwrite(): ... if ((writenbytes= pwrite(Filedes, Buffer, Count,offset)) == Count) break; my_errno= errno; ... if ((writenbytes && writenbytes != (size_t) -1) || my_errno == EINTR) continue; /* Retry */ ... Nothing like this in os_file_pwrite() implementation.
[17 Dec 2012 18:32]
Omer Barnir
Duplicate/ will be fixed by bug#54160
[19 Dec 2013 13:24]
Laurynas Biveinis
This bug has been closed as a duplicate of bug 54160, which in turn has been fixed in 5.7 presumably by [1]. That fix handles the partial read/write case correctly, but not the EINTR case with -1 returned (i.e. interruption before the first byte transferred). By code review it looks like the following would happen for such EINTR with -1 from syscall: writes would return failure without any retries, and reads would be retried or failed depending on srv_use_native_aio value (which here would apply to sync reads). If this is correct, then this bug cannot be considered fully fixed. [1] mysql-server$ bzr log -r 4334 ------------------------------------------------------------ revno: 4334 committer: Aditya A <aditya.a@oracle.com> branch nick: mysql-trunk timestamp: Mon 2012-08-27 10:57:55 +0530 message: BUG#11761646 - INNODB SHOULD RETRY ON FAILED READ OR WRITE, NOT IMMEDIATELY PANIC Related: http://bugs.mysql.com/bug.php?id=54430 (innodb should retry partial reads/writes where errno was 0) Summary ------- In the Linux flavours the read and write system calls can do partial reads and writes. The man page of read says that " The return value is is smaller than the number of bytes requested; this may happen for example because fewer bytes are actually available right now (maybe because we were close to end-of-file,or because we are reading from a pipe, or from a terminal), or because read() was interrupted by a signal." The Fix ------- Initially InnoDB was not handling the partial read and writes.With this fix innodb tries NUM_RETRIES_ON_PARTIAL_IO (which by default is equal to 10)times to read or write the partial data .The fix also takes care of partial read and write in case of Linux native API's where read and write are asynyncronus operations. rb:1158 [approved by inaam.rana]