rocksdb/logging
Yanqin Jin 5ab5537d79 Deflake unit test BackupEngineTest.Concurrency (#10069)
Summary:
After https://github.com/facebook/rocksdb/issues/9984, BackupEngineTest.Concurrency becomes flaky.

During DB::Open(), someone else can rename/remove the LOG file, causing
this thread's `CreateLoggerFromOptions()` to fail. The reason is that the operation sequence
of "FileExists -> Rename" is not atomic. It's possible that a FileExists() returns OK, but the file
gets deleted before Rename(), causing the latter to return IOError with PathNotFound subcode.

Although it's not encouraged to concurrently modify the contents of the directories managed by
the database instance in this case, we can still perform some simple handling to make DB::Open()
more robust. In this case, we can check if a racing thread has deleted the original LOG file, we can
allow this thread to continue creating a new LOG file.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10069

Test Plan: ~/gtest-parallel/gtest-parallel -r 100 ./backup_engine_test --gtest_filter=BackupEngineTest.Concurrency

Reviewed By: jay-zhuang

Differential Revision: D36736913

Pulled By: riversand963

fbshipit-source-id: 3cbe92d77ca175e55e586bdb1a32ac8107217ae6
2022-05-31 09:36:32 -07:00
..
auto_roll_logger.cc Deflake unit test BackupEngineTest.Concurrency (#10069) 2022-05-31 09:36:32 -07:00
auto_roll_logger.h Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
auto_roll_logger_test.cc Fail DB::Open() if logger cannot be created (#9984) 2022-05-27 07:23:31 -07:00
env_logger.h Fix potential ambiguities in/around port/sys_time.h (#10045) 2022-05-24 18:20:17 -07:00
env_logger_test.cc Make SystemClock into a Customizable Class (#8636) 2021-09-21 09:23:48 -07:00
event_logger.cc Remove unused includes (#7604) 2020-10-28 23:22:27 -07:00
event_logger.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
event_logger_test.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
log_buffer.cc Fix potential ambiguities in/around port/sys_time.h (#10045) 2022-05-24 18:20:17 -07:00
log_buffer.h Fix potential ambiguities in/around port/sys_time.h (#10045) 2022-05-24 18:20:17 -07:00
logging.h Fix info log source file display length (#5824) 2020-04-08 20:18:08 -07:00
posix_logger.h Fix potential ambiguities in/around port/sys_time.h (#10045) 2022-05-24 18:20:17 -07:00