Skip to content

autoExportPolicy: a node with an existing publication is locked out permanently when its export rule is missing or stale — no code path ever repairs export policies #1181

Description

@notsrch

Describe the bug

With autoExportPolicy: true, export-policy rules for a node are written in exactly one
place: that node's own ControllerPublishVolume (publishQtreeShare /
ensureNodeAccessForPolicyAndApply add the publishing node's IPs to the qtree policy and
the FlexVol's backend policy). Nothing else ever adds or corrects a rule:

  • Kubernetes does not re-issue ControllerPublish while a VolumeAttachment exists, so a node
    with an intact publication never publishes again — sometimes for months.
  • ReconcileVolumeNodeAccess is a no-op for the economy driver
    (storage_drivers/ontap/ontap_nas_qtree.go), so per-qtree policies are never reconciled
    against publication records.
  • ReconcileNodeAccess reconciles only the backend policy, and node re-registration with a
    changed IP does not repair the per-qtree policies a node is published to.
  • kubelet's mount retries (every ~2 minutes) never reach the Trident control plane.

Consequence: whenever a published node's rule goes missing or stale — node IP change,
out-of-band rule edit, or a Trident-side deletion such as the one in #1179 — that node
fails every new mount of the affected volume forever, while tridentvolumepublications
and tridentnodes remain perfectly correct. The unpublish path
(removeExportPolicyRules) even accelerates the decay: it prunes any rule that matches no
currently-registered node IP, so another node's routine unpublish removes the stale rule of
an unrelated re-IP'd node, with nothing to put the correct one back.

The only recoveries available today are manual: delete the node's VolumeAttachments (forcing
a fresh publish) or edit the export policy on the array.

We hit both variants of this in production on Trident 26.06.0:

  1. Node IP change (2026-08-23). A worker re-IP'd. Its rule in two long-lived shared-RWX
    qtree policies kept the old IP (rule index 34, while the policies' active churn was at
    indexes 76–81 — the rule had not been touched since long before), then was pruned as
    stale by other nodes' unpublishes. All new mounts on that worker failed with
    exit status 32 for 8 days. Its publications for the shared volumes persisted the entire
    time, so no fresh publish ever added the new IP.
  2. After a rule wipe (2026-08-31, ontap-nas-economy: controller restart deletes all rules from the backend export policy, revoking NFS access for every node on the backend #1179). Five workers with intact publications
    stayed locked out of every volume on the backend for hours. Each node recovered only at
    its next fresh publish, which required us to delete its stuck pods so the
    VolumeAttachments were recreated (rule re-adds observed at 19:11:30, then 20:02:38–:53
    for four nodes as we rolled pods). One node's replacement pods re-pinned the old
    VolumeAttachments within seconds, so no fresh publish could ever fire; it stayed locked
    out until we added its IP on the array.

Environment

  • Trident version: 26.06.0 (IP-change variant first manifested while running this version; code unchanged on master as of 2026-08-31)
  • Trident installation flags used: operator-based install, defaults
  • Container runtime: containerd (RKE2)
  • Kubernetes version: v1.34.2
  • Kubernetes orchestrator: RKE2 (Rancher-managed)
  • Kubernetes enabled feature gates: defaults
  • OS: Linux (RKE2 nodes)
  • NetApp backend types: ONTAP, ontap-nas-economy driver, REST API, autoExportPolicy: true, autoExportCIDRs: ["10.63.0.0/21"]
  • Other: shared RWX volumes mounted by all 6 workers; short-lived pods churn continuously

To Reproduce

  1. ontap-nas-economy backend, autoExportPolicy: true.
  2. Publish an RWX volume to node A and keep at least one pod using it on node A (so the
    VolumeAttachment and publication persist).
  3. Change node A's IP (reboot with a new DHCP lease reproduces our case), and let normal
    pod churn on other nodes trigger publish/unpublish cycles on the same volume.
  4. Node A's registered IP in tridentnodes updates correctly, but the export policies keep
    (and eventually lose) only the old IP. Every new mount of the volume on node A now fails
    with mount.nfs: access denied / exit status 32.
  5. Observe that no Trident activity ever repairs the rule; deleting node A's
    VolumeAttachment (forcing a fresh publish) fixes it immediately.

Step 3 can be replaced by deleting node A's rule on the array — the outcome is identical,
which is what makes this the severity multiplier for any rule-loss bug.

Expected behavior

Trident's recorded intent (publications + registered node IPs) should converge to ONTAP
state. Some combination of:

  • Periodic or event-driven reconciliation of qtree-level and FlexVol-level policies against
    volume publications and current node IPs (e.g., extend the existing periodic node-access
    reconciliation, and implement ReconcileVolumeNodeAccess for this driver).
  • Node update (IP change) triggering repair of policies for volumes published to that node.
  • ControllerPublishVolume is already idempotent and re-adds rules when invoked — the gap is
    purely that nothing invokes it or an equivalent repair when state drifts.

Additional context

AI assistance

Assisted-by: Claude Fable 5 noreply@anthropic.com

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions