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

feat: Add SyncController [2/2] #348

Merged
merged 25 commits into from
Oct 26, 2023
Merged

feat: Add SyncController [2/2] #348

merged 25 commits into from
Oct 26, 2023

Conversation

gmaclennan
Copy link
Member

@gmaclennan gmaclennan commented Oct 24, 2023

The sync controller implements the replicate() method, manages sync state, and peer sync controller instances.

This PR is missing tests, but given the complexity of setting up unit tests to invite peers and add data, I think the time is better spent actually implementing and integrating that on the API, so that we can go straight to an e2e test.

Hypercore manages peers on a "per-hypercore" basis, e.g. each hypercore
has a unique set of peers. However for Mapeo we need to treat all
hypercores belonging to a peer as one, so we need to combine the peer
core sync states across all cores, and then have a means for a
particular peer to control which cores / namespaces are replicated to
the replication stream.

This abstraction is for managing the enabling of namespaces with a
particular peer, and will be managed by the sync controller. This
replaces functionality that is currently in the CoreManager and the
ReplicationStateMachine that is currently returned by
coreManager.replicate().
* main:
  fix: pin pre-releases to exact version (#344)
  fix: fix 'write EPIPE' error & failing discovery test (#328)
  feat: NamespaceSyncState improvements (#339)
* feat/peer-sync-controller:
  WIP: fix up tests and start addressing bugs
* feat/peer-sync-controller:
  fix types
  fix bug
  fix PeerSyncController tests
* feat/peer-sync-controller:
  allow peer sync controller without peerId
@gmaclennan gmaclennan changed the title feat: Add SyncController feat: Add SyncController [2/2] Oct 25, 2023
@gmaclennan gmaclennan marked this pull request as ready for review October 25, 2023 07:29
@gmaclennan gmaclennan requested a review from achou11 October 25, 2023 07:29
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will stopping/disabling sync be a follow-up?

@gmaclennan
Copy link
Member Author

Yes good point it should be yes

@gmaclennan gmaclennan merged commit 6249c00 into main Oct 26, 2023
7 checks passed
@gmaclennan gmaclennan deleted the feat/sync-controller branch October 26, 2023 02:00
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.

Create SyncController to manage connections, authentication and starting sync.
2 participants