Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

GlusterFS Brick Split Brain and Heal Backlog Sentinel

Audits GlusterFS volume telemetry to detect replica brick split-brain states and self-heal crawl backlogs before POSIX volume mounts freeze.

Categories
DataInfrastructure

Audits GlusterFS distributed replicated storage volumes across datacenter environments to detect replica brick split-brain conditions, pending self-heal backlogs, and storage brick disconnects.

How it works

  1. A schedule trigger executes the GlusterFS volume audit workflow every 15 minutes.
  2. The Python task queries the GlusterFS Prometheus exporter endpoint (gluster-exporter:9189).
  3. The script extracts split-brain file entry totals, pending self-heal backlog counts, active connected brick tallies, and P99 I/O write latencies.
  4. An evaluation gate determines whether split-brain entries or self-heal crawl backlogs breach operational tolerance bounds.
  5. When thresholds are breached, a high-priority Slack alert is dispatched to storage reliability engineers and Linux platform SREs.
  6. When all replica bricks synchronize smoothly without split-brain conflicts, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for storage governance compliance logs and volume availability SLA archives.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape GlusterFS Exporter Metrics]
    ScanMetrics --> EvalBreach{Split-Brain >= Threshold OR Heal Pending > 500?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency Storage Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal GlusterFS Storage State]
    SlackAlert --> EmitManifest[Debug Return: GlusterFS Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute intervals.
  • Script Task: Scrapes GlusterFS Prometheus exporter metrics using Docker container isolation.
  • Decision Gate: Evaluates whether split-brain files or heal backlogs exceed stability safety limits.
  • Notification Task: Dispatches structured Slack alerts with volume identity and split-brain counts.
  • Audit Manifest: Emits JSON execution payloads containing volume health and timestamps.

Key capabilities

  • Continuous surveillance of GlusterFS AFR (Automatic File Replication) split-brain conditions.
  • Rapid detection of network partitions between storage nodes causing divergent file replicas.
  • Early warning before POSIX clients encounter EIO (Input/output error) on file reads or writes.
  • Zero external dependency execution via isolated containerized Python runners.

What you get

  • Preemptive alerting on clustered filesystem corruption and data divergence before backup archives fail.
  • Automated tracking of pending self-heal crawl entries and replica brick latency trends.
  • Real-time audit manifests capturing storage health for SOC 2 and ISO 27001 data integrity audits.
  • Configurable tolerance thresholds adaptable to 2-way replica, 3-way replica, and arbiter volume topologies.

Who it's for

  • Storage SREs and Linux systems administrators managing GlusterFS distributed persistent volumes.
  • Kubernetes platform engineers operating Red Hat OpenShift Container Storage (OCS) or Heketi pools.
  • Infrastructure architects safeguarding persistent volume claims (PVCs) for enterprise workloads.
  • Database administrators utilizing network-attached clustered filesystems for backup repositories.

Why orchestrate this with Kestra

  • Deterministic Scheduling: Guarantees regular storage health audits without fragile local crontab scripts.
  • Containerized Runners: Runs Python tasks inside isolated Docker containers without host library dependencies.
  • Condition Branching: Flowable If tasks route alerts and nominal logging cleanly without spaghetti code.
  • Enterprise Secret Safety: Securely injects Slack webhook credentials without plain-text exposure.

Use cases

  • Transient Network Split: Detects AFR divergence when temporary network cuts cause parallel writes on split bricks.
  • Disk Brick Failure Recovery: Monitors heal crawl velocity after replacing a damaged hard drive in a brick pool.
  • Heal Thread Starvation: Alerts when millions of small files overwhelm the background self-heal daemon crawl queue.
  • Rolling Storage OS Upgrades: Tracks brick reconnection and heal progress during rolling host kernel reboots.

Inputs

Name Type Default Description
glusterfs_metrics_url STRING http://gluster-exporter.storage.svc.cluster.local:9189 Base HTTP URL exposing GlusterFS Prometheus metrics.
volume_name STRING gluster-gv0-persistent-data Target GlusterFS distributed replicated volume identifier.
max_split_brain_entries_threshold INT 1 Maximum allowable file entries in split-brain state before alerting.
lookback_minutes INT 15 Lookback evaluation window in minutes for failure rates.
alert_on_split_brain BOOL true Toggle Slack alert dispatch upon detecting split-brain files.

Expected outputs

  • {{ outputs.scan_glusterfs_volume_metrics.vars.split_brain_entries_count }}: Count of files currently trapped in split-brain state.
  • {{ outputs.scan_glusterfs_volume_metrics.vars.heal_pending_entries_count }}: Number of pending entries awaiting self-heal synchronization.
  • {{ outputs.scan_glusterfs_volume_metrics.vars.bricks_connected_count }}: Count of active connected storage bricks.
  • {{ outputs.scan_glusterfs_volume_metrics.vars.brick_latency_p99_ms }}: 99th percentile brick I/O write latency in milliseconds.
  • {{ outputs.scan_glusterfs_volume_metrics.vars.is_alerting }}: Boolean flag indicating whether failure thresholds were breached.
  • {{ outputs.emit_audit_manifest.value }}: Structured JSON audit manifest emitted for compliance archives.

Prerequisites

  • GlusterFS storage cluster running with glusterfs-exporter or gluster Prometheus exporter active.
  • Exporter port reachable from the Kestra worker execution environment.
  • Docker daemon running on the Kestra host to execute containerized Python tasks.

Secrets

  • SLACK_WEBHOOK_URL: Incoming webhook URL for the target Storage SRE Slack alerting channel.

Quick start

  1. Ensure GlusterFS nodes run with self-heal daemon active (gluster volume set <vol> cluster.heal-timeout 300).
  2. Configure the SLACK_WEBHOOK_URL secret in your Kestra namespace settings.
  3. Specify your GlusterFS volume name in volume_name.
  4. Execute a manual test run via the Kestra UI to verify metric ingestion.
  5. Enable the periodic_glusterfs_audit trigger to establish automated continuous surveillance.

Common pitfalls and troubleshooting

  • Split-Brain Resolution CLI: Split-brain files require manual resolution via gluster volume heal <vol> split-brain.
  • Arbiter Configuration: Without an arbiter brick, 2-node replica volumes are highly vulnerable to split-brain.
  • Heal Process CPU Throttling: Background self-heal can saturate brick storage disk IOPS if heal rate is untuned.
  • Extended Attribute Mismatch: Discrepancies in trusted AFR extended attributes (trusted.afr.*) cause lock stalls.

How to extend

  • Automated Heal Trigger: Chain an SSH or Ansible command task to launch gluster volume heal <vol> on heal backlogs.
  • Brick Read-Only Protection: Trigger a volume quorum check to freeze degraded bricks before divergent writes occur.
  • PagerDuty Escalation: Escalate to on-call storage engineers if split-brain files exceed 5 entries across a cluster.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.