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
Mirrors the behavior in decomposedfs postprocessing loop when postprocessing failed. This MR is a prerequisite to move the postprocessingloop into the cooridinator.
Additional changes:
Add sizeDiff to the return value of PrepareUpload. This value is necessary so the size propagation can be reverted.
Make the UnmarkProcessing call in RevertCurrentRevision method optional. RollbackUpload should not call UnmarkProcessing, because 1) coordinator calls MarkProcessing(false) itself and 2) UnmarkProcessing is changing metric values, which also should only happen in coordinator.
Notes:
There is a bug that when versioning is disabled and a node got overwritten, this method is deleting the file instead of reverting the changes. This bug is preexisting and is not fixed in this MR. It's not straightforward to fix, because at the time of reverting, we don't have the information about the overwritten file anymore. Could be solved in the future by e.g. storing the old overwritten metadata in the session. Out of scope for this MR
Potential double size-revert for new nodes (correctness risk) — upload.go:658
RollbackUpload propagates -sizeDiff whenever sizeDiff != 0, regardless of nodeExisted. For a new upload (nodeExisted=false), sizeDiff is the full info.Size, and the doc comment says the coordinator "calls Delete separately." If the coordinator calls both RollbackUpload (which propagates -size) and Delete/Purge
(which also propagates the size removal), the size is subtracted twice.
The early if !n.Exists { return nil } guard only protects the case where the node is already gone. If RollbackUpload is invoked while a freshly-created new node still exists, the propagate runs. The safe intent seems to be "only revert size for the overwrite case" — consider gating the propagate on nodeExisted, or
documenting explicitly that the coordinator must never call RollbackUpload with nodeExisted=false on an existing node. The coordinator isn't in this PR, so this is worth confirming before it lands.
Potential double size-revert for new nodes (correctness risk) — upload.go:658
RollbackUpload propagates -sizeDiff whenever sizeDiff != 0, regardless of nodeExisted. For a new upload (nodeExisted=false), sizeDiff is the full info.Size, and the doc comment says the coordinator "calls Delete separately." If the coordinator calls both RollbackUpload (which propagates -size) and Delete/Purge (which also propagates the size removal), the size is subtracted twice.
The early if !n.Exists { return nil } guard only protects the case where the node is already gone. If RollbackUpload is invoked while a freshly-created new node still exists, the propagate runs. The safe intent seems to be "only revert size for the overwrite case" — consider gating the propagate on nodeExisted, or documenting explicitly that the coordinator must never call RollbackUpload with nodeExisted=false on an existing node. The coordinator isn't in this PR, so this is worth confirming before it lands.
Good point. The concern is valid, if the node is new, we should not propagate -sizeDiff, because we already delete the file.
So two options:
a) Have noop, in case nodeExisted=false & still call this method in coordinator.
b) Don't call this method in coordinator, if nodeExisted=false & make this explicit in contract. Then nodeExisted parameter is obsolete, because it's always true.
I implemented option a), in case some future driver wants to do different behavior and because this makes a bug in coordinator less likely
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
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.
Mirrors the behavior in decomposedfs postprocessing loop when postprocessing failed. This MR is a prerequisite to move the postprocessingloop into the cooridinator.
Additional changes:
UnmarkProcessingcall inRevertCurrentRevisionmethod optional.RollbackUploadshould not callUnmarkProcessing, because 1) coordinator callsMarkProcessing(false)itself and 2)UnmarkProcessingis changing metric values, which also should only happen in coordinator.Notes: