Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Cleanup "forfeit" replica_test; add assertions #1495

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/vsr/replica_test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,12 @@ test "Cluster: repair: view-change, new-primary lagging behind checkpoint, forfe

b1.drop_all(.__, .bidirectional);

try c.request(checkpoint_1_trigger - 1, checkpoint_1_trigger - 1);
try expectEqual(a0.commit(), checkpoint_1_trigger - 1);
try c.request(checkpoint_1_trigger, checkpoint_1_trigger);
try expectEqual(a0.commit(), checkpoint_1_trigger);
try expectEqual(b1.commit(), 20);
try expectEqual(b2.commit(), checkpoint_1_trigger - 1);
try expectEqual(b2.commit(), checkpoint_1_trigger);

// Ensure that B2 does not commit op=trigger+1.
b2.drop(.__, .incoming, .commit);
try c.request(checkpoint_1_trigger + 1, checkpoint_1_trigger + 1);
try expectEqual(a0.op_checkpoint(), checkpoint_1);
Expand All @@ -480,6 +481,9 @@ test "Cluster: repair: view-change, new-primary lagging behind checkpoint, forfe
try expectEqual(a0.commit(), checkpoint_1_trigger + 1);
try expectEqual(b1.commit(), 20);
try expectEqual(b2.commit(), checkpoint_1_trigger);
try expectEqual(a0.op_head(), checkpoint_1_trigger + 1);
try expectEqual(b1.op_head(), 20);
try expectEqual(b2.op_head(), checkpoint_1_trigger + 1);

// Partition the primary, but restore B1. B1 will attempt to become the primary next,
// but it is too far behind, so B2 becomes the new primary instead.
Expand Down
Loading