Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOTDB-6309] Lager interval for auto ratis leader balance #12116

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

CRZbulabula
Copy link
Contributor

Copy link

sonarcloud bot commented Mar 4, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@liyuheng55555 liyuheng55555 left a comment

Choose a reason for hiding this comment

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

PTAL~ (weakly request changes)

if (IS_ENABLE_AUTO_LEADER_BALANCE_FOR_DATA_REGION
&& (!ConsensusFactory.RATIS_CONSENSUS.equals(DATA_REGION_CONSENSUS_PROTOCOL_CLASS)
|| System.currentTimeMillis() - lastFailedTimeForBalanceRatisDataLeader
> BALANCE_RATIS_LEADER_FAILED_INTERVAL)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Those if check are somewhat annoying... Is it possible to optimize or simplify ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's impossible to simplify those if, since the target of this PR is to distinguish the Ratis and IoT consensus protocol QAQ

if (TConsensusGroupType.DataRegion.equals(regionGroupType)
&& ConsensusFactory.RATIS_CONSENSUS.equals(DATA_REGION_CONSENSUS_PROTOCOL_CLASS)) {
lastFailedTimeForBalanceRatisDataLeader = System.currentTimeMillis();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Here too

@OneSizeFitsQuorum OneSizeFitsQuorum merged commit 46e4767 into master Mar 8, 2024
36 of 37 checks passed
@OneSizeFitsQuorum OneSizeFitsQuorum deleted the ratis-leader-balance-interval branch March 8, 2024 08:32
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.

None yet

3 participants