Skip to content

HDDS-15982. Fix UnsupportedOperationException and add idempotent deletion in RangerClientMultiTenantAccessController - #10872

Merged
smengcl merged 17 commits into
apache:masterfrom
MahmoudHassanen99:HDDS-15982
Aug 11, 2026
Merged

HDDS-15982. Fix UnsupportedOperationException and add idempotent deletion in RangerClientMultiTenantAccessController#10872
smengcl merged 17 commits into
apache:masterfrom
MahmoudHassanen99:HDDS-15982

Conversation

@MahmoudHassanen99

@MahmoudHassanen99 MahmoudHassanen99 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  1. Fixed UnsupportedOperationException when initializing policy items/accesses in RangerClientMultiTenantAccessController by using explicit mutable ArrayList instances.
  2. Kept createRole and createPolicy operations fail-fast. Ranger creation errors, including duplicate errors, are propagated.
  3. Added tolerant deletion to deleteRole and deletePolicy operations. Missing resources reported through HTTP 404 are ignored. The Ranger 2.8 HTTP 400 response for a missing role is also ignored.

What is the link to the Apache JIRA issue?

https://issues.apache.org/jira/browse/HDDS-15982

How was this patch tested?

Verified via code inspection and integration flow testing for multi-tenant Ranger client access management.

…RangerClientMultiTenantAccessController

Co-authored-by: sallmayasser <sallmayasser512@gmail.com>
@adoroszlai
adoroszlai requested a review from smengcl July 26, 2026 04:28

@adoroszlai adoroszlai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MahmoudHassanen99 for the patch. Please enable workflows in your fork.

@MahmoudHassanen99

Copy link
Copy Markdown
Contributor Author

Thanks @adoroszlai and @ayushtkn for the review

I have pushed a new commit addressing all the feedback (cleaned up Javadoc/license, removed internal tags, and kept single-line logging). Ready for another look

MahmoudHassanen99 and others added 2 commits July 26, 2026 14:20
Co-authored-by: Amr ElBoridy <amrelboridy7@gmail.com>
@MahmoudHassanen99

Copy link
Copy Markdown
Contributor Author

Hi @adoroszlai @AyushSaxena,

Fixed the issues, all CI tests are now passing 100% green on my fork

Could you please approve the workflow run here when you get a chance?
Thank you for your effort

@adoroszlai

Copy link
Copy Markdown
Contributor

Thanks @MahmoudHassanen99 for updating the patch. @smengcl please take a look.

@MahmoudHassanen99

Copy link
Copy Markdown
Contributor Author

Hi @smengcl, just a gentle check-in on this PR when you have a moment. All CI checks are passing 100% green (43/43), Thank you

@smengcl smengcl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. The mutable-list change addresses the immediate UnsupportedOperationException. I have two concerns about the new retry and deletion handling:

  1. The duplicate handling may not fully guarantee idempotent creation because it can return success without verifying that Ranger reached the requested state.
  2. Ranger 2.8 appears to report deletion of an absent role as HTTP 400 rather than 404, so the current check may not make deleteRole idempotent.

I left inline comments with more detail. Could you also add coverage for matching and conflicting duplicate state, deletion of an absent role, and an unrelated HTTP 400 deletion failure that should still be propagated?

MahmoudHassanen99 and others added 7 commits August 2, 2026 12:44
…t creation and Ranger 2.8 role deletion compatibility.

Co-authored-by: Salma<sallmayasser512@gmail.com>
Co-authored-by: Amr ElBoridy <amrelboridy7@gmail.com>
Co-authored-by: Salma Yasser <sallmayaser512@gmail.com>
…RangerClientMultiTenantAccessController

Removed commented-out code and unnecessary comments to clean up the RangerClientMultiTenantAccessController class.

Co-authored-by: Amr ElBoridy <amrelboridy7@gmail.com> 
Co-authored-by: Mahmoud Hassanen <mahmoudhassanen99@gmail.com>

@smengcl smengcl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Just two test issues remaining.

sallmayasser and others added 3 commits August 10, 2026 11:16
This class contains unit tests for the RangerClientMultiTenantAccessController using a mock RangerClient. It tests various scenarios including role deletion and policy creation.

Co-authored-by: Amr ElBoridy <amrelboridy7@gmail.com> 
Co-authored-by: Mahmoud Hassanen <mahmoudhassanen99@gmail.com>
Initialize Kerberos name rules in the test setup.

Co-authored-by: Amr ElBoridy <amrelboridy7@gmail.com> 
Co-authored-by: Mahmoud Hassanen <mahmoudhassanen99@gmail.com>

@smengcl smengcl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@smengcl smengcl changed the title HDDS-15982. Fix UnsupportedOperationException and add idempotency to RangerClientMultiTenantAccessController HDDS-15982. Fix UnsupportedOperationException and add idempotent deletion in RangerClientMultiTenantAccessController Aug 11, 2026
@smengcl

smengcl commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@smengcl
smengcl merged commit 09a7d61 into apache:master Aug 11, 2026
44 of 45 checks passed
@smengcl

smengcl commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Thanks @MahmoudHassanen99 for the patch. Thanks @adoroszlai @ayushtkn @sallmayasser for the reviews.

@MahmoudHassanen99

MahmoudHassanen99 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @smengcl for merging, and thanks @adoroszlai @ayushtkn @sallmayasser for the thorough reviews

I will open a follow-up JIRA ticket to track state-aware validation and reconciliation for Ranger roles and policies (handling duplicate creation retries and drift visibility) so we can explore that as a dedicated improvement.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants