beautyarbutin opened a new pull request, #11201: URL: https://github.com/apache/rocketmq/pull/11201
### Which Issue(s) This PR Fixes - Fixes #10851 ### Brief Description `ColdDataCgCtrService.sortAndDecelerate()` previously sorted configured thresholds by subtracting two `long` values and narrowing the result to `int`. When the difference exceeded the integer range, the comparator could move the largest threshold behind smaller entries. Because each cycle decelerates only three groups, the highest-threshold group could be skipped entirely. This change uses `Long.compare` while preserving the existing descending order and three-group limit. The regression test exercises the actual deceleration selection with four adaptive thresholds and verifies that `Long.MAX_VALUE` is selected while the lowest threshold is excluded. This reimplements the fix from the earlier, closed PR #10856 against the current `develop` branch. Thanks to @yuluo-yx for the original report and patch. ### How Did You Test This Change? - Red-first regression: before the fix, the service decelerated thresholds `2`, `1`, and `0`, but skipped the `Long.MAX_VALUE` group. - `mvn -B -ntp -pl broker -DskipITs -Dtest=ColdDataCgCtrServiceTest test` - Result: 2 tests passed, with no failures, errors, or skips. - Checkstyle: 0 violations. - SpotBugs: 0 bugs and 0 errors. -- 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]
