-
Notifications
You must be signed in to change notification settings - Fork 304
Fixed IllegalArgumentException when building stateful index privileges #5217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed IllegalArgumentException when building stateful index privileges #5217
Conversation
…s that occurred when a data stream backing index was member of an alias Signed-off-by: Nils Bandener <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5217 +/- ##
=======================================
Coverage 71.65% 71.66%
=======================================
Files 337 337
Lines 22789 22793 +4
Branches 3606 3607 +1
=======================================
+ Hits 16330 16334 +4
- Misses 4652 4656 +4
+ Partials 1807 1803 -4
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick work on this @nibix and confirming that the fallback is working as intended.
#5217) Signed-off-by: Nils Bandener <[email protected]> (cherry picked from commit 4e1158c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.19 2.19
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.19
# Create a new branch
git switch --create backport/backport-5217-to-2.19
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4e1158c225a4a5426269bf6a32bdb055ab1152b1
# Push it to GitHub
git push --set-upstream origin backport/backport-5217-to-2.19
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.19 Then, create a pull request where the |
opensearch-project#5217) Signed-off-by: Nils Bandener <[email protected]> (cherry picked from commit 4e1158c)
Description
This fixes the issue reported in #5216. In the case that a cluster has aliases defined on backing indices of data streams, the creation of the stateful rule would fail with an
IllegalArgumentException
.This is because data stream backing indices are not supposed to be included in the stateful index privilege object. Via the aliases, however, they sneaked in anyway. We are now filtering these indices out.
This is mostly just a cosmetic problem as privilege evaluation will continue via slower fall back code paths. However, the logs will show an
IllegalArgumentException
stack trace for each update of the index meta data on the cluster.Issues Resolved
Fixes #5216
Testing
aliasesOnDataStreamBackingIndices
was added to cover this caseCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.