summaryrefslogtreecommitdiffstats
path: root/src/remake/kind.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 23:06:03 +0200
committertv <tv@krebsco.de>2026-10-24 23:06:03 +0200
commit3ecc0fe0bb083e351d769550851d26a9edcb7cf6 (patch)
treed9716bfc6153e6094d979cc5e4ccca2377c59496 /src/remake/kind.rs
parent0cba61b6beb4b1da685e21991c8b95a6e39d2287 (diff)
compact remake fixes base at the commit
Instead of fixing base heads at when proposed, compact fixes them when committing. This shrinks the window where writes can be lost if their author restarts to the switch delay; during replace and import remakes writes can still be lost during the voting period.
Diffstat (limited to 'src/remake/kind.rs')
-rw-r--r--src/remake/kind.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/remake/kind.rs b/src/remake/kind.rs
index 8131f7f..b36db4c 100644
--- a/src/remake/kind.rs
+++ b/src/remake/kind.rs
@@ -71,6 +71,14 @@ pub(crate) trait RemakeKind: Send + Sync + 'static {
/// Every node: where a user path written after the base goes.
fn translate(&self, path: &[String], translation: &JsonValue) -> Translation;
+
+ /// Whether the coordinator fixes the base when it commits instead of when it
+ /// proposes (no `baseHeads` then). Right for a kind whose content is the old
+ /// document at the base: the later the base, the fewer writes need carrying over,
+ /// and a write made after it is lost if its author restarts before switching.
+ fn base_at_commit(&self) -> bool {
+ false
+ }
}
/// The kind with this name.
@@ -97,6 +105,10 @@ impl RemakeKind for Compact {
"compact"
}
+ fn base_at_commit(&self) -> bool {
+ true
+ }
+
fn propose(&self, spec: &JsonValue) -> Result<Prepared, String> {
match spec {
JsonValue::Null => Ok(Prepared::default()),