Uh oh!
There was an error while loading. Please reload this page.
make NextCloud WORM file system friendly - #24596
Conversation
rullzer
commented
Feb 11, 2021
@kofemann as far I know you have been running with this in production for some time now right? |
kofemann
commented
Feb 12, 2021
@rullzer We would like to run some tests to validate that other things (like apps) are not broken. Do you have a testsuite that we can run locally? |
PVince81
commented
Jan 28, 2022
the code looks fine to me in general, I'm hoping that the extra unlink will not cause much extra overhead, but we're talking about local storage anyway so should be fine. @icewind1991 thoughts ? |
PVince81
commented
Jan 28, 2022
@kofemann please rebase and resolve the conflicts |
PVince81
commented
Jan 28, 2022
regarding tests, at least the ones with regular storage, are already running in our CI so if something is broken we'll likely see this immediately |
kofemann
commented
Jan 28, 2022
@PVince81 Thanks for the update. Actually, since 2 weeks we run this code with nextcloud 22.2.3 in a production. Up to now we haven't seen any issues. |
PVince81
commented
Jan 28, 2022
that's great to hear! I took the liberty to click "ready for review" |
PVince81
commented
Feb 7, 2022
some strange errors in multiple places: I'm wondering if the change in this PR somehow interferes with test cleanup, but I can't see how |
kofemann
commented
Feb 7, 2022
This is obviously something that I have to look at. Is it possible to run the test manually? |
PVince81
commented
Feb 7, 2022
this is how I usually test locally: |
icewind1991
commented
Feb 9, 2022
I would expect a filesystem to be smart enough to handle the "truncate an existing file and write to it" case, but I'm fine adding some logic for it. It should only |
icewind1991
left a comment
There was a problem hiding this comment.
Please add a check if the file exists before deleting it
kofemann
commented
Mar 31, 2022
I have added a coifing option control this behavior. A check before unlink will issue unnecessary stat call. |
kofemann
commented
Apr 13, 2022
@icewind1991 any plans to include this into NC24? |
Uh oh!
There was an error while loading. Please reload this page.
Some filesystems run as a Write-Once-Read-Many storages. This makes them impossible to use with NexeCloud, as the file system layers uses `truncate` syscall (through file_put_contents function). As Nextcloud is never updates existing files, removing the old entry and creatint a new one on update will allow NextCoud to update on such file systems. Update Local#fopen and Local#file_put_contents to remote existing file before truncating. Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
kofemann
commented
Aug 25, 2022
rebased on top of current master |
PVince81
commented
Sep 16, 2022
@kofemann the code looks fine. please sign off your commits, see https://github.com/nextcloud/server/pull/24596/checks?check_run_id=8012932504 I'll try and find a second reviewer to get this in. thanks! |
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
To avoid extra truncate on non WORM file systems, add a new config option `localstorage.unlink_on_truncate`, which defaults to false. The OC\Files\Storage\Local is update to respect that option. Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
No description provided.