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

Add a GetLatestVersionId transaction to the sync protocol #4

Open
djmitche opened this issue Dec 26, 2023 · 1 comment
Open

Add a GetLatestVersionId transaction to the sync protocol #4

djmitche opened this issue Dec 26, 2023 · 1 comment

Comments

@djmitche
Copy link
Collaborator

The current sync protocol supports GetChildVersion, which can be used to iterate through versions from parent -> child. And, it supports AddVersion, which adds a new version if its parent is the latest version. But there's no way to find out what the latest version is.

That would be useful when getting changes from the server. There are two scenarios that look OK to the client, but are actually errors:

  • Iteration with GetChildVersion stops because there is no child version -- but the parent version is not the latest! This might happen if a version is somehow lost on the server.
  • A new replica is initialized without a snapshot on the server, and the version with parent NIL_VERSION_ID has been deleted. The client gets no snapshot, so begins iterating at NIL_VERSION_ID, and seeing no child of that version ID, assumes it has all of the data. A snapshot might be missing due to corruption or due to a new replica that hasn't yet gotten a snapshot.

(In fact, in terms of the sync code these are exactly the same situation -- iteration stops, but the replica is not up to date)

A GetLatestVersionId transaction would simply return the latest version id. The client can make this transaction after it has finished iterating with GetChildVersion. If iteration didn't stop with the latest version id, then things have gone wrong and it should fail with an error.

@djmitche
Copy link
Collaborator Author

This is a good idea, but I don't think it's blocking 3.0

@djmitche djmitche transferred this issue from GothenburgBitFactory/taskwarrior Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant