diff --git a/safekeeper/src/http/routes.rs b/safekeeper/src/http/routes.rs index 6efd09c7e2..d1213baf38 100644 --- a/safekeeper/src/http/routes.rs +++ b/safekeeper/src/http/routes.rs @@ -12,7 +12,6 @@ use tokio::task::JoinError; use crate::safekeeper::ServerInfo; use crate::safekeeper::Term; -use crate::safekeeper::TermHistory; use crate::timelines_global_map::TimelineDeleteForceResult; use crate::GlobalTimelines; @@ -62,12 +61,21 @@ where s.serialize_str(&format!("{}", z)) } +/// Same as TermSwitchEntry, but serializes LSN using display serializer +/// in Postgres format, i.e. 0/FFFFFFFF. Used only for the API response. +#[derive(Debug, Serialize)] +struct TermSwitchApiEntry { + pub term: Term, + #[serde(serialize_with = "display_serialize")] + pub lsn: Lsn, +} + /// Augment AcceptorState with epoch for convenience #[derive(Debug, Serialize)] struct AcceptorStateStatus { term: Term, epoch: Term, - term_history: TermHistory, + term_history: Vec, } /// Info about timeline on safekeeper ready for reporting. @@ -112,10 +120,21 @@ async fn timeline_status_handler(request: Request) -> Result