summaryrefslogtreecommitdiff
path: root/src/replica.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/replica.zig')
-rw-r--r--src/replica.zig16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/replica.zig b/src/replica.zig
index 2a5404c5..a7e6c04e 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 {