-
Notifications
You must be signed in to change notification settings - Fork 65
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
fix(db): pre- SELECT ids with a LIMIT to control the amount of rows deleted for MySQL #1309
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
83f56ae
to
e613bbe
Compare
7bc6156
to
2acf458
Compare
Signed-off-by: Anna Larch <anna@nextcloud.com>
e577c93
to
3be135c
Compare
/backport to stable27 |
/backport to stable26 |
/backport to stable25 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Can we add a error (log) in the querybuilder when one tries that. I guess it's used in more places |
it will throw anyway from doctrine |
But the activity app never logged an error from it's cron job on our instance? |
Doctrine does not allow LIMITs on DELETE queries:
https://stackoverflow.com/questions/25308171/doctrine-query-delete-with-limit
Thus we need to handle MySQL/MariaDB separately as clustered setups are not going to be able to handle more than 128k rows / 2GB of writes at any one time.
I have set the current LIMIT to 10k but an argument could probably be made to use 20k. We can adjust in the future. I choose this limit to handle clustered setups where wsrep_max_ws_size or wsrep_max_ws_rows is lower than the expected value.
MySQL also doesn't allow LIMITs in IN subqueries.