← Back to Pull requests

SBR-Test: Add the Ceph RBD Block-mode storage write gate withheld test (RHWA-2039) #109

Open
RanWurmbrand opened this pull request with 334 lines diff across 4 files
View on GitHub
RanWurmbrand RanWurmbrand commented on Nov 03, 2026 15:26 UTC
Author

JIRA: RHWA-2039

Why we need this PR

Before a peer agent cordons or fences, the remediation reconciler checks status.storageValidation.concurrentWriteable on its SBRC. The operator only sets it once min(2, desired) agents are Ready, which is the evidence that shared storage takes concurrent writes. Until then the reconciler must emit FencingWithheld and do nothing else. Every Block-mode spec so far only runs with that gate open, so nothing checks that a closed gate actually stops fencing.

Changes made

  • New tests/sbr-operator/tests/block_storage_write_gate.go, reportxml.ID("2039"), Ordered, Serial, labeled TierAcceptance, ComponentRemediation, DisruptionNonDestructive, PlatformAny, FrequencyNightly.
  • Before the SBRC exists, the test starts a keepalive pod that holds /dev/watchdog open on every Ready worker except one. Those agents fail preflight, so only one agent becomes Ready out of at least two desired. Cordoned workers get a keepalive too, because the agent DaemonSet still runs on them. The test creates a Block-mode SBRC on Ceph RBD and asserts the DaemonSet has exactly 1 Ready and the gate is closed. It then creates a StorageBasedRemediation CR for a blocked worker and waits for a FencingWithheld Warning event naming the victim. For 90s it checks that the gate stays closed, the victim is never cordoned or tainted, the CR never reports FencingInProgress or FencingSucceeded, and every fence slot on the device stays empty.

    Teardown deletes the CR before the keepalive pods. Once they go, the blocked agents start, the gate opens, and a CR that was still there would be fenced for real.

  • New helper startWatchdogKeepalivePod in sbr_helpers.go. It is the keepalive pod creation that was inline in detect_only.go, moved out as is, and detect_only.go now calls it. No behaviour change there.
  • SBRCBlockWriteGateTestName and FencingWithheldReason constants in sbrparams.
  • docs/TESTCASES/rhwa-2039.md and a tests/sbr-operator/README.md entry.
  • Test plan

    Non-destructive: nothing is cordoned, fenced, tainted or rebooted. While it runs, SBR agents on every worker but one can't start. Requires SNR agents to be stopped. Skips when the cluster has no Ceph RBD StorageClass, fewer than 2 schedulable workers, no schedulable worker free of an SBR controller pod, or an NHC that uses the SBR template.

    ginkgo -v --label-filter="operator:sbr && component:remediation" \
        --focus="storage write check has not passed in Block mode" ./tests/sbr-operator/...
    

    make lint and make test pass.

    Diff: 334 lines (+250 / -84) across 4 files Reviewer: None requested Review duration: 46150m
    All Vouch review confidence checks passed
    Residual risk 0.35 = Change Risk (0.61) × (1 − Review Confidence (0.42)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.61 · 334 lines diff across 4 files
    0.61
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.348
    Shallow Review Depth shallow_review_depth
    0.344
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #109"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    RanWurmbrand RanWurmbrand
    Labels
    risk: medium confidence: 42.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 61.2% (MEDIUM) · Higher = larger blast radius
    61.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 42.2% · Lower = rushed or shallow review
    42.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 35.4% · Moderate risk
    35.4%