Skip to content

NodePublishVolume fails with "failed to set source device readwrite" when DRBD Primary role is stuck on a node other than the one CSI publishes to #1031

Description

@vooodoo10

What happened

Multiple newly-provisioned PVCs (created via volumeBindingMode: Immediate StorageClasses) got stuck in ContainerCreating with:

rpc error: code = Internal desc = NodePublishVolume failed for <pvc>: failed to set source device readwrite: exit status 1

drbdadm status <resource> on each node shows the DRBD role is Primary (with open:no — unused) on a node that is different from the node the pod was actually scheduled to and that NodePublishVolume is targeting. Example:

# on node az2-01 (stale primary, open:no):
pvc-ddadb066-... role:Primary
  disk:UpToDate open:no
  az2-02 role:Secondary
  az2-03 role:Secondary

# pod is actually scheduled on az2-03, which is Secondary and can't promote
# because az2-01 already holds Primary.

This reproduces on plain (non-topology-restricted) replicated-style StorageClasses, so it isn't specific to any topology/replicasOnSame constraint — it looks like a race between initial volume formatting (which transiently promotes some node to Primary) and the pod's eventual scheduled node, with no handoff/demotion of the stale Primary afterward.

Expected behavior

NodePublishVolume on the pod's target node should either wait for / trigger demotion of a stale, unused (open:no) Primary elsewhere, or the CSI driver should not leave an unused Primary behind after formatting.

Steps to reproduce

  1. Create a StorageClass with volumeBindingMode: Immediate and a DRBD-backed resource group (layerList: "drbd storage", autoPlace >= 2).
  2. Create a PVC + pod (e.g. a StatefulSet where the pod initially fails to schedule and retries — FailedScheduling: 0/N nodes are available: pod has unbound immediate PersistentVolumeClaims — before finally landing).
  3. Observe the pod stuck in ContainerCreating, FailedMount with "failed to set source device readwrite".
  4. Compare drbdadm status <resource> across all nodes hosting a replica — one will show role:Primary disk:UpToDate open:no on a node other than the pod's node.

Workaround

drbdadm secondary <resource> on the node holding the stale, unused (open:no) Primary. Kubelet's mount retry then succeeds.

Attachments

See accompanying diagnostic bundle: DRBD status output across nodes, linstor resource/volume list, linstor-csi node logs, PVC/PV manifests, StorageClass manifest, and full events for the affected pods.

Environment

  • Kubernetes v1.35.6 (Talos Linux, 3-node cluster)
  • piraeus-operator v2.10.8
  • linstor-controller (piraeus-server) v1.33.3
  • linstor-csi (piraeus-csi) v1.11.3
  • DRBD kernel module 9.3.2, drbd-utils GIT 54d5a64

00-affected-resources.txt
drbd-status.txt
linstor-resource-state.txt
original-error.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions