Bug #54430 innodb should retry partial reads/writes where errno was 0
Submitted: 11 Jun 2010 14:20 Modified: 16 Oct 2012 23:46
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.1.47 OS:Linux (rhel)
Assigned to: Inaam Rana CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request) / R3 (Medium) / E4 (High)

[11 Jun 2010 14:20] Shane Bester
Description:
in many cases we have situations like:

InnoDB: 10485760 bytes should have been written, only 10203136 were written.
InnoDB: Operating system error number 0.

and

InnoDB: Error: tried to read 294912 bytes at offset 0 753664.
InnoDB: Was only able to read 225280.
080131 15:19:01 InnoDB: Operating system error number 0 in a file operation.
InnoDB: Error number 0 means 'Success'.

Error number 0 is not too useful, and this is a request to retry the operation in this case, at least until a specific error can be returned.  One problem is when disk is out of space, the failure may show errno=0 instead of ENOSPC, and this changes error reporting within innodb, which doesn't immediately return OS_FILE_DISK_FULL

How to repeat:
i'm not too sure how partial read/writes can even happen, or if they should happen, but there are many occurrences of "Operating system error number 0" on google..

Suggested fix:
find out in which cases/platforms a partial write or read may be encountered, and retry the operation a number of times.
[29 Dec 2011 5:30] Shane Bester
related:
http://bugs.mysql.com/bug.php?id=54160
(InnoDB should retry on failed read or write, not immediately panic)
[16 Oct 2012 23:46] John Russell
Added to changelog for 5.7.0: 

On Linux systems, certain I/O requests that read or wrote fewer than
the requested number of bytes could cause the server to crash. This
issue could happen more frequently with asynchronous I/O requests.
The messages did not clearly identify what type of error occurred:

InnoDB: Operating system error number 0 in a file operation.
InnoDB: Error number 0 means 'Success'.

With this fix, MySQL retries the
operation several times before giving up. (The number of retries is
defined by the constant NUM_RETRIES_ON_PARTIAL_IO in the source code,
default value 10.)
[28 Dec 2012 23:48] Sveta Smirnova
Bug #67606 was closed as duplicate of this one.