-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Fix broken topic policy implementation compatibility with old pulsar version #22535
Conversation
…th old pulsar version
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.
LGTM
@rdhabalia There seems to be some mocked test issue:
|
@merlimat @lhotari I have changed one of the test behavior in the last commit. With previous broker version: namespace policy (eg: |
I found many tests which are having above behavior where if namespace-policy value is 0 then it means broker should override 0 value over broker-config and disable all restrictions. Old Release policies So, Users running old Pulsar release must update namespace policy manually with So, with current PR, it will not break current new behavior and will still address the default behavior for policies |
86469dd
to
358bff4
Compare
…th old pulsar version (apache#22535) (cherry picked from commit 59daac6) (cherry picked from commit 8439082)
…th old pulsar version (apache#22535) (cherry picked from commit 59daac6) (cherry picked from commit 8439082)
Fixes #22534
Motivation
Modifications
Again we have a broken version compatibility change in Pulsar which is causing issues for systems which are running old Pulsar versions and upgrading them to >=2.10.
After upgrading from Pulsar-2.7 to >= Pulsar-2.10 broker, broker is not considering various broker configuration threshold and one of them is
maxUnackedMessagesPerSubscription
. We have broker configured withMaxUnackedMessagesPerSubscription=200000
and after sub reaches 200K unack messages, broker blocks the dispatching. It was working fine till broker-2.7 but it stopped working after upgrading to Pulsar-2.10 and higher version.It's happening because Pulsar considers disabling behavior of various threshold values if they are less than 0 and broker disregards those configurations. However, with TopicPolicy implementation, we made a broken change and those values were assumed disabled with only NULL value.
all the namespaces created in earlier version have default disabled value as
-1
in namespace metadata and TopicPolicyImplementaion overrides over broker configuration values because those are NON-NULL value and because of that TopicPolicy implementation broke the compatibility and it stopped enforcing various broker threshold configurations.This PR, makes sure that those old configurations which can be disabled with value < 0, must be normalized with TopicPolicyImplementation and they don't override Broker configuration.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: