Skip to content

[manila-csi-plugin] Wait for access rule to become active after granting#3136

Open
gouthampacha wants to merge 1 commit into
kubernetes:masterfrom
gouthampacha:worktree-issue-3000-access-rule-wait
Open

[manila-csi-plugin] Wait for access rule to become active after granting#3136
gouthampacha wants to merge 1 commit into
kubernetes:masterfrom
gouthampacha:worktree-issue-3000-access-rule-wait

Conversation

@gouthampacha

@gouthampacha gouthampacha commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Manila's GrantAccess API is asynchronous — the access rule starts in queued_to_apply state and transitions through applying before reaching active. Both the NFS and CephFS share adapters were proceeding to mount immediately after granting access, which could fail if the backend hadn't applied the rule yet.

This PR adds a shared waitForAccessRuleActive helper that polls until the access rule reaches active state. On error state or timeout, the helper revokes the failed rule so the next reconcile retries cleanly. Both adapters now call this helper after GrantAccess.

For CephFS, this replaces the previous wait loop that only checked for AccessKey population without verifying the rule state. Waiting for active state implicitly guarantees the key is populated since Manila assigns the cephx key as part of applying the rule.

Which issue this PR fixes(if applicable):
fixes #3000

Special notes for reviewers:

Tested on a DevStack with both LVM (NFS) and native CephFS backends. Both protocols show the queued_to_applyactive transition, confirming the race window this fixes.

Release note:

[manila-csi-plugin] Wait for access rule to become active after granting access, fixing mount failures when backends are slow to apply rules.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 20, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign stephenfin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 20, 2026
@gouthampacha gouthampacha force-pushed the worktree-issue-3000-access-rule-wait branch 2 times, most recently from 5bdf397 to 1e8ec3a Compare June 20, 2026 05:18
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@gouthampacha: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cloud-provider-openstack-check 1e8ec3a link true /test pull-cloud-provider-openstack-check

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign stephenfin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Manila's GrantAccess API is asynchronous. The access rule starts in
"queued_to_apply" state and transitions through "applying" before
reaching "active". Both the NFS and CephFS share adapters were
proceeding to mount immediately after granting access, which could
fail if the backend had not yet applied the rule.

Add a shared waitForAccessRuleActive helper that polls until the
access rule reaches "active" state. On "error" state or timeout,
the helper revokes the failed rule so the next reconcile retries
cleanly. Both adapters now call this helper after GrantAccess.

For CephFS, this replaces the previous wait loop that only checked
for AccessKey population without verifying the rule state itself.

Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
@gouthampacha gouthampacha force-pushed the worktree-issue-3000-access-rule-wait branch from 0f47826 to 4a1bf29 Compare June 23, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[manila-csi-plugin] wait for the "active" access state

2 participants