[ISSUE #10876] Fix BrokerIdentityInfo.equals for partial identities - #10921
[ISSUE #10876] Fix BrokerIdentityInfo.equals for partial identities#10921btlqql wants to merge 8 commits into
Conversation
…t its bound topic
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
This PR fixes BrokerIdentityInfo.equals() to use Objects.equals() instead of direct .equals() calls, preventing NullPointerException when any identity field is null. This is important for partial identity comparisons where not all fields may be populated.
LGTM. Correct null-safety fix.
Note: This PR also includes changes from #10914-#10920. See the series overlap comment on those PRs.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review Summary
This PR fixes BrokerIdentityInfo.equals to handle partial identity comparisons correctly by using Objects.equals instead of direct .equals() calls.
Findings
- [Critical] BrokerIdentityInfo.java — Direct
.equals()calls on potentially null fields would throw NPE. UsingObjects.equalssafely handles null values. - [Info] This is important for broker identity comparison in cluster management, where some identity fields may not be set.
Overall
Good fix for NPE prevention in identity comparison logic.
Automated review by RockteMQ-AI
|
This PR has conflicts with the base branch and cannot be merged. Please rebase or merge the base branch into your branch and resolve the conflicts: git fetch origin
git checkout btlqql/fix-broker-identity-equals
git rebase origin/develop
# resolve conflicts, then:
git push --force-with-leaseThis is a one-time reminder. Feel free to @mention me for a re-review after conflicts are resolved. Automated notification by github-manager-bot |
|
Duplicate of #10886 which already fixes BrokerIdentityInfo.equals; closing this in favor of the upstream fix. |
What is the purpose of the change
Fix #10876.
BrokerIdentityInfo supports partial identities: RaftReplicasInfoManager creates instances with null clusterName and brokerId. equals() called equals directly on every field, so comparing two valid partial identities threw NullPointerException.
Brief changelog
How was this patch verified
git diff --checkclean