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

Sync: fix implementation and document #101

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Conversation

zjkmxy
Copy link
Collaborator

@zjkmxy zjkmxy commented Dec 23, 2024

Fix: #100

@zjkmxy zjkmxy requested a review from tianyuan129 December 23, 2024 18:34
SyncStatus =
Name
StatusCode

RepoCommandParam =
Copy link
Contributor

Choose a reason for hiding this comment

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

The insert topic only accepts RepoCommandParam that contains ObjParam.
The sync/join topic only accepts RepoCommandParam that contains SyncParam.
This suggests that these should be two separate types: ObjCommandParam and SyncCommandParam.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree. We really should separate them.

RepoCommandParam =
1 * (OBJECT-PARAM-TYPE TLV-LENGTH ObjectParam)
0* (OBJECT-PARAM-TYPE TLV-LENGTH ObjParam)
0* (SYNC-PARAM-TYPE TLV-LENGTH SyncParam)

RepoCommandRes =
Copy link
Contributor

Choose a reason for hiding this comment

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

The insert topic only returns RepoCommandRes that contains ObjStatus.
The sync/join topic only accepts RepoCommandRes that contains SyncStatus.
This suggests that these should be two separate types: ObjCommandRes and SyncCommandRes.

@@ -5,30 +5,42 @@ Most repo commands and status reports are Data packets whose Content contains
``RepoCommandParam`` or ``RepoCommandRes`` structure.
These Data are issued via Pub-Sub protocol.
Each ``RepoCommandParam`` and ``RepoCommandRes`` contains
multiple ``ObjectParam`` and ``ObjectResult``, resp.
multiple ``ObjParam`` and ``ObjStatus``, resp.
These structures are defined as follows:

Copy link
Contributor

Choose a reason for hiding this comment

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

Please define how to handle TLV-TYPE evolvability in this protocol.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know the answer but it seems not supported now.
@tianyuan129 Do we want to design a better protocol? The current version looks messy.

Copy link
Contributor

Choose a reason for hiding this comment

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

it seems not supported now

You could declare "all TLV-TYPE numbers are critical".
In this case, any future addition would be a breaking change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know the answer but it seems not supported now. @tianyuan129 Do we want to design a better protocol? The current version looks messy.

I kinda agree. The current Sync implementation is just quick code, time to revisit. But when you say a better protocol, are you referring to Sync itself or the entire repo command framework? The current repo command is very much object storage orientated, it could be hard to harmoniously put Sync function into the protocol.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I mean the repo command framework. I think it needs a revisit to leave spaces for Sync and probably my Linked Object proposal.

Name
StatusCode
[InsertNum]
[DeleteNum]

SyncStatus =
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of SyncStatus shall be mentioned in sync/join and sync/leave pages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, actually it is not used. Though the server returns this struct, the client discards it.

Copy link
Contributor

@tianyuan129 tianyuan129 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -41,6 +53,12 @@ These structures are defined as follows:

RegisterPrefix = REGISTER-PREFIX-TYPE TLV-LENGTH Name

SyncPrefix = SYNC-PREFIX-TYPE TLV-LENGTH Name

DataNameDedupe = SYNC-DATA-NAME-DEDUPE-TYPE TLV-LENGTH ; TLV-LENGTH = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a reminder this is pure hack for NDN Workspace. Ideally we should let apps define naming conventions.

@zjkmxy zjkmxy merged commit e3d031e into UCLA-IRL:master Dec 27, 2024
2 checks passed
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.

Sync Join: missing specification of SyncParam
3 participants