diff --git a/db/db_test.cc b/db/db_test.cc index 188cfff3da0ef594dd5f7032f5ab96967ee7abd1..20fdbd290f49f8dac18497ce6e93dca7692becd3 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 9e76a126dcd4cbb8db685f2d705b3f02726dc655..5cbd5bd009d845197424f76c2a59f1476330d006 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);