dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

feat(server): Basic capped full sync

Open dranikpg opened this issue 3 years ago • 1 comments

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)

dranikpg avatar Oct 26 '22 17:10 dranikpg

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).

dranikpg avatar Nov 02 '22 21:11 dranikpg

The last test is. Should I remove it and save it for later?

dranikpg avatar Nov 06 '22 12:11 dranikpg

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: @.***>

romange avatar Nov 06 '22 14:11 romange