Write all outstanding transaction records to disk and flush OS buffers. Equivalent to calling [`Self::flush`] followed by [`Self::sync`], but without releasing the write lock in between. # Errors An error is returned if writing to disk fails due to an I/O error. # Panics This method panics if syncing fails irrecoverably.
(&self)
| 308 | /// |
| 309 | /// This method panics if syncing fails irrecoverably. |
| 310 | pub fn flush_and_sync(&self) -> io::Result<Option<u64>> { |
| 311 | let mut inner = self.inner.write().unwrap(); |
| 312 | trace!("flush and sync commitlog"); |
| 313 | inner.flush()?; |
| 314 | inner.sync(); |
| 315 | |
| 316 | Ok(inner.max_committed_offset()) |
| 317 | } |
| 318 | |
| 319 | /// Obtain an iterator which traverses the log from the start, yielding |
| 320 | /// [`StoredCommit`]s. |