Jason918 opened a new pull request #12830:
URL: https://github.com/apache/pulsar/pull/12830


   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the 
pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull 
request.
       Skip *component* if you are unsure about which is the best component. 
E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the 
pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from 
multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and 
this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ### Motivation
   
   Currently, , we update the value of `Topic#topicMaxMessageSize` in an 
interval of  `maxMessageSizeCheckIntervalInSeconds` (default as 60s). 
   So if we update this value, we will have a delay, max to 60s by default, 
before it take effects.
   We can reduce the latency by updating the value with notification.
   
   Further, we can avoid the blank updates in `isExceedMaximumMessageSize`.
   
   ### Modifications
   
   1. Move `topicMaxMessageSize` to HierarchyTopicPolicies , and update by 
`onUpdate` listener, like other topic policies.
   2. Deprecates `maxMessageSizeCheckIntervalInSeconds`, since it has no use 
any more.
   3. Remove `lastTopicMaxMessageSizeCheckTimeStamp` and 
`topicMaxMessageSizeCheckIntervalMs`, no use any more.
   4. Move method `registerTopicPolicyListener` up to AbstractTopic level, 
since `topicMaxMessageSize` also effect non-persist topics.
   
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - 
org.apache.pulsar.broker.admin.TopicPoliciesTest#testTopicMaxMessageSize, and 
added test case for non-persisitent topics.
     - Add 
org.apache.pulsar.broker.admin.TopicPoliciesTest#testTopicPolicyInitValue to 
cover  the case that topic loading old settings.
   
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
     
   - [x] `doc` 
   
   Doc updated in comments.
   And checked with old configuration doc, no 
`maxMessageSizeCheckIntervalInSeconds` found, and no need to add since it is 
deprecated.
   
   
   


-- 
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