From 191d9d2b74858b747874d4f7aea610358205d64d Mon Sep 17 00:00:00 2001 From: Patrick Insinger Date: Thu, 11 Nov 2021 13:16:34 -0800 Subject: [PATCH] par_fsync - use VirtualFile --- pageserver/src/layered_repository/par_fsync.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pageserver/src/layered_repository/par_fsync.rs b/pageserver/src/layered_repository/par_fsync.rs index c2500d2c85..0b0217ab58 100644 --- a/pageserver/src/layered_repository/par_fsync.rs +++ b/pageserver/src/layered_repository/par_fsync.rs @@ -1,12 +1,13 @@ use std::{ - fs::File, io, path::{Path, PathBuf}, sync::atomic::{AtomicUsize, Ordering}, }; +use crate::virtual_file::VirtualFile; + fn fsync_path(path: &Path) -> io::Result<()> { - let file = File::open(path)?; + let file = VirtualFile::open(path)?; file.sync_all() } @@ -31,7 +32,6 @@ pub fn par_fsync(paths: &[PathBuf]) -> io::Result<()> { /// Increasing this limit will /// - use more memory /// - increase the cost of spawn/join latency - /// - increase the peak # of file descriptors const MAX_NUM_THREADS: usize = 64; let num_threads = paths.len().min(MAX_NUM_THREADS); let next_path_idx = AtomicUsize::new(0);