You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "TheR1sing3un (via GitHub)" <gi...@apache.org> on 2023/03/17 05:07:17 UTC
[GitHub] [rocketmq] TheR1sing3un opened a new pull request, #6383: [ISSUE #6382] Periodically check for inactive masters
TheR1sing3un opened a new pull request, #6383:
URL: https://github.com/apache/rocketmq/pull/6383
**Make sure set the target branch to `develop`**
## What is the purpose of the change
<!--
If this PR fixes a GitHub issue, please add `fixes #<XXX>` or `closes #<XXX>`. Please refer to the documentation for more information:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->
fix #6382 <!-- <xxx> replace with issue id -->
## 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] RongtongJin commented on a diff in pull request #6383: [ISSUE #6382] Periodically check for inactive masters
Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin commented on code in PR #6383:
URL: https://github.com/apache/rocketmq/pull/6383#discussion_r1139827440
##########
common/src/main/java/org/apache/rocketmq/common/ControllerConfig.java:
##########
@@ -42,7 +43,7 @@ public class ControllerConfig {
private String controllerDLegerPeers;
private String controllerDLegerSelfId;
private int mappedFileSize = 1024 * 1024 * 1024;
- private String controllerStorePath = System.getProperty("user.home") + File.separator + "DledgerController";
+ private String controllerStorePath = System.getProperty("user.home") + File.separator + "DLedgerController";
Review Comment:
改变store目录可能会有兼容性问题,建议不修改
##########
controller/src/main/java/org/apache/rocketmq/controller/impl/manager/ReplicasInfoManager.java:
##########
@@ -425,6 +425,25 @@ public ControllerResult<Void> cleanBrokerData(final CleanControllerBrokerDataReq
return result;
}
+ public List<String/*BrokerName*/> scanNeedReelectBrokerSets(final BrokerValidPredicate validPredicate) {
+ List<String> needReelectBrokerSets = new LinkedList<>();
+ this.syncStateSetInfoTable.forEach((brokerName, syncStateInfo) -> {
+ Long masterBrokerId = syncStateInfo.getMasterBrokerId();
+ String clusterName = syncStateInfo.getClusterName();
+ // Now master is inactive
+ if (masterBrokerId != null && !validPredicate.check(clusterName, brokerName, masterBrokerId)) {
Review Comment:
masterBrokerId == null的时候应该也要主动触发选举吧
--
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] TheR1sing3un commented on a diff in pull request #6383: [ISSUE #6382] Periodically check for inactive masters
Posted by "TheR1sing3un (via GitHub)" <gi...@apache.org>.
TheR1sing3un commented on code in PR #6383:
URL: https://github.com/apache/rocketmq/pull/6383#discussion_r1139858386
##########
controller/src/main/java/org/apache/rocketmq/controller/impl/manager/ReplicasInfoManager.java:
##########
@@ -425,6 +425,25 @@ public ControllerResult<Void> cleanBrokerData(final CleanControllerBrokerDataReq
return result;
}
+ public List<String/*BrokerName*/> scanNeedReelectBrokerSets(final BrokerValidPredicate validPredicate) {
+ List<String> needReelectBrokerSets = new LinkedList<>();
+ this.syncStateSetInfoTable.forEach((brokerName, syncStateInfo) -> {
+ Long masterBrokerId = syncStateInfo.getMasterBrokerId();
+ String clusterName = syncStateInfo.getClusterName();
+ // Now master is inactive
+ if (masterBrokerId != null && !validPredicate.check(clusterName, brokerName, masterBrokerId)) {
Review Comment:
> masterBrokerId == null的时候应该也要主动触发选举吧
这个场景是不是一般broker侧早就感知到了当前没有master,并且从broker侧主动触发了这个选举
--
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] TheR1sing3un commented on a diff in pull request #6383: [ISSUE #6382] Periodically check for inactive masters
Posted by "TheR1sing3un (via GitHub)" <gi...@apache.org>.
TheR1sing3un commented on code in PR #6383:
URL: https://github.com/apache/rocketmq/pull/6383#discussion_r1139858963
##########
common/src/main/java/org/apache/rocketmq/common/ControllerConfig.java:
##########
@@ -42,7 +43,7 @@ public class ControllerConfig {
private String controllerDLegerPeers;
private String controllerDLegerSelfId;
private int mappedFileSize = 1024 * 1024 * 1024;
- private String controllerStorePath = System.getProperty("user.home") + File.separator + "DledgerController";
+ private String controllerStorePath = System.getProperty("user.home") + File.separator + "DLedgerController";
Review Comment:
> 改变store目录可能会有兼容性问题,建议不修改
OK~
--
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 #6383: [ISSUE #6382] Periodically check for inactive masters
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6383:
URL: https://github.com/apache/rocketmq/pull/6383#issuecomment-1473154410
## [Codecov](https://codecov.io/gh/apache/rocketmq/pull/6383?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 [#6383](https://codecov.io/gh/apache/rocketmq/pull/6383?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (257b907) into [develop](https://codecov.io/gh/apache/rocketmq/commit/4e0a723d225c0fb62bc764ead54f1267f9da2bfc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4e0a723) will **increase** coverage by `0.04%`.
> The diff coverage is `66.66%`.
> :exclamation: Current head 257b907 differs from pull request most recent head a6e805f. Consider uploading reports for the commit a6e805f to get more accurate results
```diff
@@ Coverage Diff @@
## develop #6383 +/- ##
=============================================
+ Coverage 43.04% 43.08% +0.04%
- Complexity 8905 8934 +29
=============================================
Files 1105 1105
Lines 77950 77999 +49
Branches 10144 10151 +7
=============================================
+ Hits 33553 33606 +53
- Misses 40181 40182 +1
+ Partials 4216 4211 -5
```
| [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/6383?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/common/ControllerConfig.java](https://codecov.io/gh/apache/rocketmq/pull/6383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vQ29udHJvbGxlckNvbmZpZy5qYXZh) | `0.00% <0.00%> (ø)` | |
| [.../impl/heartbeat/DefaultBrokerHeartbeatManager.java](https://codecov.io/gh/apache/rocketmq/pull/6383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL2hlYXJ0YmVhdC9EZWZhdWx0QnJva2VySGVhcnRiZWF0TWFuYWdlci5qYXZh) | `82.27% <ø> (ø)` | |
| [...tmq/controller/impl/manager/BrokerReplicaInfo.java](https://codecov.io/gh/apache/rocketmq/pull/6383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL21hbmFnZXIvQnJva2VyUmVwbGljYUluZm8uamF2YQ==) | `61.11% <45.45%> (-9.86%)` | :arrow_down: |
| [.../apache/rocketmq/controller/ControllerManager.java](https://codecov.io/gh/apache/rocketmq/pull/6383?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) | `49.00% <50.00%> (+0.08%)` | :arrow_up: |
| [...he/rocketmq/controller/impl/DLedgerController.java](https://codecov.io/gh/apache/rocketmq/pull/6383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL0RMZWRnZXJDb250cm9sbGVyLmphdmE=) | `71.68% <79.31%> (+5.54%)` | :arrow_up: |
| [...q/controller/impl/manager/ReplicasInfoManager.java](https://codecov.io/gh/apache/rocketmq/pull/6383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL21hbmFnZXIvUmVwbGljYXNJbmZvTWFuYWdlci5qYXZh) | `65.83% <88.88%> (+0.78%)` | :arrow_up: |
| [...ocketmq/controller/impl/manager/SyncStateInfo.java](https://codecov.io/gh/apache/rocketmq/pull/6383?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL21hbmFnZXIvU3luY1N0YXRlSW5mby5qYXZh) | `86.95% <100.00%> (+27.58%)` | :arrow_up: |
... and [20 files with indirect coverage changes](https://codecov.io/gh/apache/rocketmq/pull/6383/indirect-changes?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] RongtongJin merged pull request #6383: [ISSUE #6382] Periodically check for inactive masters
Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin merged PR #6383:
URL: https://github.com/apache/rocketmq/pull/6383
--
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