Repository navigation
Add Revert Node Functionatlity - #409
Merged
Merged
Conversation
Signed-off-by: Julian Koberg <[email protected]>
mzner
approved these changes
Oct 1, 2025
2403905
approved these changes
Oct 1, 2025
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Sep 29, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertToRevision(ctx, versionID) and Node.DeleteCurrentVersion(ctx) to both decomposedfs copies. RevertToRevision restores the given revision onto the node (blob metadata + mtime) under the node's metadata lock, purging the node when versionID is empty. DeleteCurrentVersion reverts to the latest revision and removes the processing flag, unstalling the node. - Add a DeleteRevision postprocessing event. A nil timestamp targets the node's current version (revert to the pre-upload state); a given timestamp deletes exactly that revision - file, metadata sidecars and its own blob. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertToRevision. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob. Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Sep 29, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertToRevision(ctx, versionID) and Node.DeleteRevision(ctx, versionID) to both decomposedfs copies. RevertToRevision restores the given revision onto the node (blob metadata + mtime) under the node's metadata lock and removes the revision, including its metadata sidecars. DeleteRevision deletes a revision and returns its blob id so the caller can delete the blob; an empty versionID targets the node's current revision - the latest stored revision is restored (or the node purged when there is none) and the processing flag is removed, unstalling the node. - Add a DeleteRevision postprocessing event. A nil timestamp targets the node's current revision (revert to the pre-upload state); a given timestamp deletes exactly that revision - file, metadata sidecars and its own blob. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertToRevision. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob, by delegating to Node.DeleteRevision. - Consume reverted revisions fully (data file + metadata sidecars) instead of leaking them, and stop upload Finalize from recreating a duplicate revision when the node already contains the upload's own content (e.g. after a newer upload was reverted). Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Sep 29, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertToRevision(ctx, versionID) and Node.DeleteRevision(ctx, versionID) to both decomposedfs copies. RevertToRevision restores the given revision onto the node (blob metadata + mtime) under the node's metadata lock and removes the revision, including its metadata sidecars. DeleteRevision deletes a revision and returns its blob id so the caller can delete the blob; an empty versionID targets the node's current revision - the latest stored revision is restored (or the node purged when there is none) and the processing flag is removed, unstalling the node. - Add a DeleteRevision postprocessing event. A nil timestamp targets the node's current revision (revert to the pre-upload state); a given timestamp deletes exactly that revision - file, metadata sidecars and its own blob. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertToRevision. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob, by delegating to Node.DeleteRevision. - Consume reverted revisions fully (data file + metadata sidecars) instead of leaking them, and stop upload Finalize from recreating a duplicate revision when the node already contains the upload's own content (e.g. after a newer upload was reverted). Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Sep 29, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertUpload(ctx, versionID) and Node.DeleteRevision(ctx, versionID) to both decomposedfs copies. RevertUpload reverts the upload that created the given revision: it restores the revision onto the node (blob metadata + mtime) under the node's metadata lock and removes the revision, including its metadata sidecars. DeleteRevision deletes a revision and returns its blob id so the caller can delete the blob; an empty versionID targets the node's current revision - the latest stored revision is restored (or the node purged when there is none) and the processing flag is removed, unstalling the node. - Add a DeleteRevision postprocessing event. A given timestamp deletes exactly that revision - file, metadata sidecars and its own blob. A nil timestamp targets the node's current revision (revert to the pre-upload state) and only applies while the node is stuck in processing, so a redelivered event is a no-op instead of consuming ever older revisions. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertUpload. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob, by delegating to Node.DeleteRevision. - Consume reverted revisions fully (data file + metadata sidecars) instead of leaking them, and stop upload Finalize from recreating a duplicate revision when the node already contains the upload's own content (e.g. after a newer upload was reverted). Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Sep 29, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertUpload(ctx, versionID) and Node.DeleteRevision(ctx, versionID) to both decomposedfs copies. RevertUpload reverts the upload that created the given revision: it restores the revision onto the node (blob metadata + mtime) under the node's metadata lock and removes the revision, including its metadata sidecars. DeleteRevision deletes a revision and returns its blob id so the caller can delete the blob; an empty versionID targets the node's current revision - the latest stored revision is restored (or the node purged when there is none) and the processing flag is removed, unstalling the node. - Add a DeleteRevision postprocessing event. A given timestamp deletes exactly that revision - file, metadata sidecars and its own blob - which can also be used to implement retention rules by emitting the event from a cron job or housekeeping service. A nil timestamp targets the node's current revision (revert to the pre-upload state) and only applies while the node is stuck in processing, so a redelivered event is a no-op instead of consuming ever older revisions. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertUpload. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob, by delegating to Node.DeleteRevision. - Consume reverted revisions fully (data file + metadata sidecars) instead of leaking them, and stop upload Finalize from recreating a duplicate revision when the node already contains the upload's own content (e.g. after a newer upload was reverted). Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Sep 29, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertUpload(ctx, versionID) and Node.DeleteRevision(ctx, versionID) to both decomposedfs copies. RevertUpload reverts the upload that created the given revision: it restores the revision onto the node (blob metadata + mtime) under the node's metadata lock and removes the revision, including its metadata sidecars. DeleteRevision deletes a revision and returns its blob id so the caller can delete the blob; an empty versionID targets the node's current revision - the latest stored revision is restored (or the node purged when there is none) and the processing flag is removed, unstalling the node. - Add a DeleteRevision postprocessing event. A given timestamp deletes exactly that revision - file, metadata sidecars and its own blob - which can also be used to implement retention rules by emitting the event from a cron job or housekeeping service. A nil timestamp targets the node's current revision (revert to the pre-upload state) and only applies while the node is stuck in processing, so a redelivered event is a no-op instead of consuming ever older revisions. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertUpload. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob, by delegating to Node.DeleteRevision. - Consume reverted revisions fully (data file + metadata sidecars) instead of leaking them, and stop upload Finalize from recreating a duplicate revision when the node already contains the upload's own content (e.g. after a newer upload was reverted). Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Oct 1, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertUpload(ctx, versionID) and Node.DeleteRevision(ctx, versionID) to both decomposedfs copies. RevertUpload reverts the upload that created the given revision: it restores the revision onto the node (blob metadata + mtime) under the node's metadata lock and removes the revision, including its metadata sidecars. DeleteRevision deletes a revision and returns its blob id so the caller can delete the blob; an empty versionID targets the node's current revision - the latest stored revision is restored (or the node purged when there is none) and the processing flag is removed, unstalling the node. - Add a DeleteRevision postprocessing event. A given timestamp deletes exactly that revision - file, metadata sidecars and its own blob - which can also be used to implement retention rules by emitting the event from a cron job or housekeeping service. A nil timestamp targets the node's current revision (revert to the pre-upload state) and only applies while the node is stuck in processing, so a redelivered event is a no-op instead of consuming ever older revisions. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertUpload. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob, by delegating to Node.DeleteRevision. - Consume reverted revisions fully (data file + metadata sidecars) instead of leaking them, and stop upload Finalize from recreating a duplicate revision when the node already contains the upload's own content (e.g. after a newer upload was reverted). Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
added a commit
to opencloud-eu/reva
that referenced
this pull request
Oct 2, 2026
Add functionality to revert a node to its previous state and to delete a specific revision, inspired by owncloud#409 and adapted to the posix (.oc-nodes) layout of our decomposedfs fork: - Add Node.RevertUpload(ctx, versionID) and Node.DeleteRevision(ctx, versionID) to both decomposedfs copies. RevertUpload reverts the upload that created the given revision: it restores the revision onto the node (blob metadata + mtime) under the node's metadata lock and removes the revision, including its metadata sidecars. DeleteRevision deletes a revision and returns its blob id so the caller can delete the blob; an empty versionID targets the node's current revision - the latest stored revision is restored (or the node purged when there is none) and the processing flag is removed, unstalling the node. - Add a DeleteRevision postprocessing event. A given timestamp deletes exactly that revision - file, metadata sidecars and its own blob - which can also be used to implement retention rules by emitting the event from a cron job or housekeeping service. A nil timestamp targets the node's current revision (revert to the pre-upload state) and only applies while the node is stuck in processing, so a redelivered event is a no-op instead of consuming ever older revisions. - Wire upload.Cleanup in both copies to derive the versionID from session metadata and delegate to Node.RevertUpload. This also fixes the antivirus postprocessing delete path on posix, where the glob-based lookup of the original port never matched. - Fix the CS3 DeleteFileVersions paths to delete the revision node's own blob and metadata sidecars instead of the live file's blob, by delegating to Node.DeleteRevision. - Consume reverted revisions fully (data file + metadata sidecars) instead of leaking them, and stop upload Finalize from recreating a duplicate revision when the node already contains the upload's own content (e.g. after a newer upload was reverted). Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds functionality to revert a node to its previous state