You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, as of the latest commit (41d9f8b), we keep track of the history of the filesystem; every modification of the filesystem structure creates a new root node, and appends that to the filesystem's history.
This means that we should have all the infrastructure in place to implement rollbacks and archiving of the filesystem, however I need to work out the best way to approach this. The issue at hand is that, essentially, synchronisation works roughly as follows:
if remote hash doesn't match local hash:
compare timestamps
if local copy newer than remote copy:
push to server
else if local copy older than remote copy:
fetch from server
This works perfectly well when the filesystem is always on the most up-to-date revision, however where it falls apart is when you rollback to an earlier revision of the filesystem. If we were to naively just set an older node as the new current revision of the filesystem, then clients would see that the file timestamps are now older than what they have stored locally, and thus would push to the server their local changes, which would simply revert the filesystem back to what it was before the rollback.
I need to determine how to notify clients to the fact that a rollback has occured, and that they should re-base the local sync based on the new rollback (ideally, also performing one last sync from the client -> server to ensure any local changes are not lost in the process).
Beyond synchronisation, we should have the infrastructure in place to allow for the server to:
fetch files from an older revision of the filesystem
get a listing of an older revision of the filesystem
In regards to #5 , I think as a cheap, stop-gap solution it should be doable to perform rollbacks by:
cloning an old revision of the filesystem tree
update all their timestamps
store it as the latest revision of the filesystem
This should allow for the current sync functionality to remain unchanged, while enabling rollbacks.
This does introduce the issue of file metadata no longer being correct, however; later on, it would be ideal to support some other means of notifying clients to rollbacks, but this solution should work for now at least.
This implements the basic stop-gap approach I outlined in #1, except with the added nuance of marking any
files that exist in the latest revision, but not in the version being rolled back to, as deleted.
This ensures that any files that used to exist before the rollback are deleted locally.
Currently directories are not deleted; this is something that should be worked on ASAP, however I am not sure how to approach the issue.
Right now, as of the latest commit (41d9f8b), we keep track of the history of the filesystem; every modification of the filesystem structure creates a new root node, and appends that to the filesystem's history.
This means that we should have all the infrastructure in place to implement rollbacks and archiving of the filesystem, however I need to work out the best way to approach this. The issue at hand is that, essentially, synchronisation works roughly as follows:
This works perfectly well when the filesystem is always on the most up-to-date revision, however where it falls apart is when you rollback to an earlier revision of the filesystem. If we were to naively just set an older node as the new current revision of the filesystem, then clients would see that the file timestamps are now older than what they have stored locally, and thus would push to the server their local changes, which would simply revert the filesystem back to what it was before the rollback.
I need to determine how to notify clients to the fact that a rollback has occured, and that they should re-base the local sync based on the new rollback (ideally, also performing one last sync from the client -> server to ensure any local changes are not lost in the process).
Beyond synchronisation, we should have the infrastructure in place to allow for the server to:
The features planned as part of this issue are:
.tar
archive based on an older revision of the filesystem #4Any feedback would be much appreciated.
The text was updated successfully, but these errors were encountered: