Skip to content

Commit

Permalink
feat(pageserver): use json for timeline metadata encoding
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi Z <[email protected]>
  • Loading branch information
skyzh committed May 8, 2024
1 parent ca154d9 commit 5418e80
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 148 deletions.
4 changes: 3 additions & 1 deletion libs/postgres_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ pub fn generate_wal_segment(
dispatch_pgversion!(
pg_version,
pgv::xlog_utils::generate_wal_segment(segno, system_id, lsn),
Err(SerializeError::BadInput)
Err(SerializeError::BadInput(anyhow::anyhow!(
"failed to generate wal segment"
)))
)
}

Expand Down
6 changes: 3 additions & 3 deletions libs/utils/src/bin_ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ impl From<bincode::Error> for DeserializeError {
#[derive(Debug, Error)]
pub enum SerializeError {
/// The serializer isn't able to serialize the supplied data.
#[error("serialize error")]
BadInput,
#[error("serialize error: {0}")]
BadInput(anyhow::Error),
/// While serializing into a `Write` sink, an `io::Error` occurred.
#[error("serialize error: {0}")]
Io(io::Error),
Expand All @@ -59,7 +59,7 @@ impl From<bincode::Error> for SerializeError {
fn from(e: bincode::Error) -> Self {
match *e {
bincode::ErrorKind::Io(io_err) => SerializeError::Io(io_err),
_ => SerializeError::BadInput,
err => SerializeError::BadInput(err.into()),
}
}
}
Expand Down
Loading

0 comments on commit 5418e80

Please sign in to comment.