summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 11:25:36 -0300
committerGabriel Schneider <[email protected]>2026-11-18 11:25:36 -0300
commit49afe2947bb944c05fc33ff24e0e45099d624bf6 (patch)
tree076f504da65c340163714a03cee7179d127a6f22
parenta2538c49b1bb69dcd1a6f1350834e13f68c3c05d (diff)
parent30a2426271007992176ad5cd25fb36b77c8b68f2 (diff)
downloadpardes-49afe2947bb944c05fc33ff24e0e45099d624bf6.tar.gz
pardes-49afe2947bb944c05fc33ff24e0e45099d624bf6.zip
integration: the kept copy let go at the session's next unit (the client path's round 2: three clients diverged with a copy kept ahead across units, once the soak called ready as the real clients do) with the PDF kind where it is shown: no conflict; replicas with three clients and ready called: diverged 0, unequal 0 at rtt 30, 80 and 207, deltas checked/wrong 1536/0, 1545/0, 1608/0; tui core-test 820/959 (139 skipped), shell-test 994/997, behaviour-test 274/274 and its replay 20 seeds with 0 failures, pane-test 180/181; the window's suites not run on this merge (the change is in Replica.confirm, which a client's replica alone runs)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
-rw-r--r--src/replica.zig16
-rw-r--r--test/replicas.zig1
2 files changed, 12 insertions, 5 deletions
diff --git a/src/replica.zig b/src/replica.zig
index f3ea3eee..cf382eed 100644
--- a/src/replica.zig
+++ b/src/replica.zig
@@ -852,10 +852,12 @@ pub const Replica = struct {
const u = parseUnit(msg) orelse return r.fail("a unit too short to read");
r.stats.units += 1;
if (u.origin == r.id) if (r.t.core) |c| r.echo.confirmed(c, u.seq);
- // A copy taken ahead (`ready`), nothing on top: it stays the point a
- // rollback goes back to, the unit replayed on it and kept in `since`,
- // not let go and taken again (a megabyte walked) for each unit of
- // the session's that comes while the client is idle.
+ // A copy taken ahead (`ready`), nothing on top: let go once the unit
+ // is replayed, and taken again when the client is idle. Held over
+ // the session's units, kept in `since` to replay, it put back a
+ // state a later step read otherwise than the session's (the soak,
+ // three clients, with `ready` as the clients call it: diverged; every
+ // rollback's digest agreed, so what differs is no digest's).
const ahead = r.applied == 0 and r.copy.held;
if (r.guess) {
r.stamp = .{ .real_ns = u.real_ns, .mono_ns = u.mono_ns, .at_ns = nowNs() };
@@ -943,7 +945,11 @@ pub const Replica = struct {
r.freePending(r.pending.orderedRemove(0));
}
r.dirty = true;
- if (ahead) r.keepSince(u.tape);
+ if (ahead) {
+ r.copy.release();
+ rollback.Epoch.select(null);
+ r.clearSince();
+ }
}
fn fail(r: *Replica, why: []const u8) void {
diff --git a/test/replicas.zig b/test/replicas.zig
index 55efd124..ab665bf2 100644
--- a/test/replicas.zig
+++ b/test/replicas.zig
@@ -421,6 +421,7 @@ fn run(r: Run, dir: []const u8, totals: *Totals) !void {
if (m.kind == .to_replica) {
rp.confirm(m.bytes);
rp.settle();
+ rp.ready();
} else if (rp.screen(m.bytes)) |reply| {
const pane = m.bytes[0];
if (reply[5] == 1) {