Documentation
¶
Overview ¶
Package mdmon watches the state changes of the md arrays of the node, and publishes them as pubsub events, for the instances holding an md resource to evaluate their status again.
An md array changes state with no action of the node to tell: a resync or a recovery ends, seconds or hours after the action that started it, a device fails or is added back. Without the monitor, the change is seen at the next scheduled status, with the instance said resyncing or degraded meanwhile.
It waits for the md events the kernel signals on /proc/mdstat, as mntmon waits for the mount events on /proc/self/mountinfo and as "mdadm --monitor" does, while the node holds an md resource (see package evwatch). The kernel does not tell which array changed: the arrays whose lines of /proc/mdstat changed are, and the instance holding each refreshes its status, by the kernel name of its array its md resource tells.
A change is published debounceDelay after it is read, and only when a local instance holds the array then: an array an instance just started is named in its status by the end of its action, which the delay leaves time for. An array no md resource names, as one assembled outside of the agent for a resource down, is told apart by its uuid, from its udev link. An event changing no line, as an array resynced whole between two reads, names no array, for the instances whose md resource status still tells a transient state, as resyncing, to refresh.
Where the md module is not loaded, the monitor waits for it, as the first array created loads it.
It is not mdadm's own mdmon, the monitor of the arrays of external metadata.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager watches the md events of the node and publishes a MdArrayUpdated message when the node holds an md resource.
func NewManager ¶
func NewManager(drainDuration time.Duration, subQS pubsub.QueueSizer) *Manager
NewManager creates a new md monitor manager