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 | 3acbbd6cd6b64c6c39408dd254cc2dbcab1b3e65 (patch) | |
| tree | afaf883aeb949cdd79d7ef360ba9ee197072e368 /src/compaction/api.rs | |
| parent | 31dddb08e4f36392ed9b033f78efd00c243c46bb (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 9a77e4d..f5c01f2 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() } |
