3pacccccc opened a new pull request, #24520: URL: https://github.com/apache/pulsar/pull/24520
### Motivation The method AbstractTopic#incrementTopicEpochIfNeeded contains significant code duplication, especially for handling producers in different modes (```Exclusive```, ```ExclusiveWithFencing```, and ```WaitForExclusive```). This duplication makes the method overly long, harder to read, and more difficult to maintain. The goal of this PR is to improve code readability and maintainability by extracting the duplicated logic into a separate method. ### Modifications Extracted the common logic for handling topic epoch updates and exclusive producer checks into a new method ```handleTopicEpochForExclusiveProducer```. Replaced the duplicated code blocks in the ```Exclusive```, ```ExclusiveWithFencing```, and ```WaitForExclusive``` cases with calls to the new method. ### Verifying this change - [x] Make sure that the change passes the CI checks. <!-- 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 --> - [x] `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: https://github.com/3pacccccc/pulsar/pull/14 -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org