Keep the pre-graduation resource sharing setting names working, deprecated - #6513
Merged
DarshitChanpura merged 1 commit intoSep 16, 2026
Conversation
Contributor
PR Reviewer Guide 🔍(Review updated until commit bb835aa)Here are some key observations to aid the review process:
|
Merged
1 task done
…cated Graduating resource sharing out of experimental (opensearch-project#6348) renamed the two feature-flag settings and dropped the old names outright: plugins.security.experimental.resource_sharing.enabled -> plugins.security.resource_sharing.enabled plugins.security.experimental.resource_sharing.protected_types -> plugins.security.resource_sharing.protected_types An existing cluster therefore had to be reconfigured before upgrading. A node whose opensearch.yml still carried an old key would not start, and a persistent cluster setting under an old key was archived on upgrade, silently returning the feature to its default of disabled. Consumers then fall back to their own access control without reporting an error, so shares stop being honored with no signal. This restores the old names as deprecated aliases instead, matching how the plugin already handles the opendistro-to-opensearch rename of ssl_dual_mode_enabled: - Each current setting now declares its pre-graduation setting as a fallback. The fallback resolves at read time against whichever settings instance is supplied, so it covers opensearch.yml, cluster settings and dynamic updates alike. The current name takes precedence when both are set, so a leftover old key cannot override a deliberate new one. - The old settings are registered and marked Property.Deprecated, which is also what lets the upgraders below resolve them. - A setting upgrader per setting rewrites an old key to the current one during cluster-state recovery and on any cluster settings update that still uses it, so an upgraded cluster stops carrying the deprecated key rather than keeping it indefinitely. - Because the deprecation warning core emits does not name a replacement by design, each setting logs an explicit warning naming the current key when the old one is in use. Users keep working through an upgrade, are told the old names are going away, and are pointed at the replacement. Testing: new ResourceSharingSettingMigrationTests covers fallback resolution for both settings, precedence when both keys are set, the upgraders' key mapping, and upgradeSettings rewriting the old keys while leaving current ones untouched. Verified green, then confirmed the fallback tests fail when the fallback wiring is removed. Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
DarshitChanpura
force-pushed
the
feature/resource-sharing-setting-migration
branch
from
September 16, 2026 00:14
7f1ecf3 to
bb835aa
Compare
Contributor
|
Persistent review updated to latest commit bb835aa |
DarshitChanpura
marked this pull request as ready for review
September 16, 2026 00:37
DarshitChanpura
requested review from
Rishav9852Kumar,
RyanL1997,
cwperks,
derek-ho,
finnegancarroll,
nibix,
reta,
shikharj05 and
willyborankin
as code owners
September 16, 2026 00:37
RyanL1997
approved these changes
Sep 16, 2026
DarshitChanpura
merged commit Sep 16, 2026
67210a1
into
opensearch-project:main
109 of 110 checks passed
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6513 +/- ##
==========================================
+ Coverage 75.90% 75.97% +0.06%
==========================================
Files 461 461
Lines 30920 30940 +20
Branches 4668 4668
==========================================
+ Hits 23471 23506 +35
+ Misses 5288 5275 -13
+ Partials 2161 2159 -2
🚀 New features to boost your workflow:
|
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.
Description
Graduating resource sharing out of experimental (#6348) renamed the two feature-flag settings and dropped the old names outright:
plugins.security.experimental.resource_sharing.enabledplugins.security.resource_sharing.enabledplugins.security.experimental.resource_sharing.protected_typesplugins.security.resource_sharing.protected_typesWhy this is needed. As merged, an existing cluster has to be reconfigured before it can upgrade. A node whose
opensearch.ymlstill carries an old key does not start, and a persistent cluster setting stored under an old key is archived during the upgrade, returning the feature to its default of disabled. Consumers then fall back to their own access control rather than reporting an error — for exampleModelAccessControlHelper.shouldUseResourceAuthzreturns false and model group access reverts to backend-role filtering — so existing shares stop being honored with no signal to the operator.Old behavior: the pre-graduation names are unknown settings. Node startup fails on
opensearch.yml; cluster settings are archived and the feature silently reverts to disabled.New behavior: the pre-graduation names are deprecated aliases that still work, and the operator is told to move.
Settingsinstance is supplied, so it coversopensearch.yml, cluster settings, and dynamic updates alike. The current name takes precedence when both are set, so a leftover old key cannot override a deliberate new one.Property.Deprecated. Registration is also what lets the upgraders resolve them, since the upgrade path looks the old setting up before rewriting it.SettingUpgraderper setting rewrites an old key to the current one during cluster-state recovery and on any cluster settings update that still uses it, so an upgraded cluster stops carrying the deprecated key instead of keeping it indefinitely.Setting#checkDeprecation), so each setting logs an explicit warning naming the current key when the old one is in use.This matches how the plugin already handles the opendistro-to-opensearch rename of
ssl_dual_mode_enabledinSecuritySettings, where the legacy setting is kept as a deprecated fallback rather than removed. It is also consistent with core, which keptsearch.concurrent_segment_search.enabledregistered and deprecated when that setting was superseded.RESOURCE_SHARING_AND_ACCESS_CONTROL.mdis updated to describe the deprecation rather than a breaking rename. A companion documentation-website change is at opensearch-project/documentation-website#13072.Issues Resolved
Follow-up to #6348. Related to #4500
Not a backport. No new permissions, so no security dashboards plugin PR is needed.
Testing
New
ResourceSharingSettingMigrationTests(12 tests) covers:opensearch.ymlstarts, with a genuinely unknown key still rejected as the negative controlClusterSettings#upgradeSettingsrewriting both old keys, and leaving settings already on the current names untouchedVerified green (12/12 from the JUnit XML). Negative-controlled twice: removing the fallback wiring fails the fallback tests, and unregistering the legacy settings fails both the node-validation and the upgrade-rewrite tests — confirming registration is what keeps such a node startable.
Note that
./gradlew compileJavaacross all subprojects fails onmainuntouched, with anhttpclient5/httpcore5version conflict inopensearch-sample-resource-pluginagainst the3.9.0-SNAPSHOTREST client. That is unrelated to this change;./gradlew :compileJavais clean.Check 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.