You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/16 03:45:44 UTC
[GitHub] [rocketmq] RongtongJin opened a new pull request, #5711: [ISSUE #XXX] Fix the invalid of heartbeat detection after controller switch
RongtongJin opened a new pull request, #5711:
URL: https://github.com/apache/rocketmq/pull/5711
**Make sure set the target branch to `develop`**
## What is the purpose of the change
Fix the invalid of heartbeat detection after controller switch
## Brief changelog
XX
## 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`.
- [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) 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.
- [x] 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.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] 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](https://github.com/apache/rocketmq/tree/master/test).
- [x] 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](http://www.apache.org/licenses/#clas).
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] codecov-commenter commented on pull request #5711: [ISSUE #5712] Fix the invalid of heartbeat detection after controller switch
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #5711:
URL: https://github.com/apache/rocketmq/pull/5711#issuecomment-1354172985
# [Codecov](https://codecov.io/gh/apache/rocketmq/pull/5711?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#5711](https://codecov.io/gh/apache/rocketmq/pull/5711?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (72da994) into [develop](https://codecov.io/gh/apache/rocketmq/commit/aa7a442505ac012d1bc61b89bf10c41646a15005?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aa7a442) will **increase** coverage by `0.21%`.
> The diff coverage is `44.18%`.
```diff
@@ Coverage Diff @@
## develop #5711 +/- ##
=============================================
+ Coverage 42.35% 42.56% +0.21%
- Complexity 8192 8226 +34
=============================================
Files 1060 1060
Lines 73108 73125 +17
Branches 9586 9578 -8
=============================================
+ Hits 30962 31124 +162
+ Misses 38234 38097 -137
+ Partials 3912 3904 -8
```
| [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/5711?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...a/org/apache/rocketmq/broker/BrokerController.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvQnJva2VyQ29udHJvbGxlci5qYXZh) | `46.71% <0.00%> (+3.34%)` | :arrow_up: |
| [...oller/RegisterBrokerToControllerRequestHeader.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL3Byb3RvY29sL2hlYWRlci9jb250cm9sbGVyL1JlZ2lzdGVyQnJva2VyVG9Db250cm9sbGVyUmVxdWVzdEhlYWRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...l/header/namesrv/BrokerHeartbeatRequestHeader.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL3Byb3RvY29sL2hlYWRlci9uYW1lc3J2L0Jyb2tlckhlYXJ0YmVhdFJlcXVlc3RIZWFkZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...org/apache/rocketmq/broker/out/BrokerOuterAPI.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvb3V0L0Jyb2tlck91dGVyQVBJLmphdmE=) | `17.36% <18.75%> (-0.07%)` | :arrow_down: |
| [.../java/org/apache/rocketmq/common/BrokerConfig.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vQnJva2VyQ29uZmlnLmphdmE=) | `27.94% <25.00%> (-0.02%)` | :arrow_down: |
| [.../apache/rocketmq/controller/ControllerManager.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9Db250cm9sbGVyTWFuYWdlci5qYXZh) | `71.87% <59.09%> (-1.25%)` | :arrow_down: |
| [...org/apache/rocketmq/controller/BrokerLiveInfo.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9Ccm9rZXJMaXZlSW5mby5qYXZh) | `58.33% <75.00%> (+6.15%)` | :arrow_up: |
| [...controller/impl/DefaultBrokerHeartbeatManager.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL0RlZmF1bHRCcm9rZXJIZWFydGJlYXRNYW5hZ2VyLmphdmE=) | `82.27% <75.00%> (+4.37%)` | :arrow_up: |
| [...he/rocketmq/broker/controller/ReplicasManager.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvY29udHJvbGxlci9SZXBsaWNhc01hbmFnZXIuamF2YQ==) | `43.09% <100.00%> (ø)` | |
| [...ntroller/processor/ControllerRequestProcessor.java](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9wcm9jZXNzb3IvQ29udHJvbGxlclJlcXVlc3RQcm9jZXNzb3IuamF2YQ==) | `25.26% <100.00%> (+0.52%)` | :arrow_up: |
| ... and [33 more](https://codecov.io/gh/apache/rocketmq/pull/5711/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] odbozhou merged pull request #5711: [ISSUE #5712] Fix the invalid of heartbeat detection after controller switch
Posted by GitBox <gi...@apache.org>.
odbozhou merged PR #5711:
URL: https://github.com/apache/rocketmq/pull/5711
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] mxsm commented on a diff in pull request #5711: [ISSUE #5712] Fix the invalid of heartbeat detection after controller switch
Posted by GitBox <gi...@apache.org>.
mxsm commented on code in PR #5711:
URL: https://github.com/apache/rocketmq/pull/5711#discussion_r1050401862
##########
controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/manager/ReplicasInfoManagerTest.java:
##########
@@ -150,39 +150,39 @@ public void mockMetaData() {
}
public void mockHeartbeatDataMasterStillAlive() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, 10000000000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 1, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,10000000000L, null,
+ 1, 1L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 1, 3L,-1L, 0);
}
public void mockHeartbeatDataHigherEpoch() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, -10000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 0, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,-10000L, null,
+ 1, 3L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 0, 3L,-1L, 0);
Review Comment:
code style needs format
##########
controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/manager/ReplicasInfoManagerTest.java:
##########
@@ -150,39 +150,39 @@ public void mockMetaData() {
}
public void mockHeartbeatDataMasterStillAlive() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, 10000000000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 1, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,10000000000L, null,
+ 1, 1L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 1, 3L,-1L, 0);
}
public void mockHeartbeatDataHigherEpoch() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, -10000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 0, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,-10000L, null,
+ 1, 3L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 0, 3L,-1L, 0);
}
public void mockHeartbeatDataHigherOffset() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, -10000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 1, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,-10000L, null,
+ 1, 3L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 1, 3L,-1L, 0);
Review Comment:
code style needs format
##########
controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/manager/ReplicasInfoManagerTest.java:
##########
@@ -150,39 +150,39 @@ public void mockMetaData() {
}
public void mockHeartbeatDataMasterStillAlive() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, 10000000000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 1, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,10000000000L, null,
+ 1, 1L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 1, 3L,-1L, 0);
Review Comment:
code style needs format
##########
controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/manager/ReplicasInfoManagerTest.java:
##########
@@ -150,39 +150,39 @@ public void mockMetaData() {
}
public void mockHeartbeatDataMasterStillAlive() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, 10000000000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 1, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,10000000000L, null,
+ 1, 1L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 1, 3L,-1L, 0);
}
public void mockHeartbeatDataHigherEpoch() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, -10000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 0, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,-10000L, null,
+ 1, 3L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 0, 3L,-1L, 0);
}
public void mockHeartbeatDataHigherOffset() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, -10000L, null,
- 1, 3L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 2L, 0);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 1, 3L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,-10000L, null,
+ 1, 3L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 2L,-1L, 0);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 1, 3L,-1L, 0);
}
public void mockHeartbeatDataHigherPriority() {
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9000", 1L, -10000L, null,
- 1, 3L, 3);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9001", 1L, 10000000000L, null,
- 1, 3L, 2);
- this.heartbeatManager.registerBroker("cluster1", "broker1", "127.0.0.1:9002", 1L, 10000000000L, null,
- 1, 3L, 1);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9000", 1L,-10000L, null,
+ 1, 3L,-1L, 3);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9001", 1L,10000000000L, null,
+ 1, 3L,-1L, 2);
+ this.heartbeatManager.onBrokerHeartbeat("cluster1", "broker1", "127.0.0.1:9002", 1L,10000000000L, null,
+ 1, 3L,-1L, 1);
Review Comment:
code style needs format
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org