summaryrefslogtreecommitdiffstats
path: root/src/compaction/api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/compaction/api.rs')
-rw-r--r--src/compaction/api.rs7
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()
}