Skip to content

Commit 476b015

Browse files
anand1976facebook-github-bot
authored andcommitted
Revert enabling IO uring in db_stress (facebook#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: facebook#11242 Reviewed By: akankshamahajan15 Differential Revision: D43470569 Pulled By: anand1976 fbshipit-source-id: 7c69ac3f53a79ade31d37313f815f1a4b6108b75
1 parent 1b48ecc commit 476b015

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ jobs:
516516
resource_class: large
517517
steps:
518518
- pre-steps
519-
- 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
519+
- 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
520520
- post-steps
521521

522522
build-linux-crashtest-tiered-storage-bb:
@@ -526,7 +526,7 @@ jobs:
526526
- pre-steps
527527
- run:
528528
name: "run crashtest"
529-
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
529+
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
530530
no_output_timeout: 100m
531531
- post-steps
532532

@@ -537,7 +537,7 @@ jobs:
537537
- pre-steps
538538
- run:
539539
name: "run crashtest"
540-
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
540+
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
541541
no_output_timeout: 100m
542542
- post-steps
543543

db_stress_tool/db_stress_common.h

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ DECLARE_uint64(readahead_size);
321321
DECLARE_uint64(initial_auto_readahead_size);
322322
DECLARE_uint64(max_auto_readahead_size);
323323
DECLARE_uint64(num_file_reads_for_auto_readahead);
324+
DECLARE_bool(use_io_uring);
324325

325326
constexpr long KB = 1024;
326327
constexpr int kRandomValueMaxFactor = 3;

db_stress_tool/db_stress_gflags.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,7 @@ DEFINE_uint64(stats_dump_period_sec,
10731073
ROCKSDB_NAMESPACE::Options().stats_dump_period_sec,
10741074
"Gap between printing stats to log in seconds");
10751075

1076-
extern "C" bool RocksDbIOUringEnable() { return true; }
1076+
DEFINE_bool(use_io_uring, false, "Enable the use of IO uring on Posix");
1077+
extern "C" bool RocksDbIOUringEnable() { return FLAGS_use_io_uring; }
10771078

10781079
#endif // GFLAGS

db_stress_tool/db_stress_tool.cc

+7
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ int db_stress_tool(int argc, char** argv) {
9999

100100
env_wrapper_guard = std::make_shared<CompositeEnvWrapper>(
101101
raw_env, std::make_shared<DbStressFSWrapper>(raw_env->GetFileSystem()));
102+
if (!env_opts && !FLAGS_use_io_uring) {
103+
// If using the default Env (Posix), wrap DbStressEnvWrapper with the
104+
// legacy EnvWrapper. This is a workaround to prevent MultiGet and scans
105+
// from failing when IO uring is disabled. The EnvWrapper
106+
// has a default implementation of ReadAsync that redirects to Read.
107+
env_wrapper_guard = std::make_shared<EnvWrapper>(env_wrapper_guard);
108+
}
102109
db_stress_env = env_wrapper_guard.get();
103110

104111
FLAGS_rep_factory = StringToRepFactory(FLAGS_memtablerep.c_str());

0 commit comments

Comments
 (0)