Skip to content
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

[v10.0.x] Annotations: Split cleanup into separate queries and deletes to avoid deadlocks on MySQL #80681

Merged
merged 3 commits into from Jan 17, 2024

Conversation

alexweav
Copy link
Contributor

What is this feature?

Manual backport of #80329

… deadlocks on MySQL (#80329)

* Split subquery when cleaning annotations

* update comment

* Raise batch size, now that we pay attention to it

* Iterate in batches

* Separate cancellable batch implementation to allow for multi-statement callbacks, add overload for single-statement use

* Use split-out utility in outer batching loop so it respects context cancellation

* guard against empty queries

* Use SQL parameters

* Use same approach for tags

* drop unused function

* Work around parameter limit on sqlite for large batches

* Bulk insert test data in DB

* Refactor test to customise test data creation

* Add test for catching SQLITE_MAX_VARIABLE_NUMBER limit

* Turn annotation cleanup test to integration tests

* lint

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
(cherry picked from commit 81c45bf)
@alexweav alexweav added this to the 10.0.x milestone Jan 16, 2024
@alexweav alexweav requested a review from a team as a code owner January 16, 2024 22:52
@alexweav alexweav requested review from papagian, zserge and mildwonkey and removed request for a team January 16, 2024 22:52
Copy link
Member

@JacobsonMT JacobsonMT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexweav alexweav merged commit 0f4640d into v10.0.x Jan 17, 2024
11 checks passed
@alexweav alexweav deleted the backport-80329-to-v10.0.x branch January 17, 2024 17:36
@zserge zserge modified the milestones: 10.0.x, 10.0.11 Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants