diff --git a/admin/src/bench/mod.rs b/admin/src/bench/mod.rs index 8e91aaa2..e57ab805 100644 --- a/admin/src/bench/mod.rs +++ b/admin/src/bench/mod.rs @@ -106,7 +106,6 @@ pub struct Args { pub append: bool, pub no_check: bool, pub compress: bool, - pub ordered: bool, pub uniform: bool, pub writer_commits_per_sleep: u64, pub writer_sleep_time: u64, @@ -125,7 +124,6 @@ impl Stress { archive: self.archive, no_check: self.no_check, compress: self.compress, - ordered: self.ordered, uniform: self.uniform, writer_commits_per_sleep: self.writer_commits_per_sleep.unwrap_or(100), writer_sleep_time: self.writer_sleep_time.unwrap_or(0), diff --git a/src/btree/mod.rs b/src/btree/mod.rs index bb1177d2..8596e263 100644 --- a/src/btree/mod.rs +++ b/src/btree/mod.rs @@ -202,7 +202,7 @@ impl BTreeTable { return Ok(None) } let record_id = 0; // lifetime of Btree is the query, so no invalidate. - // keeping log locked when parsing tree. + // keeping log locked when parsing tree. let tree = BTree::new(Some(btree_header.root), btree_header.depth, record_id); tree.get(key, values, log) } diff --git a/src/file.rs b/src/file.rs index e07095cf..116f56f0 100644 --- a/src/file.rs +++ b/src/file.rs @@ -68,7 +68,7 @@ pub fn madvise_random(_map: &mut memmap2::MmapMut) {} fn mmap(file: &std::fs::File, len: usize) -> Result { #[cfg(not(test))] const RESERVE_ADDRESS_SPACE: usize = 1024 * 1024 * 1024; // 1 Gb - // Use a different value for tests to work around docker limits on the test machine. + // Use a different value for tests to work around docker limits on the test machine. #[cfg(test)] const RESERVE_ADDRESS_SPACE: usize = 64 * 1024 * 1024; // 64 Mb @@ -96,7 +96,12 @@ pub struct TableFile { impl TableFile { pub fn open(filepath: std::path::PathBuf, entry_size: u16, id: TableId) -> Result { let mut capacity = 0u64; - let map = if std::fs::metadata(&filepath).is_ok() { + let map = if let Err(error) = std::fs::metadata(&filepath) { + match error.kind() { + std::io::ErrorKind::NotFound => None, + _ => return try_io!(Err(error)), + } + } else { let file = try_io!(std::fs::OpenOptions::new() .read(true) .write(true) @@ -113,8 +118,6 @@ impl TableFile { } let map = mmap(&file, len as usize)?; Some((map, file)) - } else { - None }; Ok(TableFile { path: filepath,