grafana/pkg/services/annotations/annotationsimpl
Alexander Weaver 81c45bfe44
Annotations: Split cleanup into separate queries and deletes to avoid 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>
2024-01-12 14:05:04 -06:00
..
loki Alerting/Annotations: Add annotation backend for Loki alert state history (#78156) 2024-01-10 18:42:35 -05:00
annotations_test.go Folders: Show dashboards and folders with directly assigned permissions in "Shared" folder (#78465) 2023-12-05 16:13:31 +01:00
annotations.go Annotations/Alerting: Add Loki historian store stub (#78363) 2023-12-12 17:43:09 -05:00
cleanup_test.go Annotations: Split cleanup into separate queries and deletes to avoid deadlocks on MySQL (#80329) 2024-01-12 14:05:04 -06:00
cleanup.go Annotations: Lift parts of RBAC from xorm store into auth service (#76967) 2023-11-14 18:11:01 -05:00
composite_store_test.go Annotations/Alerting: Add Loki historian store stub (#78363) 2023-12-12 17:43:09 -05:00
composite_store.go Annotations/Alerting: Add Loki historian store stub (#78363) 2023-12-12 17:43:09 -05:00
store.go Annotations/Alerting: Add Loki historian store stub (#78363) 2023-12-12 17:43:09 -05:00
time.go Annotations: Lift parts of RBAC from xorm store into auth service (#76967) 2023-11-14 18:11:01 -05:00
xorm_store_test.go RBAC: Change annotation filter to use dashboard based annotation scopes (#78635) 2023-11-29 05:34:44 -05:00
xorm_store.go Annotations: Split cleanup into separate queries and deletes to avoid deadlocks on MySQL (#80329) 2024-01-12 14:05:04 -06:00