Repository navigation
fix(mdadm): honor repeat notifications and retry failed degraded alerts - #1128
Merged
Merged
Conversation
A degraded MDADM array was announced only on the transition from healthy, decided by comparing with the previous Influx submission. The Repeat Notifications setting was never read, and when delivery failed the next collection saw the array as already degraded, so the alert was lost. An in-memory MDADMTracker on the notification gate now records the degradation last announced per array, and records it only when TrySend reports the notification delivered or queued. With repeat on, every collection notifies. With repeat off, the array is announced when it becomes degraded and again when it loses an active member or gains a failed one. A healthy upload clears the record. The history lookup is removed from the notification path, which also ends the accidental repeat when collections were more than a day apart. Documents the behavior and the permanently degraded Synology md0/md1 system and swap arrays. Fixes #1109
…ify-repeat # Conflicts: # webapp/backend/pkg/web/handler/mdadm_upload_metrics.go
Starosdev
pushed a commit
that referenced
this pull request
Nov 5, 2026
## [1.80.0](v1.79.3...v1.80.0) (2026-11-05) ### Features * **btrfs:** notify on degraded filesystems, device errors and scrub errors ([#1127](#1127)) ([36e1e23](36e1e23)), closes [#1110](#1110) * manual release trigger ([44f3e44](44f3e44)) * **notify:** alert when Btrfs or ZFS usage reaches a configurable threshold ([#1133](#1133)) ([6e79118](6e79118)), closes [#1127](#1127) [#1132](#1132) [#1127](#1127) * **zfs:** notify on unhealthy pools, error totals and scrub errors ([#1131](#1131)) ([9c6544c](9c6544c)), closes [#1127](#1127) [#1130](#1130) [#1127](#1127) ### Bug Fixes * **database:** inline validated ids in Btrfs and ZFS history queries for InfluxDB OSS ([#1111](#1111)) ([#1124](#1124)) ([b0a1c69](b0a1c69)), closes [#157](#157) [#155](#155) [#157](#157) [#157](#157) * **mdadm:** honor repeat notifications and retry failed degraded alerts ([#1128](#1128)) ([62f9cef](62f9cef)), closes [#1109](#1109) * **notify:** notify on manufacturer SMART failures at every notify level ([#1126](#1126)) ([5cb3622](5cb3622))
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
A degraded MDADM array was announced only on the transition from healthy, and the alert was lost for good if that one delivery failed. This makes MDADM notifications honor Repeat Notifications and retry until delivered.
Type of Change
Related Issues
Fixes #1109
Changes Made
MDADMTrackerto the notification gate (notify/mdadm.go). It records, per array, the degradation last announced, and records it only whenTrySendreports the notification delivered or queued. A send error or a rate-limit drop is retried on the next collection.Statestring. mdadm flipscleanandactivewith write activity, so comparing the string would re-announce an unchanged degradation. A state change with the same counts, such as the start of a rebuild, is therefore not announced.daywindow then held a single point.md0/md1system and swap arrays indocs/MDADM_MONITORING.md.The tracker state is in memory, like the other notification dedup state (rate limit, quiet queue, collector errors, missed ping, temperature). A web server restart announces each array that is still degraded once more. Persisting it was considered and rejected to stay consistent with that rule and avoid a migration.
developafter feat(btrfs): notify on degraded filesystems, device errors and scrub errors #1127: keepsendNotificationWithGatewith the signature feat(btrfs): notify on degraded filesystems, device errors and scrub errors #1127 introduced, now returning whether the notification was delivered or queued. The Btrfs path calls it unchanged.Testing
Local:
go build ./...andgo vet ./web/handler ./notifypass (vet compiles the tests). Tests were not run locally; CI runs them.New tests: six
MDADMTrackertests (single announcement, repeat on, retry after failed delivery, worsening, relapse after improvement, re-announce after recovery) and handler tests for mute, the unmuted path, and forgetting on a healthy upload.Checklist
Additional Notes
Review: not required (merging to
developships nothing until a manual release; no migration, security boundary, or shared contract change).Not included: a hint in the MDADM page or notification text about Synology system arrays. Adding it to every notification would add noise to real alerts; the docs entry and the existing mute cover it for now.