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

Replication protocol session manager #363

Merged
merged 27 commits into from
May 15, 2023
Merged

Conversation

adzialocha
Copy link
Member

@adzialocha adzialocha commented May 10, 2023

Implementation of a manager handling sessions of the p2panda replication protocol as specified in https://p2panda.org/specification/replication/.

The manager makes sure that multiple replication sessions can be handled at the same time with different / same peers. It makes sure that no duplicate work is done and no dead locks occur when two peers initiate the same session at the same time.

On top it provides a pluggable interface for different replication "strategies", which we implement in separate PRs.

This implementation is agnostic of the underlying networking layer or async runtime. The glue to the aquadoggo libp2p networking stack is handled here: #365

Closes #372

Next Steps

📋 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

adzialocha and others added 25 commits May 10, 2023 13:00
* sync-session:
  Update SessionManager to use new Session api
  Update Session
  Move traits into own module and implement Clone for Strategy
  Remove duplicate Mode structs
  Integrate strategies onto Session
  Implement Strategy trait for NaiveStrategy
  Define strategy trait
  Make StrategyMessage public
  Rename ScopedMessage -> StrategyMessage
  Introduce scoped message
* main:
  Do not pin versions anymore, fix changes
  Actually pin versions in Cargo.toml
@adzialocha adzialocha changed the title Replication protocol Replication protocol session manager May 13, 2023
@adzialocha adzialocha changed the base branch from main to development May 15, 2023 09:46
@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Patch coverage: 71.42% and project coverage change: -0.51 ⚠️

Comparison is base (20516f5) 92.39% compared to head (5e721aa) 91.89%.

❗ Current head 5e721aa differs from pull request most recent head 3c19701. Consider uploading reports for the commit 3c19701 to get more accurate results

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #363      +/-   ##
===============================================
- Coverage        92.39%   91.89%   -0.51%     
===============================================
  Files               70       75       +5     
  Lines             6549     6710     +161     
===============================================
+ Hits              6051     6166     +115     
- Misses             498      544      +46     
Impacted Files Coverage Δ
aquadoggo/src/lib.rs 100.00% <ø> (ø)
aquadoggo/src/manager.rs 95.00% <ø> (ø)
aquadoggo/src/replication/strategies.rs 22.72% <22.72%> (ø)
aquadoggo/src/replication/traits.rs 57.14% <57.14%> (ø)
aquadoggo/src/replication/session.rs 60.00% <60.00%> (ø)
aquadoggo/src/replication/manager.rs 81.37% <81.37%> (ø)
aquadoggo/src/replication/mod.rs 85.00% <85.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adzialocha adzialocha marked this pull request as ready for review May 15, 2023 10:06
@adzialocha adzialocha merged commit 11744f7 into development May 15, 2023
6 checks passed
@adzialocha adzialocha deleted the replication-protocol branch May 15, 2023 10:17
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.

Manager and router handling multiple replication sessions at the same time
2 participants