maintenance: canonicalize alert label fingerprints - #4283
Open
zqr10159 wants to merge 2 commits into
Open
Conversation
Member
Author
|
Author remediation update: The upgrade blocker was removed by narrowing canonicalization to transient in-memory cache identity. Durable alert fingerprints and all database and external relationships keep their existing algorithm and values, so an alert firing before upgrade continues the same active record and can resolve after restart. No database, silence, acknowledgement, or inhibition migration is required. Restart and firing-to-resolve regressions passed (22 focused tests), and the full alerter reactor passed (439 tests). All current GitHub checks are green. The author-side upgrade blocker is resolved; maintainer review is still required. |
zqr10159
marked this pull request as ready for review
July 31, 2026 02:51
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.
Summary
SingleAlert.fingerprintCompatibility evidence
AlertUtil.calculateFingerprintis used only for the in-memory calculator cache.AlarmCacheManagerreconstructs that coordinate from persisted labels during startup. The durable alert identity is generated separately byAlarmCommonReduce.generateAlertFingerprint; this pull request does not change that path.The added restart regression loads a persisted firing alert, rebuilds the new cache coordinate from its labels, resolves it through the cache, and verifies that its durable fingerprint remains unchanged. A separate reducer contract verifies the durable fingerprint format and its exclusion of timestamp labels.
Consequently, this change does not rewrite database identities or break group, silence, or inhibition references, and a versioned database migration or dual-read path is not required.
Validation
{a:b, c:d}from{a:d, c:b}and map-order regression preserves deterministic output./mvnw -pl hertzbeat-alerter -am -Dtest=AlertUtilTest,AlarmCacheManagerTest,AlarmCommonReduceTest,MetricsPeriodicAlertCalculatorTest,MetricsRealTimeAlertCalculatorTest,DbAlertStoreHandlerImplTest test -DskipITs -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false— 22 tests passed./mvnw -pl hertzbeat-alerter test -DskipITs— 439 tests passed, 2 skippedAI assistance: used for draft implementation and test iteration.
Human validation: focused cache/reducer contracts and the complete alerter test suite passed after rebuilding the current reactor dependencies.
Risk notes: only the transient calculator cache coordinate changes. Persisted alert identity remains unchanged and the cache is rebuilt from labels at process startup.