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

Async commit #66

Merged
merged 3 commits into from Nov 12, 2022
Merged

Async commit #66

merged 3 commits into from Nov 12, 2022

Conversation

markcty
Copy link
Contributor

@markcty markcty commented Nov 7, 2022

Use Raft algorithm as curp's background sync protocol

Changes:

  • log[0] now stores a fake log with 0 cmds to simplify code logics
  • server state is moved into a struct and protected by a RWLock.
  • 3 background tasks:
    • background_ping: send heartbeat to followers
    • backgournd_commit: check if new logs are replicated on all servers, commit if so
    • background_apply: check if commit_index is larger than applied_index, execute the log if so

@markcty markcty force-pushed the append-entries branch 4 times, most recently from 88cebcc to 15f9687 Compare November 7, 2022 12:24
@markcty markcty changed the title Add background ping to curp Async commit Nov 8, 2022
curp/src/server.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
@markcty markcty force-pushed the append-entries branch 6 times, most recently from 4dda62f to 3064e70 Compare November 10, 2022 06:20
curp/proto/message.proto Outdated Show resolved Hide resolved
curp/src/server.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
curp/src/sync_manager.rs Outdated Show resolved Hide resolved
@markcty markcty force-pushed the append-entries branch 3 times, most recently from f4c29b7 to a3c58bc Compare November 10, 2022 09:40
rogercloud
rogercloud previously approved these changes Nov 11, 2022
curp/tests/concurrent_cmd.rs Show resolved Hide resolved
@mergify mergify bot merged commit 4ad3231 into xline-kv:master Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants