summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-06-11 01:24:35 -0400
committerDeterminant <[email protected]>2020-06-11 01:24:35 -0400
commit9519f03cb2e9dc2642e95944b452c02f87fb3111 (patch)
treede63827b85f549dd227e78e3e03d0c86b8cf4700 /src
parentc7d621279743275a8766fa253268fb7a8e1c90ca (diff)
scan through the single-point failure space
Diffstat (limited to 'src')
-rw-r--r--src/wal.rs6
1 files changed, 3 insertions, 3 deletions
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<F: WALStore> WALWriter<F> {
/// 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<T: AsRef<[WALBytes]>>(&mut self, records: T) -> Result<Box<[WALRingId]>, ()> {
+ pub fn grow<T: AsRef<[WALBytes]>>(&mut self, records: T) -> (Box<[WALRingId]>, Result<(), ()>) {
let mut res = Vec::new();
let mut writes = Vec::new();
let msize = std::mem::size_of::<WALRingBlob>() as u32;
@@ -268,8 +268,8 @@ impl<F: WALStore> WALWriter<F> {
.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