fix(db): pre- SELECT ids with a LIMIT to control the amount of rows deleted for MySQL#1309
Merged
miaulalala merged 1 commit intomasterfrom Sep 13, 2023
Merged
fix(db): pre- SELECT ids with a LIMIT to control the amount of rows deleted for MySQL#1309miaulalala merged 1 commit intomasterfrom
miaulalala merged 1 commit intomasterfrom
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
kesselb
approved these changes
Sep 12, 2023
Collaborator
Author
|
/backport to stable27 |
Collaborator
Author
|
/backport to stable26 |
Collaborator
Author
|
/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.
This was referenced Sep 14, 2023
Member
Can we add a error (log) in the querybuilder when one tries that. I guess it's used in more places |
Collaborator
Author
it will throw anyway from doctrine |
Member
But the activity app never logged an error from it's cron job on our instance? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.