Internal: append a record of the given type to the WAL.
(
&self,
record_type: RecordType,
tenant_id: TenantId,
vshard_id: VShardId,
database_id: DatabaseId,
payload: &[u8],
)
| 8 | impl WalManager { |
| 9 | /// Internal: append a record of the given type to the WAL. |
| 10 | fn append_record( |
| 11 | &self, |
| 12 | record_type: RecordType, |
| 13 | tenant_id: TenantId, |
| 14 | vshard_id: VShardId, |
| 15 | database_id: DatabaseId, |
| 16 | payload: &[u8], |
| 17 | ) -> crate::Result<Lsn> { |
| 18 | let mut wal = self.wal.lock().unwrap_or_else(|p| p.into_inner()); |
| 19 | let lsn = wal |
| 20 | .append( |
| 21 | record_type as u32, |
| 22 | tenant_id.as_u64(), |
| 23 | vshard_id.as_u32(), |
| 24 | database_id.as_u64(), |
| 25 | payload, |
| 26 | ) |
| 27 | .map_err(crate::Error::Wal)?; |
| 28 | Ok(Lsn::new(lsn)) |
| 29 | } |
| 30 | |
| 31 | pub fn append_put( |
| 32 | &self, |
no test coverage detected