[fix][admin] PIP-369 Change default value of unload-scope in ns-isolation-policy set (branch-3.0)#25722
Open
Shawyeok wants to merge 1 commit intoapache:branch-3.0from
Open
Conversation
…s-isolation-policy set` (apache#23253) Co-authored-by: Zixuan Liu <nodeces@gmail.com>
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.
Backport of #23253 to
branch-3.0.Master Issue: #23253
PIP: #23104
Motivation
set-ns-isolation-policyintroduced the--unload-scopeflag via PIP-369 (cherry-picked intobranch-3.0asd7af82eb6d9). The original implementation defaulted to unloading all matching namespaces when--unload-scopeis not specified (unloadScope == null), which is overly aggressive and can cause mass unloads across a cluster.The upstream fix (#23253, commit
4f002590450) changed the default so that an unspecified--unload-scopebehaves likechanged— only namespaces whose actual broker placement changes are unloaded. This fix was never backported tobranch-3.0, leaving 3.0.x clusters vulnerable to accidental mass unloads.In production, this was observed to trigger NamingException reconnect storms and producer/consumer disruptions across all namespaces matching the policy regex when an operator ran
ns-isolation-policy setwithout explicitly passing--unload-scope.Modifications
Cherry-pick of commit
4f002590450frommasterontobranch-3.0, with a minor conflict resolution inCmdNamespaceIsolationPolicy.javato preserve the@Parameterannotation (branch-3.0 uses Picocli) while adopting the updated description text from the cherry-pick:ClustersBase.java:filterAndUnloadMatchedNamespaceAsyncnow treatsnullunloadScopethe same aschangedinstead of falling through to the "unload all matching" branch.CmdNamespaceIsolationPolicy.java: Updated--unload-scopehelp text to reflect the new safe default.NamespaceIsolationDataImpl.java: Corresponding default value change.AdminApi2Test.java: Extended test coverage for the new default behavior.Verifying this change
This change is already covered by existing tests, such as
AdminApi2Test(extended by this commit to cover thechanged-default behavior).Does this pull request potentially affect one of the following parts:
Changed default: When
--unload-scopeis omitted, behavior changes from "unload all matching namespaces" to "unload only namespaces whose placement actually changes" — a significantly safer default.