Skip to content

Commit

Permalink
Introduce FaultInjectionTestFS to test fault File system instead of E…
Browse files Browse the repository at this point in the history
…nv (#6414)

Summary:
In the current code base, we can use FaultInjectionTestEnv to simulate the env issue such as file write/read errors, which are used in most of the test. The PR facebook/rocksdb#5761 introduce the File System as a new Env API. This PR implement the FaultInjectionTestFS, which can be used to simulate when File System has issues such as IO error. user can specify any IOStatus error as input, such that FS corresponding actions will return certain error to the caller.

A set of ErrorHandlerFSTests are introduced for testing
Pull Request resolved: facebook/rocksdb#6414

Test Plan: pass make asan_check, pass error_handler_fs_test.

Differential Revision: D20252421

Pulled By: zhichao-cao

fbshipit-source-id: e922038f8ce7e6d1da329fd0bba7283c4b779a21
Signed-off-by: Changlong Chen <levisonchen@live.cn>
  • Loading branch information
zhichao-cao authored and levichen94 committed Sep 14, 2021
1 parent 53452b5 commit 68c8b1a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/rocksdb/io_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,7 @@ inline IOStatus& IOStatus::operator=(IOStatus&& s)
subcode_ = std::move(s.subcode_);
s.subcode_ = kNone;
retryable_ = s.retryable_;
retryable_ = false;
data_loss_ = s.data_loss_;
data_loss_ = false;
scope_ = s.scope_;
scope_ = kIOErrorScopeFileSystem;
delete[] state_;
Expand Down

0 comments on commit 68c8b1a

Please sign in to comment.