Documentation
¶
Index ¶
Constants ¶
const ( // RequestDir is where fence agents write fence request files RequestDir = "/localdisk/fence-recorder/requests" // ResponseDir is where nnf-sos writes fence response files ResponseDir = "/localdisk/fence-recorder/responses" )
Fence Recorder Configuration These paths are shared between nnf-sos and fence-agents repositories. If you change these values, ensure both repositories are updated.
Variables ¶
This section is empty.
Functions ¶
func AcknowledgeDLMFence ¶ added in v0.1.30
AcknowledgeDLMFence acknowledges that a node has been fenced in DLM. This is necessary to unblock any pending DLM lock operations that are waiting for fencing confirmation. Without this, operations like `vgchange --lock-start` and `lvchange --activate ys` will hang.
The nodeName should be the short hostname of the fenced node (e.g., "rabbit-compute-3"). This function looks up the corosync node ID for the given hostname and calls `dlm_tool fence_ack <nodeid>` to acknowledge the fence.
This function handles all errors internally and logs them appropriately. It never fails because DLM fence acknowledgment is best-effort.
func ConfirmPacemakerFence ¶ added in v0.1.30
ConfirmPacemakerFence confirms a node as fenced in Pacemaker. This removes the UNCLEAN status from the node, allowing cluster operations like `pcs cluster stop` to proceed without waiting.
Types ¶
type FenceRequest ¶
type FenceRequest struct {
RequestID string `json:"request_id"`
Timestamp string `json:"timestamp"`
Action string `json:"action"`
TargetNode string `json:"target_node"`
RecorderNode string `json:"recorder_node"`
FilePath string `json:"-"` // Not from JSON, added when parsing
ReceivedAt time.Time `json:"-"` // When we received this request, for stale cleanup
}
FenceRequest represents a fencing request written by a fence agent
type FenceResponse ¶
type FenceResponse struct {
RequestID string `json:"request_id"`
Status string `json:"status,omitempty"` // "success" or "error"
Success bool `json:"success"`
Message string `json:"message"`
Timestamp string `json:"timestamp"` // ISO 8601 timestamp
TargetNode string `json:"target_node"`
Action string `json:"action,omitempty"`
RecorderNode string `json:"recorder_node,omitempty"`
ActionPerformed string `json:"action_performed,omitempty"`
}
FenceResponse represents the response written by nnf-sos after processing a fence request