opencloud
opencloud copied to clipboard
posixfs: metadata corruption on parallel uploads
This issue is similar to #1763, but slightly different as it can happen (and happens in the CI during test) without WATCHFS being enable. (Also the fix will be is somewhat different I think). So let's track this in a separate issue:
- User1 uploads a file
file1.txtto a space- User2 also uploads a file
file1.txtto the same space- the file uploaded by User1 gets into postprocessing first, but (for whatever reason) the postprocessing of the file uploaded by User2 finished before the postprocessing of User1's upload
Outcome:
- As soon as the postprocessing of the User2 upload finishes the
TOO_EARLYstatus code vanishes from the propfind response (even though the postprocessing of the User1 upload is not finished)- When postprocessing in finished for both files. The file ending up on the storage has the contents of the User1's upload, but the metadata attribute (blobid, size, ...) of the upload of User2. 💥
- A revision node exists with the metadata of User1's upload but without any content. The content uploaded by User2 is lost.
IMO the desired outcome should be:
- There should be revision node created with the contents and metadata of the upload that finished postprocessing first.
- The main filesystem node should have the content and metadata of the upload that finished postprocessing last.
- The TOO_EARLY (425) response to only go away after the postprocessing finished for both uploads
Originally posted by @rhafer in #1763