From 9519f03cb2e9dc2642e95944b452c02f87fb3111 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 11 Jun 2020 01:24:35 -0400 Subject: scan through the single-point failure space --- src/wal.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/wal.rs b/src/wal.rs index d675426..46baeb8 100644 --- a/src/wal.rs +++ b/src/wal.rs @@ -192,7 +192,7 @@ impl WALWriter { /// Submit a sequence of records to WAL; WALStore/WALFile callbacks are invoked before the /// function returns. The caller then has the knowledge of WAL writes so it should defer /// actual data writes after WAL writes. - pub fn grow>(&mut self, records: T) -> Result, ()> { + pub fn grow>(&mut self, records: T) -> (Box<[WALRingId]>, Result<(), ()>) { let mut res = Vec::new(); let mut writes = Vec::new(); let msize = std::mem::size_of::() as u32; @@ -268,8 +268,8 @@ impl WALWriter { .to_vec().into_boxed_slice())); self.state.next += (bbuff_cur - bbuff_start) as u64; } - self.file_pool.write(writes)?; - Ok(res.into_boxed_slice()) + + (res.into_boxed_slice(), self.file_pool.write(writes)) } /// Inform the WALWriter that data writes (specified by a slice of (offset, length) tuples) are -- cgit v1.2.3