diff options
| author | tv <tv@krebsco.de> | 2026-10-26 05:26:05 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-26 05:26:05 +0100 |
| commit | 982cf915cca3598a7dcceedc46d5c75dd79efe80 (patch) | |
| tree | 88626d19f61f01c7732aec3a50306706441bd988 /src | |
| parent | 223834c9dabdab00fceda69b9ce989995de47efa (diff) | |
remove /admin/compaction endpoint
Diffstat (limited to 'src')
| -rw-r--r-- | src/remake/api.rs | 25 | ||||
| -rw-r--r-- | src/remake/mod.rs | 2 |
2 files changed, 3 insertions, 24 deletions
diff --git a/src/remake/api.rs b/src/remake/api.rs index ab1b01b..41d72ad 100644 --- a/src/remake/api.rs +++ b/src/remake/api.rs @@ -1,8 +1,7 @@ //! `/admin/remakes` handlers. //! -//! * `POST /admin/remakes` proposes a remake of the current epoch (`POST -//! /admin/compaction` is a shortcut, kept from before). The receiving -//! node becomes its coordinator. `202` with the report, or with `?wait=true` the final +//! * `POST /admin/remakes` proposes a remake of the current epoch. The receiving node +//! becomes its coordinator. `202` with the report, or with `?wait=true` the final //! report once decided. A dropped request does not abort anything. The remake //! commits as soon as a majority of its electorate voted for it (`vote`), and aborts //! once that is out of reach or `settle` passed without it. @@ -351,17 +350,7 @@ pub(crate) async fn start<H: Host>( headers: HeaderMap, body: Bytes, ) -> Response { - start_kind(host, query, &headers, body, None).await -} - -/// `POST /admin/compaction`: the original endpoint, for compacting remakes only. -pub(crate) async fn start_compaction<H: Host>( - State(host): State<H>, - Query(query): Query<StartQuery>, - headers: HeaderMap, - body: Bytes, -) -> Response { - start_kind(host, query, &headers, body, Some(kind::DEFAULT_KIND)).await + start_kind(host, query, &headers, body).await } async fn start_kind<H: Host>( @@ -369,7 +358,6 @@ async fn start_kind<H: Host>( query: StartQuery, headers: &HeaderMap, body: Bytes, - only: Option<&'static str>, ) -> Response { if !host.is_node_ready().await { return error_response(StatusCode::SERVICE_UNAVAILABLE, "node is not ready", None); @@ -412,13 +400,6 @@ async fn start_kind<H: Host>( }; let kind_name = request.kind.as_deref().unwrap_or(kind::DEFAULT_KIND); - if only.is_some_and(|only| only != kind_name) { - return error_response( - StatusCode::BAD_REQUEST, - format!("this endpoint only starts {} remakes", kind::DEFAULT_KIND), - None, - ); - } let Some(kind) = kind::by_name(kind_name) else { return error_response( StatusCode::BAD_REQUEST, diff --git a/src/remake/mod.rs b/src/remake/mod.rs index 3980d38..bceb717 100644 --- a/src/remake/mod.rs +++ b/src/remake/mod.rs @@ -191,8 +191,6 @@ pub(crate) fn router<H: Host>() -> Router<H> { // A replace or import request carries a whole document. .layer(DefaultBodyLimit::max(REMAKE_REQUEST_LIMIT)), ) - // The original endpoint, kept as a shortcut for a compacting remake. - .route("/admin/compaction", post(api::start_compaction::<H>)) .route( "/admin/remakes/{id}", get(api::get::<H>).delete(api::abort::<H>), |
