mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Revert "Merge pull request #60373 from azat/tests/detect-io_uring"
This reverts commit648e6ec5a6
, reversing changes made to273b4835a4
.
This commit is contained in:
parent
07c828ece9
commit
3c5d6c4df0
@ -26,8 +26,6 @@
|
||||
#include <IO/Archives/createArchiveReader.h>
|
||||
#include <IO/Archives/IArchiveReader.h>
|
||||
#include <IO/PeekableReadBuffer.h>
|
||||
#include <IO/AsynchronousReadBufferFromFile.h>
|
||||
#include <Disks/IO/IOUringReader.h>
|
||||
|
||||
#include <Formats/FormatFactory.h>
|
||||
#include <Formats/ReadSchemaUtils.h>
|
||||
@ -94,7 +92,6 @@ namespace ErrorCodes
|
||||
extern const int CANNOT_EXTRACT_TABLE_STRUCTURE;
|
||||
extern const int CANNOT_DETECT_FORMAT;
|
||||
extern const int CANNOT_COMPILE_REGEXP;
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -279,22 +276,6 @@ std::unique_ptr<ReadBuffer> selectReadBuffer(
|
||||
|
||||
ProfileEvents::increment(ProfileEvents::CreatedReadBufferOrdinary);
|
||||
}
|
||||
else if (read_method == LocalFSReadMethod::io_uring && !use_table_fd)
|
||||
{
|
||||
#if USE_LIBURING
|
||||
auto & reader = context->getIOURingReader();
|
||||
if (!reader.isSupported())
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "io_uring is not supported by this system");
|
||||
|
||||
res = std::make_unique<AsynchronousReadBufferFromFileWithDescriptorsCache>(
|
||||
reader,
|
||||
Priority{},
|
||||
current_path,
|
||||
context->getSettingsRef().max_read_buffer_size);
|
||||
#else
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "Read method io_uring is only supported in Linux");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (use_table_fd)
|
||||
|
@ -13,6 +13,7 @@ import sys
|
||||
import os
|
||||
import os.path
|
||||
import glob
|
||||
import platform
|
||||
import signal
|
||||
import re
|
||||
import copy
|
||||
@ -573,27 +574,6 @@ def get_localzone():
|
||||
return os.getenv("TZ", "/".join(os.readlink("/etc/localtime").split("/")[-2:]))
|
||||
|
||||
|
||||
def supports_io_uring():
|
||||
return not subprocess.call(
|
||||
[
|
||||
args.binary,
|
||||
"-q",
|
||||
"select * from file('/dev/null', 'LineAsString')",
|
||||
"--storage_file_read_method",
|
||||
"io_uring",
|
||||
],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
|
||||
|
||||
def get_local_filesystem_methods():
|
||||
methods = ["read", "pread", "mmap", "pread_threadpool"]
|
||||
if supports_io_uring():
|
||||
methods.append("io_uring")
|
||||
return methods
|
||||
|
||||
|
||||
class SettingsRandomizer:
|
||||
settings = {
|
||||
"max_insert_threads": lambda: 0
|
||||
@ -634,7 +614,10 @@ class SettingsRandomizer:
|
||||
0.2, 0.5, 1, 10 * 1024 * 1024 * 1024
|
||||
),
|
||||
"local_filesystem_read_method": lambda: random.choice(
|
||||
get_local_filesystem_methods()
|
||||
# Allow to use uring only when running on Linux
|
||||
["read", "pread", "mmap", "pread_threadpool", "io_uring"]
|
||||
if platform.system().lower() == "linux"
|
||||
else ["read", "pread", "mmap", "pread_threadpool"]
|
||||
),
|
||||
"remote_filesystem_read_method": lambda: random.choice(["read", "threadpool"]),
|
||||
"local_filesystem_read_prefetch": lambda: random.randint(0, 1),
|
||||
|
Loading…
Reference in New Issue
Block a user