Fix access-delete 404 for orphaned share access rules - #352
Open
kpawar-sap wants to merge 1 commit into
Open
kpawar-sap wants to merge 1 commit into
kpawar-sap wants to merge 1 commit into
Conversation
When a ShareAccessMapping row exists with no associated ShareInstanceAccessMapping rows (an "orphaned" access rule), the user is stuck in an unrecoverable state: openstack share access show <id> -> succeeds (state: None) openstack share access list <share-id> -> rule NOT shown openstack share access delete ... -> 404 NotFound openstack share access allow (same IP) -> "already exists" error In all cases share_access_get() finds the orphaned row (no instance- mapping filter), while share_access_get_all_for_share() does not (it filters on instance_mappings.any()), causing the inconsistency. deny_access_to_instance() catches NotFound (no instance mapping for a share instance) and returns False rather than propagating a 404. deny_access() detects when every instance returned False and calls db.share_access_delete() directly to clean up the orphaned record, making 'access delete' succeed. Change-Id: I19b2e1b7b44d7d1e5a3dfaf1a93efbae27af8df7 Signed-off-by: Kiran Pawar <kinpaa@gmail.com> (cherry picked from commit e283921)
kpawar-sap
requested review from
Carthaca,
chuan137,
crenduchinta88,
skook1 and
sumitarora2786
as code owners
August 14, 2026 10:08
Author
|
upstream PR merged https://review.opendev.org/c/openstack/manila/+/998826 |
Carthaca
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a ShareAccessMapping row exists with no associated ShareInstanceAccessMapping rows (an "orphaned" access rule), the user is stuck in an unrecoverable state:
openstack share access show -> succeeds (state: None)
openstack share access list -> rule NOT shown
openstack share access delete ... -> 404 NotFound
openstack share access allow (same IP) -> "already exists" error
In all cases share_access_get() finds the orphaned row (no instance- mapping filter), while share_access_get_all_for_share() does not (it filters on instance_mappings.any()), causing the inconsistency.
deny_access_to_instance() catches NotFound (no instance mapping for a share instance) and returns False rather than propagating a 404. deny_access() detects when every instance returned False and calls db.share_access_delete() directly to clean up the orphaned record, making 'access delete' succeed.
Change-Id: I19b2e1b7b44d7d1e5a3dfaf1a93efbae27af8df7
(cherry picked from commit e283921)