inhibitor merge cache and index so there's only one lock - #5559
Draft
Spaceman1701 wants to merge 1 commit into
Draft
inhibitor merge cache and index so there's only one lock#5559Spaceman1701 wants to merge 1 commit into
Spaceman1701 wants to merge 1 commit into
Conversation
Contributor
❯ ./run.sh
=== inhibit
flushes: 238231
Mutes calls: 297539
alerts muted: 201516 (67.73%)
flushes fully muted: 178227 (74.81%)
--- PASS: TestReplay (4.79s)
ok github.com/prometheus/alertmanager/inhibit 4.799s
=== patchedinhibit
flushes: 238231
Mutes calls: 297539
alerts muted: 201516 (67.73%)
flushes fully muted: 178227 (74.81%)
--- PASS: TestReplay (4.93s)
ok github.com/prometheus/alertmanager/patchedinhibit 4.940s
=== v29inhibit
flushes: 238231
Mutes calls: 297539
alerts muted: 201516 (67.73%)
flushes fully muted: 178227 (74.81%)
--- PASS: TestReplay (10.24s)
ok github.com/prometheus/alertmanager/v29inhibit 10.254s
=== 5449updatedinhibit
flushes: 238231
Mutes calls: 297539
alerts muted: 201516 (67.73%)
flushes fully muted: 178227 (74.81%)
--- PASS: TestReplay (5.55s)
ok github.com/prometheus/alertmanager/5449updatedinhibit 5.556s
=== 5542updatedinhibit
flushes: 238231
Mutes calls: 297539
alerts muted: 201516 (67.73%)
flushes fully muted: 178227 (74.81%)
--- PASS: TestReplay (5.24s)
ok github.com/prometheus/alertmanager/5542updatedinhibit 5.250s
=== 5559updatedinhibit
flushes: 238231
Mutes calls: 297539
alerts muted: 201516 (67.73%)
flushes fully muted: 178227 (74.81%)
--- PASS: TestReplay (4.52s)
ok github.com/prometheus/alertmanager/5559updatedinhibit 4.527s(inhibit test was rebased on main, so that is why this test no longer finds any missing mutes). |
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.
This change replaces the
store.Alertswith a newcachetype in the inhibitor. Thecacheis essentially a mergedstore.Alertsand inhibitorindexthat work under a single lock. This allows operations to modify the cache and index atomically, solving a bunch of possible race conditions in the Inhibitor.I believe that this resolves the last problems caught by the new tests added in #5449.