Felix-Gong opened a new pull request, #11482:
URL: https://github.com/apache/rocketmq/pull/11482
Fixes #11481
`cleanItemListMoreThanSecondGen()` reads the new leader's mapping with
`hostedQueues.get(qId)` and calls `isEmpty()` without a null check. When the
remote mapping has no entry for that queue id — the transient state this
service is there to reconcile — the read returns `null` and the pass dies with
a `NullPointerException`, which the per-topic `catch (Throwable)` swallows. The
result is silent and sticky: the rest of that topic's queues are skipped for
this cycle, the mapping stays half-cleaned, and the error repeats every five
minutes.
The change is one guard — a missing remote queue is treated like every other
"not confirmed yet" case around it:
```java
if (items == null || items.isEmpty()) {
continue;
}
```
Red/green: `remoteLeaderMissingTheQueueIdDoesNotAbortTheRestOfTheTopic`
builds a topic with two moved queues; the new leader's mapping confirms queue 1
but has no entry for queue 0. On the old code the NPE aborts the pass and queue
1 is never removed (test fails); with the guard queue 1 is removed and queue 0
is left alone (test passes). The existing five tests in the class stay green.
Broker module: 815 tests, the 7 failures (RocksDB transfer, store filter,
schedule, pop-lite, BrokerOuterAPI) are pre-existing — stashing this change
reproduces the exact same set, and all live in unrelated areas.
No coordination needed: no open PR touches this file; the only related
closed item is #8728 (test coverage enhancement, already resolved).
--
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]