owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.37k stars 180 forks source link

Orphaned blobs when creating versions #9498

Closed kobergj closed 2 months ago

kobergj commented 3 months ago

Ocis creates orphaned blobs when the same file is uploaded multiple times.

That the file has only one version might be expected behaviour because it is the same file after all. But there should not be an orphaned blob because of this.

Note that this doesn't happen if you upload a file with different content but the same name. Versions are created as expected and there is no orphaned blobs.

kobergj commented 3 months ago

Found the reason:

decomposedfs is creating a pattern nodeid.REV.mtime for the revisioned node. If uploading the same file multiple times, web will send the mtime it reads from the disk. Since the mtime will always be the same (if the file is not modified) ocis will just overwrite the revisioned node with new blob metadata. This is why ocis just forgets the blob in the blobstore and moves on.