-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Restoring multiple big folders from trash bin fails #43759
Comments
This reminds me a bit of a reported issue where an instance runs out of memory when doing operations on super large directories. This is very infrastructure/setup dependant, and It might be unrelated, but an idea then was to create some sort of admin setting to limit the number of allowed files in a directory, including the trashbin. While certainly not a satisfactory solution, we're bound to run into some kind of friction when dealing with absurdly large amounts of files/data. Depending on what analysis of the root cause reveals, maybe this could be an alternative approach. |
["An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","/remote.php/dav/trashbin/bob/trash/bigFolder4.d1709033304"]
["An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","/remote.php/dav/trashbin/bob/trash/bigFolder3.d1709033304"]
["An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction","/remote.php/dav/trashbin/bob/trash/bigFolder1.d1709033304"]
["Transaction took 36.729679107666s","/remote.php/dav/trashbin/bob/trash/bigFolder2.d1709033304"] Seems to be a concurrency problem. |
Info on the deadlock:
|
It’s not clear to me why the DELETE does not deadlock the same. It does thing in reverse order and update cache first but otherwise it’s the same kind of logic. |
Looking at the query log for both delete and restore, it looks quite similar, there is only one more UPDATE query on restore side, related to storage_mtime. |
When deleting the 4 folders, it seems the concurrency does not slow down deletion at all, each request takes less than 2 sec on my setup. |
I tried #43531 but it does not avoid the deadlock. |
Current @Altahrim theory:
|
Bug description
Restoring multiple big folders at once from trash bin fails with an error message: "Failed to restore some elements"
Steps to reproduce
bigFolder1
,bigFolder2
,bigFolder3
andbigFolder4
for i in {1..10000}; do touch test${i}.txt; done
sudo -u www-data php ./occ files:scan <uid>
Expected behavior
all folders are restored without error
Installation method
Community Manual installation with Archive
Nextcloud Server version
master
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: