webapi PUT via multiple nodes can cause directory corruption but does not report UncoordinatedWriteError #970
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
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#970
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?
Multiple simultaneous Tahoe put(s) via web API cause directory level corruption resulting in no recoverable data.
To recreate
Step 1.) Create Directory ; Get directory writecap.
Step 2.) Using 61 .JPG files avg 1.7MB use test.sh script to put files to Tahoe-Lafs.
bash-3.2$ du -sh .
102m
bash-3.2$ ls *.JPG |wc -l
61
Error returned from curl
Error generated when trying to retrieve known good URI from child:
970-paste.txt
Note that the script is trying to upload using a different webapi server instance for each file, contrary to the [prime coordination directive]source:docs/frontends/webapi.txt?rev=4236#L1786.
However, this should probably have caused an UncoordinatedWriteError, rather than UnrecoverableFileError.
Tahoe Put can cause directory corruptionto webapi PUT via multiple nodes can cause directory corruption but does not report UncoordinatedWriteErrorwow, it sounds like you were actually able to provoke a real UCWE! Well, a real collision, at least.
So, did really none of the PUT commands result in an error? I would have expected at least one of them to emit a UCWE. Re-running the test and sending the output of each curl instance to a separate logfile would help answer this question. Also double-checking that curl emits errors to stdout when it gets a 500 or whatever HTTP error code UCWE maps to.
If you could, please do a file-check (with --verify) on the directory in question. With the dircap you show, the command would be "
tahoe check --verify --raw $FW
". I'm expecting to see a small number of shares of each version, for several different versions.The file-check output will tell us, but what were the encoding parameters in use when you ran this test? I know from another ticket you were experimenting with parameters on the order of 40-of-50.. if the dirnodes (and other mutable files) were created with these same parameters, they'd be much more vulnerable to UCWE than with the normal 3-of-10 encoding. If that was a factor here, we might want to consider separate encoding-parameter configs for dirnodes (or perhaps for all mutable files), so that you can use safer 3-of-10 for them and more efficient 40-of-50 for immutable bulk data. (Note that protection from UCWE comes from small "k", whereas the usual reliability against server problems comes from having a large N-k).
(also, incidentally, when pasting large shell transcripts into a Trac page like this one, you should wrap the block with triple-curlies, so that Trac will not try to interpret the comments as WikiFormatting. And please attach other things as trac attachments instead of e.g. codepad links, because a few months from now when somebody comes back to look at this ticket, the pastebin will have expired and the contents lost)
Careful here -- the only safe solution is to coordinate writes. Having different encoding parameters such as a smaller
k
may reduce the amount of damage to your data when an uncoordinated write is encountered (or it may not -- I vaguely recall that the reasoning about that was surprisingly subtle), but one shouldn't rely on that to protect one's data.source:docs/specifications/mutable.txt@3696#L48 The Prime Coordination Directive]
Hm, the docs in source:docs/specifications/mutable.txt@3696#L48 suggest the following four strategies:
directory generally satisfy this case, as long as you don't use two
clients on the same account at the same time
inbox would be a good example of this.
before you write into it
For example, we expect a future release to include a FURL for a
"coordination server" in the dirnodes. The rule can be that you must
contact the coordination server and obtain a lock/lease on the file
before you're allowed to modify it.
Then later they mention that a Tahoe-LAFS gateway automatically serializes requests that go through it to the same mutable file or directory. Perhaps that should be promoted to a fifth strategy: make all your writes to a certain mutable file or directory go through a certain Tahoe-LAFS gateway.
Attachment 970-paste.txt (4450 bytes) added
Error generated when trying to retrieve known good URI from child