rdhabalia opened a new pull request, #22535:
URL: https://github.com/apache/pulsar/pull/22535

   Fixes https://github.com/apache/pulsar/issues/22534
   
   ### Motivation
   
   <!-- Explain here the context, and why you're making that change. What is 
the problem you're trying to solve. -->
   
   ### 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 with 
`MaxUnackedMessagesPerSubscription=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.
   
   ```
   subscriptions" : {
       "UnackMsgConsumersSubscription" : {
         "msgRateOut" : 41.66667806597534,
         "msgThroughputOut" : 63924.01748854578,
         "bytesOutCounter" : 9813637567183,
         "msgOutCounter" : 6346168888,
         "msgRateRedeliver" : 1825.0005374626583,
         "chuckedMessageRate" : 0,
         "msgBacklog" : 63122123,
         "backlogSize" : 0,
         "msgBacklogNoDelayed" : 63122123,
         "blockedSubscriptionOnUnackedMsgs" : false,
         "msgDelayed" : 0,
         "unackedMessages" : 614260,
         "type" : "Shared",
         "msgRateExpired" : 0.0,
         "totalMsgExpired" : 0,
         "lastExpireTimestamp" : 0,
         "lastConsumedFlowTimestamp" : 1712610077925,
         "lastConsumedTimestamp" : 1712610077938,
         "lastAckedTimestamp" : 1712610088862,
         "lastMarkDeleteAdvancedTimestamp" : 1712609791878,
         "consumers" : [ {
           "msgRateOut" : 41.66667806597534,
           "msgThroughputOut" : 63924.01748854578,
           "bytesOutCounter" : 5106838658,
           "msgOutCounter" : 3324500,
           "msgRateRedeliver" : 1825.0005374626583,
           "chuckedMessageRate" : 0.0,
           "consumerName" : "0f455",
           "availablePermits" : 0,
           "unackedMessages" : 614260,
           "avgMessagesPerEntry" : 1,
           "blockedConsumerOnUnackedMsgs" : false,
           "lastAckedTimestamp" : 1712610088862,
           "lastConsumedTimestamp" : 1712610077938,
           "metadata" : { },
           "connectedSince" : "2024-04-08T20:52:27.525995Z",
   ```
   
   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
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(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:)*
     - *Added integration tests for end-to-end deployment with large payloads 
(10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions 
will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since 
the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed 
in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments 
have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to