diff options
| author | tv <tv@krebsco.de> | 2026-11-13 02:39:55 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-13 02:39:55 +0000 |
| commit | bfe93eea9b707b29b78e1f9a7a425e6f891701a0 (patch) | |
| tree | 8d601c0b4c3ac418773ada4782e4f9498219dced /src/state/host.rs | |
| parent | f6a5c50e0f24736e48c96e9f7a0d14e9d7474b2d (diff) | |
state: quarantine a drop's own writes before the document is let go
A node dropping a change taken unjudged swapped in the document
without it, released it, and only then quarantined its own writes
that were dropped with it. In between, a reader found them gone and
not quarantined: `simtest::policy::a_change_taken_unjudged` asserts
right after seeing the change gone, and found the quarantine empty
now and then.
They are quarantined now under the document's lock, with the swap.
Diffstat (limited to 'src/state/host.rs')
| -rw-r--r-- | src/state/host.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/state/host.rs b/src/state/host.rs index 5b52e1d..771884e 100644 --- a/src/state/host.rs +++ b/src/state/host.rs @@ -229,20 +229,22 @@ impl AppState { let mut screening = state.screening.lock_or_recover(); screening.of(replica.epoch_seq).keep_dropped(theirs); } - Some((epoch, old, paths, tainted.len())) + let own_paths = paths.len(); + // Before the document is let go: whoever reads it without the writes finds + // them quarantined. + crate::remake::quarantine_taken(&state, epoch, &old, paths); + Some((own_paths, tainted.len())) }) .await .ok() .flatten(); - let Some((epoch, old, paths, count)) = dropped else { + let Some((own_paths, count)) = dropped else { return; }; info!( changes = count, - own_paths = paths.len(), - "Dropped a change taken unjudged and what built on it" + own_paths, "Dropped a change taken unjudged and what built on it" ); - crate::remake::quarantine_taken(self, epoch, &old, paths); self.after_epoch_switch().await; } |
