summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/replica.zig2
-rw-r--r--test/replicas.zig4
2 files changed, 4 insertions, 2 deletions
diff --git a/core/replica.zig b/core/replica.zig
index 182d25c2..48cb1838 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -3100,7 +3100,7 @@ fn loadAgain(gpa: Allocator, j: *Joined, have: ?*Have, why: []u8, session: []con
/// The fields a replica loaded from the join's dump `bytes` has other than
/// the session as it dumped them (the digest a field at a time the dump
/// ends with: dump.joinParts), named in `out`.
-fn loadDiffers(r: *Replica, bytes: []const u8, out: []u8) []const u8 {
+pub fn loadDiffers(r: *Replica, bytes: []const u8, out: []u8) []const u8 {
const want = pardes.dump.joinParts(r.gpa, bytes) orelse return "(the dump names no field) ";
defer r.gpa.free(want);
var arena: std.heap.ArenaAllocator = .init(r.gpa);
diff --git a/test/replicas.zig b/test/replicas.zig
index 3aa9263e..cd0a3459 100644
--- a/test/replicas.zig
+++ b/test/replicas.zig
@@ -1986,7 +1986,9 @@ const Soak = struct {
rp.echo.now = m.at * 1000;
if (!rp.loaded(cl.digest)) {
s.totals.unequal += 1;
- std.debug.print("seed {d} rtt {d} ms: client {d}'s dump loaded as another session\n", .{ s.r.seed, s.r.rtt_ms, m.who });
+ // The fields it differs by, as a client's join says them (replica.fromDump).
+ var named: [400]u8 = undefined;
+ std.debug.print("seed {d} rtt {d} ms: client {d}'s dump loaded as another session: {s}differs\n", .{ s.r.seed, s.r.rtt_ms, m.who, replica.loadDiffers(rp, m.bytes, &named) });
}
cl.live = m.gen;
var j: replica.Joined = .{ .fd = cl.cfd, .pid = 0, .client = cl.id, .view = cl.view, .gmtoff = 0, .dump = &.{} };