Repository navigation
Conversation
aduffeck
left a comment
There was a problem hiding this comment.
Hm, but with that change any failure in propagating the change up the tree aborts the assimilation, which means that the file will staying invisible.
Also, what happens when propagation doesn't fail at the parent but the grandparent instead? The parent node already got the size change written to its metadata, so a subsequent assimilation of the file will add it again, no?
It feels like we're only moving the inconsistency risk, not really fixing it.
…-size checkpoint A file's size diff was derived from blobsize, which doubled as both the file's current size and the baseline of what the ancestors already account for. Because blobsize was written before the propagation was confirmed, a failed propagation left blobsize at the new size, so the next attempt computed a size diff of 0 and the size was lost from the ancestors for good (the deficit behind the flaky "handles deleted files" treesize assertion). Record the propagated size in a dedicated user.oc.propagatedsize checkpoint and derive the diff from it instead of blobsize. The checkpoint is advanced only after a successful propagation (written optimistically with the attributes and rolled back if the propagation fails), so a retry recomputes the outstanding delta. The file stays visible throughout, and the sync propagate walk is unchanged (one ancestor at a time under the already-held file lock). Delete now subtracts the checkpoint (what the ancestors actually hold) rather than blobsize, so a file with a pending delta does not over-subtract. Partial propagation failures (a higher ancestor failing after a lower one applied) are left to the rescan (scan_fs / WarmupIDCache); making the walk atomic would re-lock ancestors and add contention under concurrent uploads.
8d7607c to
47b4795
Compare
|
true. I chose a different approach that writes an additional property to detect failed propagations on retries. propagatedsize is a separate attribute, advanced only after a successful propagation. So the write only sets blobsize: So the retry doesn't need the "old blobsize". It reads the persisted propagatedsize (10) and the persisted blobsize (11), both on disk, and recomputes +1. The old baseline survives precisely because we never wrote it into blobsize's slot; it lives in its own attribute. |
|
I think this can count a size twice. Only assimilation writes |
A file's size diff was derived from blobsize, which doubled as both the file's
current size and the baseline of what the ancestors already account for. Because
blobsize was written before the propagation was confirmed, a failed propagation
left blobsize at the new size, so the next attempt computed a size diff of 0 and
the size was lost from the ancestors for good (the deficit behind the flaky
"handles deleted files" treesize assertion).
Record the propagated size in a dedicated user.oc.propagatedsize checkpoint and
derive the diff from it instead of blobsize. The checkpoint is advanced only
after a successful propagation (written optimistically with the attributes and
rolled back if the propagation fails), so a retry recomputes the outstanding
delta. The file stays visible throughout, and the sync propagate walk is
unchanged (one ancestor at a time under the already-held file lock).
Delete now subtracts the checkpoint (what the ancestors actually hold) rather
than blobsize, so a file with a pending delta does not over-subtract.
Partial propagation failures (a higher ancestor failing after a lower one
applied) are left to the rescan (scan_fs / WarmupIDCache); making the walk
atomic would re-lock ancestors and add contention under concurrent uploads.
addresses this flakyness:
https://ci.opencloud.rocks/repos/4/pipeline/928/157