Continue to deflake BackupEngineTest.Concurrency (#10228)

Summary:
Even after https://github.com/facebook/rocksdb/issues/10069, `BackupEngineTest.Concurrency` is still flaky with decreased probability of failure.

Repro steps as follows
```bash
make backup_engine_test
gtest-parallel -r 1000 -w 64 ./backup_engine_test --gtest_filter=BackupEngineTest.Concurrency
```

The first two commits of this PR demonstrate how the test is flaky. https://github.com/facebook/rocksdb/issues/10069 handles the case in which
`Rename()` file returns `IOError` with subcode `PathNotFound`, and `CreateLoggerFromOptions()`
allows the operation to succeed, as expected by the test. However, `BackupEngineTest` uses
`RemapFileSystem` on top of `ChrootFileSystem` which can return `NotFound` instead of `IOError`.

This behavior is different from `Env::Default()` which returns PathNotFound if the src of `rename()`
does not exist. We should make the behaviors of the test Env/FS match a real Env/FS.

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

Test Plan:
```bash
make check
gtest-parallel -r 1000 -w 64 ./backup_engine_test --gtest_filter=BackupEngineTest.Concurrency
```

Reviewed By: pdillinger

Differential Revision: D37337241

Pulled By: riversand963

fbshipit-source-id: 07a53115e424467b55a731866e571f0ad4c6635d
main
Yanqin Jin 3 years ago committed by Facebook GitHub Bot
parent 9586dcf1ce
commit 36fefd7e22
  1. 4
      env/fs_remap.cc

4
env/fs_remap.cc vendored

@ -268,6 +268,10 @@ IOStatus RemapFileSystem::RenameFile(const std::string& src,
IODebugContext* dbg) { IODebugContext* dbg) {
auto status_and_src_enc_path = EncodePath(src); auto status_and_src_enc_path = EncodePath(src);
if (!status_and_src_enc_path.first.ok()) { if (!status_and_src_enc_path.first.ok()) {
if (status_and_src_enc_path.first.IsNotFound()) {
const IOStatus& s = status_and_src_enc_path.first;
status_and_src_enc_path.first = IOStatus::PathNotFound(s.ToString());
}
return status_and_src_enc_path.first; return status_and_src_enc_path.first;
} }
auto status_and_dest_enc_path = EncodePathWithNewBasename(dest); auto status_and_dest_enc_path = EncodePathWithNewBasename(dest);

Loading…
Cancel
Save