Repository navigation
Remove the need for the transaction in the database locking backend - #19098
Conversation
|
@individual-it relevant for your issues |
|
Note that this means we no longer clean up the database for empty lock entries but we get some performance for that since we can re-use the rows instead of constantly deleting and re-creating them |
|
Fixes the issue 👍 But I'm worried about polluting the database with stray entries, especially when files are deleted/moved or unused for a long time. @icewind1991 pointed out that big installs should use memcache anyway. @DeepDiver1975 what do you think ? Should a cron job be added to clear stray DB lock entries ? (in a separate PR). It might be possible to do it in the future as part of the TTL enhancement. |
|
@icewind1991 so the race conditions that you mention here #18918 (comment) can only happen in the case of removing locks? If so I would propose:
Would that solve all problems? |
Just saying: we still use transactions in other places, but yes it is less dangerous now |
There was a problem hiding this comment.
This is spamed quite heavily by the uploadFiles tests and is of less use now?
Degrade to debug or remove?
As already stated on IRC: |
So - yes - cron job and ttl. go go go ... |
|
@oparoz does this PR fix your locking issues ? |
abba172 to
7c66328
Compare
Is still relevant since we can still be inside a transaction while trying to get a lock
Can't do that due to race conditions |
|
It now deletes old rows |
There was a problem hiding this comment.
So basically the column "ttl" should have been called "expiretime". Too late to change it now.
cannot see any code that uses transactions on the lock table. And if then something need to be done with that if statement. Throwing a Exception? What is the log entry good for?
yes you are right. We could throw an Lock exception in case two inserts happen at the same time an one fails, but I guess it is not worth the little performance advantage. |
|
I'm fine with this PR 👍 |
Remove the need for the transaction in the database locking backend
|
@icewind1991 @DeepDiver1975 @PVince81 I just tested this PR because of #19150. After removing Having a folder in the users home and a SMB mount present. When I change to the local folder, no log entry is written, but if I change to SMB, a bunch of log entries like below are created: owncloud.log |

transactions lead to errors during concurrent access.
The only reason we required the transaction was to prevent the lock field from being removed between init and update.
Fixes smashbox test_uploadFiles and test_basicSync for me
cc @DeepDiver1975 @PVince81 @nickvergessen