mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
0c688190f7
* Alerting: Fix unique violation when updating rule group with title chains/cycles The uniqueness constraint for titles within an org+folder is enforced on every update within a transaction instead of on commit (deferred constraint). This means that there could be a set of updates that will throw a unique constraint violation in an intermediate step even though the final state is valid. For example, a chain of updates RuleA -> RuleB -> RuleC could fail if not executed in the correct order, or a swap of titles RuleA <-> RuleB cannot be executed in any order without violating the constraint. The exact solution to this is complex and requires determining directed paths and cycles in the update graph, adding in temporary updates to break cycles, and then executing the updates in reverse topological order (see first commit in PR if curious). This is not implemented here. Instead, we choose a simpler solution that works in all cases but might perform more updates than necessary. This simpler solution makes a determination of whether an intermediate collision could occur and if so, adds a temporary title on all updated rules to break any cycles and remove the need for specific ordering. In addition, we make sure diffs are executed in the following order: DELETES, UPDATES, INSERTS. |
||
---|---|---|
.. | ||
api | ||
testinfra | ||
web | ||
README.md |
Integration tests
This directory contains Grafana server integration tests.