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

cleanup quorum configuration #1833

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

robfrank
Copy link
Collaborator

What does this PR do?

just a cleanup and small refactoring of HA quorum configuration

Motivation

Improve readability

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.07% 53.85%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (421e4f5) 68100 43611 64.04%
Head commit (1c64ec0) 68092 (-8) 43652 (+41) 64.11% (+0.07%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1833) 13 7 53.85%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

case THREE -> 3;
case MAJORITY -> numberOfServers / 2 + 1;
case ALL -> numberOfServers;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have the default here that throws an exception like with the original code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, this is the "trick" of using the Enum itself. You can only call the method if you are using one of the Enuma: QUORUM. ONE/TWO/THREE/MAJORITY/ALL.

The parsing of the value from the conf is in ReplicatedDatabase line 100.

No more need for exception

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.

2 participants