-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
结合 NWR 实现 Flexible raft #1005
结合 NWR 实现 Flexible raft #1005
Conversation
辛苦啦,rfc可以单独提交pr |
rfcs/0002-Flexible-Raft-with-NWR.md
Outdated
``` | ||
private boolean checkAndResetFactor(Double writeFactor, Double readFactor){ | ||
if (Objects.nonNull(readFactor) && Objects.nonNull(writeFactor)) { | ||
if (readFactor + writeFactor != 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't compare integer type(1
) with float type(readFactor + writeFactor
) precisely. I think we can change the readFactor
and writeFactor
to be int types, and ensure that their sum is 10
. Their range both are (0,10)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that if the user sets readFactor to 4 and writeFactor to 6. If in a cluster with 5 nodes, writeQuorum as 5 * 0.6=3 and readQuorum as n-w+1=5-3+1=3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's my point @1294566108
# Conflicts: # jraft-core/src/main/java/com/alipay/sofa/jraft/Quorum.java # jraft-core/src/main/java/com/alipay/sofa/jraft/core/BallotBox.java # jraft-core/src/main/java/com/alipay/sofa/jraft/core/NodeImpl.java # jraft-core/src/main/java/com/alipay/sofa/jraft/entity/MajorityQuorum.java # jraft-core/src/main/java/com/alipay/sofa/jraft/entity/NWRQuorum.java # jraft-core/src/main/java/com/alipay/sofa/jraft/entity/QuorumConfiguration.java # jraft-core/src/main/java/com/alipay/sofa/jraft/entity/QuorumFactory.java # jraft-core/src/main/java/com/alipay/sofa/jraft/option/NodeOptions.java # jraft-core/src/test/java/com/alipay/sofa/jraft/entity/NWRQuorumTest.java
Motivation:
ospp开源之夏-2023-结合 NWR 实现 Flexible raft,用于自定义 Quorum 的大小
Modification:
新增QuorumNWQ设计文档至rfcs
Result:
Fixes #<1003>.