Replay all committed records from the WAL.
(&self)
| 46 | |
| 47 | /// Replay all committed records from the WAL. |
| 48 | pub fn replay(&self) -> crate::Result<Vec<WalRecord>> { |
| 49 | let records = |
| 50 | nodedb_wal::segmented::replay_all_segments(&self.wal_dir).map_err(crate::Error::Wal)?; |
| 51 | info!(records = records.len(), "WAL replay complete"); |
| 52 | Ok(records) |
| 53 | } |
| 54 | |
| 55 | /// Replay committed records from the WAL starting at `from_lsn`. |
| 56 | pub fn replay_from(&self, from_lsn: Lsn) -> crate::Result<Vec<WalRecord>> { |