mdmon

package
v3.0.0-rc67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func (*Manager) Start

func (t *Manager) Start(parent context.Context) error

Start starts the md monitor, which waits for the md events while the node holds an md resource.

func (*Manager) Stop

func (t *Manager) Stop() error

Stop stops the md monitor manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL