Revert enabling IO uring in db_stress (#11242)

Summary:
IO uring usage is causing crash test failures due to bad cqe data being returned in the uring. Revert the change to enable IO uring in db_stress, and also re-enable async_io in CircleCI so that code path can be tested. Added the -use_io_uring flag to db_stress that, when false, will wrap the default env in db_stress to emulate async IO.

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

Reviewed By: akankshamahajan15

Differential Revision: D43470569

Pulled By: anand1976

fbshipit-source-id: 7c69ac3f53a79ade31d37313f815f1a4b6108b75
This commit is contained in:
anand76 2023-02-21 12:53:55 -08:00 committed by Facebook GitHub Bot
parent 1b48ecc2c6
commit 476b01579c
4 changed files with 13 additions and 4 deletions

View File

@ -516,7 +516,7 @@ jobs:
resource_class: large resource_class: large
steps: steps:
- pre-steps - pre-steps
- run: ulimit -S -n `ulimit -H -n` && make V=1 -j8 CRASH_TEST_EXT_ARGS='--duration=960 --max_key=2500000 --async_io=0' blackbox_crash_test_with_atomic_flush - run: ulimit -S -n `ulimit -H -n` && make V=1 -j8 CRASH_TEST_EXT_ARGS='--duration=960 --max_key=2500000 --use_io_uring=0' blackbox_crash_test_with_atomic_flush
- post-steps - post-steps
build-linux-crashtest-tiered-storage-bb: build-linux-crashtest-tiered-storage-bb:
@ -526,7 +526,7 @@ jobs:
- pre-steps - pre-steps
- run: - run:
name: "run crashtest" name: "run crashtest"
command: ulimit -S -n `ulimit -H -n` && make V=1 -j32 CRASH_TEST_EXT_ARGS='--duration=10800 --async_io=0' blackbox_crash_test_with_tiered_storage command: ulimit -S -n `ulimit -H -n` && make V=1 -j32 CRASH_TEST_EXT_ARGS='--duration=10800 --use_io_uring=0' blackbox_crash_test_with_tiered_storage
no_output_timeout: 100m no_output_timeout: 100m
- post-steps - post-steps
@ -537,7 +537,7 @@ jobs:
- pre-steps - pre-steps
- run: - run:
name: "run crashtest" name: "run crashtest"
command: ulimit -S -n `ulimit -H -n` && make V=1 -j32 CRASH_TEST_EXT_ARGS='--duration=10800 --async_io=0' whitebox_crash_test_with_tiered_storage command: ulimit -S -n `ulimit -H -n` && make V=1 -j32 CRASH_TEST_EXT_ARGS='--duration=10800 --use_io_uring=0' whitebox_crash_test_with_tiered_storage
no_output_timeout: 100m no_output_timeout: 100m
- post-steps - post-steps

View File

@ -321,6 +321,7 @@ DECLARE_uint64(readahead_size);
DECLARE_uint64(initial_auto_readahead_size); DECLARE_uint64(initial_auto_readahead_size);
DECLARE_uint64(max_auto_readahead_size); DECLARE_uint64(max_auto_readahead_size);
DECLARE_uint64(num_file_reads_for_auto_readahead); DECLARE_uint64(num_file_reads_for_auto_readahead);
DECLARE_bool(use_io_uring);
constexpr long KB = 1024; constexpr long KB = 1024;
constexpr int kRandomValueMaxFactor = 3; constexpr int kRandomValueMaxFactor = 3;

View File

@ -1073,6 +1073,7 @@ DEFINE_uint64(stats_dump_period_sec,
ROCKSDB_NAMESPACE::Options().stats_dump_period_sec, ROCKSDB_NAMESPACE::Options().stats_dump_period_sec,
"Gap between printing stats to log in seconds"); "Gap between printing stats to log in seconds");
extern "C" bool RocksDbIOUringEnable() { return true; } DEFINE_bool(use_io_uring, false, "Enable the use of IO uring on Posix");
extern "C" bool RocksDbIOUringEnable() { return FLAGS_use_io_uring; }
#endif // GFLAGS #endif // GFLAGS

View File

@ -99,6 +99,13 @@ int db_stress_tool(int argc, char** argv) {
env_wrapper_guard = std::make_shared<CompositeEnvWrapper>( env_wrapper_guard = std::make_shared<CompositeEnvWrapper>(
raw_env, std::make_shared<DbStressFSWrapper>(raw_env->GetFileSystem())); raw_env, std::make_shared<DbStressFSWrapper>(raw_env->GetFileSystem()));
if (!env_opts && !FLAGS_use_io_uring) {
// If using the default Env (Posix), wrap DbStressEnvWrapper with the
// legacy EnvWrapper. This is a workaround to prevent MultiGet and scans
// from failing when IO uring is disabled. The EnvWrapper
// has a default implementation of ReadAsync that redirects to Read.
env_wrapper_guard = std::make_shared<EnvWrapper>(env_wrapper_guard);
}
db_stress_env = env_wrapper_guard.get(); db_stress_env = env_wrapper_guard.get();
FLAGS_rep_factory = StringToRepFactory(FLAGS_memtablerep.c_str()); FLAGS_rep_factory = StringToRepFactory(FLAGS_memtablerep.c_str());