Skip to content

[Summer of code] Let controller inform broker that role changed. - #4424

Merged
RongtongJin merged 4 commits into
apache:5.0.0-beta-dledger-controllerfrom
hzh0425:feature/add-api-changeBrokerRole
Jun 7, 2022
Merged

RongtongJin merged 4 commits into
apache:5.0.0-beta-dledger-controllerfrom
hzh0425:feature/add-api-changeBrokerRole

Conversation

@hzh0425

@hzh0425 hzh0425 commented Jun 7, 2022

Copy link
Copy Markdown
Member

Make sure set the target branch to develop

What is the purpose of the change

tracking issue: #4330

Brief changelog

Let controller inform broker that role changed.

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@hzh0425

hzh0425 commented Jun 7, 2022

Copy link
Copy Markdown
Member Author

@RongtongJin PTLA

@codecov-commenter

codecov-commenter commented Jun 7, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #4424 (e227c1f) into 5.0.0-beta-dledger-controller (e7bf51f) will increase coverage by 0.00%.
The diff coverage is 26.31%.

@@                        Coverage Diff                        @@
##             5.0.0-beta-dledger-controller    #4424    +/-   ##
=================================================================
  Coverage                            43.28%   43.28%            
- Complexity                            6346     6360    +14     
=================================================================
  Files                                  840      841     +1     
  Lines                                59707    59831   +124     
  Branches                              8138     8150    +12     
=================================================================
+ Hits                                 25843    25899    +56     
- Misses                               30514    30575    +61     
- Partials                              3350     3357     +7     
Impacted Files Coverage Δ
.../rocketmq/broker/hacontroller/ReplicasManager.java 0.00% <0.00%> (ø)
...ocketmq/broker/processor/AdminBrokerProcessor.java 25.46% <0.00%> (-0.19%) ⬇️
...g/apache/rocketmq/common/protocol/RequestCode.java 0.00% <ø> (ø)
...l/header/NotifyBrokerRoleChangedRequestHeader.java 0.00% <0.00%> (ø)
.../namesrv/controller/ElectMasterResponseHeader.java 0.00% <0.00%> (ø)
...e/rocketmq/namesrv/routeinfo/RouteInfoManager.java 63.91% <0.00%> (-3.01%) ⬇️
.../apache/rocketmq/controller/ControllerManager.java 78.82% <76.00%> (-1.18%) ⬇️
...q/controller/impl/manager/ReplicasInfoManager.java 64.51% <83.33%> (+1.10%) ⬆️
...e/rocketmq/controller/impl/manager/BrokerInfo.java 82.35% <100.00%> (+1.10%) ⬆️
...apache/rocketmq/broker/longpolling/PopRequest.java 31.03% <0.00%> (-13.80%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7bf51f...e227c1f. Read the comment docs.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.05%) to 47.462% when pulling e227c1f on hzh0425:feature/add-api-changeBrokerRole into fa8ce65 on apache:5.0.0-beta-dledger-controller.

@RongtongJin
RongtongJin merged commit 98a283f into apache:5.0.0-beta-dledger-controller Jun 7, 2022
@hzh0425

hzh0425 commented Jun 14, 2022

Copy link
Copy Markdown
Member Author

问题场景: RoleChange (Controller 选出新的 Leader) 时, Broker 是通过定时任务来 Sync controller 得元数据, 也即会有一个时间间隔. 我们希望减少这个时间间隔, 所以当选出新的 Leader 后, 让 Controller 立即通知相应得 Broker.

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.

4 participants