summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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 {
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) {