diff options
| author | tv <tv@krebsco.de> | 2026-10-20 01:36:34 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-20 01:36:34 +0200 |
| commit | a7c2b8b181059e26172288e694505287f357a881 (patch) | |
| tree | c40d9bcd2e50ec7d2367ceee69d2377103419742 /src/compaction/api.rs | |
| parent | 247bb52f129d0438eb13d3cdd2ec8b5d281b2c99 (diff) | |
add epoch catch-up / snapshots
Diffstat (limited to 'src/compaction/api.rs')
| -rw-r--r-- | src/compaction/api.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compaction/api.rs b/src/compaction/api.rs index d98a1d4..98c5351 100644 --- a/src/compaction/api.rs +++ b/src/compaction/api.rs @@ -7,7 +7,8 @@ //! * `GET /admin/compactions` lists all compactions. //! * `GET /admin/compactions/{id}` reports one; `?wait=true` long-polls until decided //! (bounded by the proposal's own expiry). -//! * `GET /admin/epochs` shows the local epoch and the archived previous ones. +//! * `GET /admin/epochs` shows the local epoch, the archived previous ones and whether +//! the node is catching up with a newer epoch from a peer. //! * `DELETE /admin/compactions/{id}` asks the coordinator to abort. Only possible while //! proposed; `409` once committed (a switch can't be undone) or already over. //! `DELETE /admin/compaction` does the same for the compaction of the local epoch that @@ -442,12 +443,14 @@ async fn abort_by_id<H: Host>(host: H, id: String, wait: bool) -> Response { } } -/// `GET /admin/epochs`: the local epoch and the previous epochs this node still keeps. +/// `GET /admin/epochs`: the local epoch, the previous epochs this node still keeps, and +/// an ongoing catch-up with a peer's newer epoch (`null` if none). pub(crate) async fn epochs<H: Host>(State(host): State<H>) -> Response { let current = EpochRecord::from(host.current_epoch()); Json(json!({ "current": current, "archived": host.compaction().archived_epochs(), + "catchUp": host.compaction().catch_up_report(), })) .into_response() } |
