diff --git a/env/io_posix.cc b/env/io_posix.cc index d28d0da99b7..8380491a021 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -1096,7 +1096,6 @@ IOStatus PosixRandomAccessFile::ReadAsync( // Init failed, platform doesn't support io_uring. if (iu == nullptr) { - fprintf(stderr, "failed to init io_uring\n"); return IOStatus::NotSupported("ReadAsync: failed to init io_uring"); } diff --git a/env/io_posix.h b/env/io_posix.h index b660466ea69..7fcc4e64bd5 100644 --- a/env/io_posix.h +++ b/env/io_posix.h @@ -10,8 +10,13 @@ #include #if defined(ROCKSDB_IOURING_PRESENT) #include +#include #include +#include + +#include "util/string_util.h" + // Compatibility defines for io_uring flags that may not be present in older // kernel headers. These values are fixed and won't change, so it's safe to // define them even if the running kernel doesn't support them. @@ -341,6 +346,9 @@ inline struct io_uring* CreateIOUring() { flags |= IORING_SETUP_DEFER_TASKRUN; int ret = io_uring_queue_init(kIoUringDepth, new_io_uring, flags); if (ret) { + fprintf(stderr, "CreateIOUring failed: %s (errno=%d), thread=%lu\n", + errnoStr(-ret).c_str(), -ret, + static_cast(pthread_self())); delete new_io_uring; new_io_uring = nullptr; }