feat(server): Basic capped full sync
Migrating replication branch on main, part 4
Mixed implementation:
- dflycmd replication is a full rewrite
- replica is taken from the prototype (it really needs refactoring, but lets keep it out of scope until the next PR)
What I've added:
- Enhanced sync session management
- Support for FLOW and SYNC commands
- SYNC does not yet stream journal changes, because the final impl needs SWITCH to stop it
What I'd focus on before moving on:
- Getting sync session management right
- Basic replication tests with pytest
- Safety and stability (there are 1001 ways to crash the repl branch and there shouldn't be any here)
It seems pretty mature now for a first phase.
Note: Though I added state management to the replica, I didn't refactor any code there. This is my plan for the next PR.
Check out replication_test.py. One of the tests checks whether DF survives a parallel 1 to 20 replication 😸 It does currently.
There is no cancellation is this PR. The last test, where I let replicas crash during full sync, does not pass. Its because sub-connections fail before the main connection, thus triggering a TODO: implement cancellation scenario (Cancellation should most likely be implemented together with SWITCH).
The last test is. Should I remove it and save it for later?
Ok, these cases are important and not straight forward to understand from the code Please copy your comment there next time you touch the code.
On Sun, Nov 6, 2022, 16:27 Vladislav @.***> wrote:
Merged #440 https://github.com/dragonflydb/dragonfly/pull/440 into main.
— Reply to this email directly, view it on GitHub https://github.com/dragonflydb/dragonfly/pull/440#event-7747394801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4BFCFRARVJJFHNCRYHC3LWG656VANCNFSM6AAAAAARPHO54I . You are receiving this because you commented.Message ID: @.***>