Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

yuri-tceretian
Copy link
Contributor

Backport 537f1fb from #91224


What is this feature?
This PR fixes state persister to populate the result fingerprint field introduced in #75189 and accidentally removed in #80384
Also, it updates the state manager to always update result fingerprint when it does not match the existing one and emit a log message.

Why do we need this feature?
PR #80384 introduced a regression, which resulted in ResultFingerprint not being saved to the storage. Therefore, if the Grafana restarts the current state is fetched from the database, and the state's fingerprint remains empty. During the lifetime of the state, the resulting fingerprint is not updated, which breaks recovery threshold functionality that relies on this hash: the state manager provides an empty hash to the evaluator, and that hash does not match anything. Therefore, all dimensions that are supposed to be considered "loaded", and therefore evaluated using the unloading threshold, are evaluated against the loading threshold.
The state remains empty because the state manager never updates the result fingerprint of the existing state.

Who is this feature for?
Users of recovery threshold.

Which issue(s) does this PR fix?:

Related to and potentially fixes #87226

…threshold (#91224)

(cherry picked from commit 537f1fb)

# Conflicts:
#	pkg/services/ngalert/state/persister_sync.go
@yuri-tceretian yuri-tceretian merged commit 5da383d into v10.4.x Jul 31, 2024
@yuri-tceretian yuri-tceretian deleted the backport-91224-to-v10.4.x branch July 31, 2024 15:16
@Sergej-Vlasov Sergej-Vlasov modified the milestones: 10.4.x, 10.4.8 Aug 23, 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.

3 participants