Skip to content

Commit

Permalink
Merge pull request #82 from jaczhi/jaczhi/sync-documentation
Browse files Browse the repository at this point in the history
Sync join and sync leave documentation
  • Loading branch information
tianyuan129 authored Apr 13, 2024
2 parents 258bb86 + dfb9150 commit 62f9113
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/src/specification/specification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ Specification
Insert <insert>
Delete <delete>
Check <check>
TCP bulk insert <tcp_bulk>
TCP bulk insert <tcp_bulk>
Sync Group Join <sync_join>
Sync Group Leave <sync_leave>
23 changes: 23 additions & 0 deletions docs/src/specification/sync_join.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Sync Join
=========

The sync join protocol is used to command the repo to join a state vector sync group.

1. The repo subscribes to the topic ``/<repo_name>/sync/join``.

2. The client publishes a message to the topic ``/<repo_name>/sync/join``. The message payload is of type
``RepoCommandParam``, containing one or more ``SyncParam`` with the following fields:

* ``sync_prefix``: The name prefix of the sync group to join.
* ``register_prefix``: (Optional) The name prefix for the repo to register with the forwarder. This prefix must not
be the same as ``sync_prefix``.
* ``data_name_dedupe``: (Optional) If true, the repo will deduplicate data names in the sync group.
* ``reset``: (Optional) If true, rebuild state vectors from the stored state vectors on the repo disk. This is useful
if interests are sent for permanently unavailable data from an old vector.

3. The repo joins the sync group, saving sync information to disk.

* The repo will listen for state vector interests for the sync group. Then, to fetch any data, the repo will send
interests following the SVSPS data naming convention. For more information, see the
`specification page <https://named-data.github.io/StateVectorSync/Specification.html>`_ for State Vector
Synchronization.
17 changes: 17 additions & 0 deletions docs/src/specification/sync_leave.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Sync Leave
==========

The sync leave protocol is used to command the repo to leave the sync group. This command also removes any information
about the sync group from repo storage.

1. The repo subscribes to the topic ``/<repo_name>/sync/leave``.

2. The client publishes a message to the topic ``/<repo_name>/sync/leave``. The message payload is of type
``RepoCommandParam``, containing one or more ``SyncParam`` with the following field:

* ``sync_prefix``: The name prefix of the sync group to leave.

3. The repo leaves the sync group, removing sync information from disk. The repo no longer listens to the originally
specified register prefix.

* Note that any already-stored data packets that were received prior to leaving the sync group are *not* deleted.

0 comments on commit 62f9113

Please sign in to comment.