Skip to content

[ISSUE #10876] fix(controller): compare partial broker identities safely - #10886

Open
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0809-yuluo-yx/fix-7
Open

[ISSUE #10876] fix(controller): compare partial broker identities safely#10886
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0809-yuluo-yx/fix-7

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Aug 9, 2026

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

BrokerIdentityInfo.equals now uses Objects.equals for every nullable identity component. This supports the partial identities already created by the Raft controller and aligns equals with the existing null-safe hashCode.

How Did You Test This Change?

  • mise exec java@zulu-8.94.0.17 -- mvn -pl controller -am -DskipITs -Dtest=BrokerIdentityInfoTest -Dsurefire.failIfNoSpecifiedTests=false test (3 tests passed)
  • Checkstyle and SpotBugs passed in the same Maven reactor.
  • git diff --check and the 400-line scope gate passed.
  • Not run: full repository build, container tests, or end-to-end tests.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.28%. Comparing base (fd0c959) to head (f28b69b).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10886      +/-   ##
=============================================
- Coverage      48.39%   48.28%   -0.12%     
+ Complexity     13562    13527      -35     
=============================================
  Files           1380     1380              
  Lines         101165   101166       +1     
  Branches       13127    13128       +1     
=============================================
- Hits           48962    48846     -116     
- Misses         46233    46325      +92     
- Partials        5970     5995      +25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Review of PR #10886: [ISSUE #10876] fix(controller): compare partial broker identities safely

This PR modifies 2 file(s) with 55 additions and 3 deletions.
Changes look reasonable. No critical issues found in the diff.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Replaces direct .equals() calls with Objects.equals() in BrokerIdentityInfo.equals() to handle potential null fields safely. This prevents NPE when clusterName, brokerName, or brokerId are null — a realistic scenario during partial identity construction.

The test covers the partial identity cases. Clean fix, LGTM.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] BrokerIdentityInfo.equals throws for partial identities

3 participants