diff --git a/db/db_test.cc b/db/db_test.cc index 188cfff3d..20fdbd290 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -5555,9 +5555,6 @@ TEST(DBTest, TransactionLogIteratorMoveOverZeroFiles) { } while (ChangeCompactOptions()); } -// TODO(kailiu) disable the in non-linux platforms to temporarily solve -// // the unit test failure. -#ifdef OS_LINUX TEST(DBTest, TransactionLogIteratorStallAtLastRecord) { do { Options options = OptionsForLogIterTest(); @@ -5575,7 +5572,6 @@ TEST(DBTest, TransactionLogIteratorStallAtLastRecord) { ASSERT_TRUE(iter->Valid()); } while (ChangeCompactOptions()); } -#endif TEST(DBTest, TransactionLogIteratorJustEmptyFile) { do { diff --git a/util/env_posix.cc b/util/env_posix.cc index 9e76a126d..5cbd5bd00 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -182,6 +182,9 @@ class PosixSequentialFile: public SequentialFile { if (r < n) { if (feof(file_)) { // We leave status as ok if we hit the end of the file + // We also clear the error so that the reads can continue + // if a new data is written to the file + clearerr(file_); } else { // A partial read with an error: return a non-ok status s = IOError(filename_, errno);