Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion riffle-server/src/store/local/uring_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ impl LocalIO for UringIo {
path: &str,
options: ReadOptions,
) -> anyhow::Result<DataBytes, WorkerError> {
// if the io_mode is sendfile, we fallback to sync io read
if matches!(options.io_mode, IoMode::SENDFILE) {
// use sendfile via sync io
return self.sync_local_io.read(path, options).await;
}

let (offset, length) = match &options.read_range {
ReadRange::ALL => {
let fs_sts = self.file_stat(path).await?;
Expand All @@ -484,7 +490,7 @@ impl LocalIO for UringIo {
let file = OpenOptions::new().read(true).open(path)?;
let raw_fd = file.as_raw_fd();

// make the size as the optional config option in io-uring
// todo: make the size as the optional config option in io-uring
if matches!(options.io_mode, IoMode::SPLICE) && length < 16 * 1024 * 1024 {
// init the pipe
let (pipe_in, mut pipe_out) = {
Expand Down