diff options
| -rw-r--r-- | src/remake/api.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/remake/api.rs b/src/remake/api.rs index a4d4cf0..5cd4db1 100644 --- a/src/remake/api.rs +++ b/src/remake/api.rs @@ -386,6 +386,25 @@ async fn start_kind<H: Host>( None, ); }; + // A swarm holding a store takes compactions only (`docs/store.md`, Remakes): every + // node builds a compaction's snapshot itself from the base. + #[cfg(feature = "federation")] + if kind.name() != kind::DEFAULT_KIND + && host + .read_doc(|doc| { + matches!( + crate::access::policy::of(doc), + crate::access::policy::Policy::Store(_) + ) + }) + .await + { + return error_response( + StatusCode::BAD_REQUEST, + format!("a swarm holding a store takes compactions only, not {kind_name}"), + None, + ); + } let prepared = match kind.propose(request.spec.as_ref().unwrap_or(&JsonValue::Null)) { Ok(prepared) => prepared, Err(reason) => { |
