VSR: Reverse ring replication for odd ops - #2761
Conversation
This reverts commit 1cc2149.
Just so that its easier to tweak this logic during experiments.
|
This should help with #2739 |
|
Wait, I'm confused!
Is this saying that bidirectional is slower? |
|
Actually, that's not precise, let me describe it fully. Let's say we have replicas 0 thru 5, with 0 being the primary. Then, depending on the replica down, we'll get the following performance table:
(here, ∞ means not the literal infinity, but "too long to wait for test to finish", with individual batch latencies larger than 10 seconds) This is precisely what's expected: with unidirectional, the cluster basically doesn't notice if the last couple of replicas are eaten by the monsters, but a problem at the Strat of the ring leads to pathological behavior. With bidirectional both sides of the ring are equally important, so latency is elevated, unless the replica precisely the opposite of primal dies --- in that case, we still have replication quorum in either direction. (table from memory, but let me re-run the experiments just to confirm) |
|
Yup, the table above is correct! |
|
Will merge on Monday after the release, just in case. |
Replica starts and recoveres the journal: ``` [debug] (journal): 1: recover_slot: recovered slot=0001 label=@m decision=eql operation=vsr.Operation.pulse op=65 view=5 [warn] (journal): 1: recover_slot: recovered slot=0002 label=@g decision=fix operation=vsr.Operation(133) op=34 view=2 ```` It then truncates slot 1 due to view range: ``` recover_slots: drop header view_range=2..2 view=5 op=65 checksum=155146884554224562275508079586419833690 ``` The second slot is then fixed, repairing the headers: ``` [debug] (journal): 1: recover_slots: dirty=14 faulty=1 [debug] (journal): 1: write_sectors: ring=vsr.journal.Ring.headers offset=0 len=4096 locked [debug] (journal): 1: write_sectors: ring=vsr.journal.Ring.headers offset=0 len=4096 unlocked [info] (replica): 1: transition_to_normal_from_recovering_status: view=2 backup ``` Because headers are written sector-wise, this also replaces the truncated header with the reserved one. As a result, the assert in state checker trips. Use wal_prepares, rather wal_headers for assert Seed: ./zig/zig build vopr -- --lite 8336595450297446987
|
VOPR lite failure is false positive, I've added the fix here to keep the seed on the branch where it actually fails. |
Alternate ring replication direction such that, if a single replica is down, the replicas after it learn that they are missing a prepare, and can repair it.
We originally reverted this commit as it wasn't playing well with our repair, which insisted on everything being done strictly in order. We have since relaxed our repair to be more concurrent:
We don't yet have a deterministic performance test here yet, so I used the following script to test the behavior
In all-healthy cluster, benchmark finishes in about 7 seconds for me, with or without bidirectional replication.
If a single replica is down: