dirnode 'delete' which hits UCWE will appear to fail, but actually succeeds #550
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#550
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The top-level problem seen in #546 occurred when an object was removed from a
directory. This involves a mutable file
modify()
call, using a"Deleter" function as the modifier callback. In this case, the first attempt
to modify the file resulted in an UncoordinatedWriteError (which was
probably inappropriate, see #546 and #547). This causes a retry, which
downloads the file a second time, applies the modifier callback again, and
then (if the file's contents have changed) re-publishes the result.
In this case, the second application of the modifier callback failed, because
in fact the first publish succeeded: it placed 10 shares of the new
(post-delete) version of the file. The UCWE was only triggered because of a
lurking 11th share, which is not enough to affect the results of a
download_best_version(). So when the Deleter was called a second time, the
object it sought to delete was already gone.
However, Deleter comes with a must_exist=True default argument, which means
that the Deleter will throw an exception if the object to be deleted was not
already present. This exception does not cause a retry (only UCWE does
that), so it gets returned to the caller (in this case, a webapi DELETE
operation returned a "404 No Such Object" error, even though the object was
present before the DELETE and correctly missing afterwards).
This must_exist=True test conflicts with the try-until-success design of
modify()
: the first attempt can apply this requirement, but subsequentretries must not, else they will appear to fail even though they have
actually succeeded.
The fix is to either remove this default (making it always must_exist=False),
or change the
modify()
logic to pass an extrais_retry=bool
argument to the modifier callback, to allow it to change its behavior on
non-initial calls. For Deleter, the logic would be to not assert
must_exist=True if is_retry=True.
changeset:fb9af2c7a00d7bec and changeset:7a0afb59a4aff9a2 fix this, with an extra 'first_time' argument to the modifier callback. I left Adder alone, and only changed Deleter.