mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
fix buffer alignment and improve error message for failed reads
This commit is contained in:
parent
252a091702
commit
374e40447c
@ -270,9 +270,13 @@ void IOUringReader::monitorRing()
|
||||
|
||||
if (cqe->res < 0)
|
||||
{
|
||||
int fd = assert_cast<const LocalFileDescriptor &>(*enqueued.request.descriptor).fd;
|
||||
failRequest(it, Exception(ErrorCodes::CANNOT_READ_FROM_FILE_DESCRIPTOR,
|
||||
"Cannot read from file {}: {}", fd, errnoToString(-cqe->res)));
|
||||
auto req = enqueued.request;
|
||||
int fd = assert_cast<const LocalFileDescriptor &>(*req.descriptor).fd;
|
||||
failRequest(it, Exception(
|
||||
ErrorCodes::CANNOT_READ_FROM_FILE_DESCRIPTOR,
|
||||
"Failed reading {} bytes at offset {} to address {} from fd {}: {}",
|
||||
req.size, req.offset, static_cast<void*>(req.buf), fd, errnoToString(-cqe->res)
|
||||
));
|
||||
|
||||
ProfileEvents::increment(ProfileEvents::IOUringCQEsFailed);
|
||||
io_uring_cqe_seen(&ring, cqe);
|
||||
|
@ -90,7 +90,7 @@ std::unique_ptr<ReadBufferFromFileBase> createReadBufferFromFileBase(
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "io_uring is not supported by this system");
|
||||
|
||||
res = std::make_unique<AsynchronousReadBufferFromFileWithDescriptorsCache>(
|
||||
*reader, settings.priority, filename, buffer_size, actual_flags, existing_memory, alignment, file_size);
|
||||
*reader, settings.priority, filename, buffer_size, actual_flags, existing_memory, buffer_alignment, file_size);
|
||||
#else
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "Read method io_uring is only supported in Linux");
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user