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

   ### Motivation
   
   NamespaceBundleStatsComparator returns a non-zero value when a bundle key is 
compared with itself. The TreeMap returned by LoadReport.getSortedBundleStats 
therefore cannot reliably resolve existing entries through get or containsKey, 
particularly when multiple bundles have equal load statistics.
   
   ### Modifications
   
   Use the bundle name as a deterministic tie-breaker when load statistics 
compare equal. This preserves every equal-load bundle while restoring the 
comparator contract for identical keys.
   
   Add a focused regression test that verifies identical keys compare as equal 
and both equal-load entries remain addressable in the sorted map.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   
   - env JAVA_HOME=/Applications/IntelliJ\ IDEA.app/Contents/jbr/Contents/Home 
./gradlew :pulsar-common:test --tests 
org.apache.pulsar.common.util.NamespaceBundleStatsComparatorTest 
-PtestRetryCount=0
   - pulsar-common checkstyleMain, checkstyleTest, and spotlessCheck passed
   
   ### Does this pull request potentially affect one of the following parts:
   
   - [ ] 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


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