Bug#27805553 HARD ERROR SHOULD BE REPORTED WHEN FSYNC() RETURN EIO.

fsync() will just return EIO only once when the IO error happens, so, it's
wrong to keep trying to call it till it return success.
When fsync() returns EIO it should be treated as a hard error and InnoDB must
abort immediately.
This commit is contained in:
Allen Lai 2018-04-08 09:16:56 +08:00 committed by Marko Mäkelä
parent a1b2336199
commit f70a318576

View file

@ -2493,30 +2493,15 @@ os_file_fsync_posix(
os_thread_sleep(200000);
break;
case EIO:
++failures;
ut_a(failures < 1000);
if (!(failures % 100)) {
ib::warn()
<< "fsync(): "
<< "An error occurred during "
<< "synchronization,"
<< " retrying";
}
/* 0.2 sec */
os_thread_sleep(200000);
break;
case EINTR:
++failures;
ut_a(failures < 2000);
break;
case EIO:
ib::error() << "fsync() returned EIO, aborting";
/* fall through */
default:
ut_error;
break;