Skip to content
New issue

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

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

Already on GitHub? # to your account

clarified docs, errors, and warnings #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ type Config struct {
// RTT is defined by NodeHostConfig.RTTMillisecond. The Raft paper suggests it
// to be a magnitude greater than HeartbeatRTT, which is the interval between
// two heartbeats. In Raft, the actual interval between elections is
// randomized to be between ElectionRTT and 2 * ElectionRTT.
// randomized to be between ElectionRTT and 2 * ElectionRTT. The value of ElectionRTT
// must be at least 2 * NodeHostConfig.RTTMillisecond.
//
// As an example, assuming NodeHostConfig.RTTMillisecond is 100 millisecond,
// As an example, assuming the NodeHostConfig.RTTMillisecond is 100 milliseconds,
// to set the election interval to be 1 second, then ElectionRTT should be set
// to 10.
// to 1000.
//
// When CheckQuorum is enabled, ElectionRTT also defines the interval for
// checking leader quorum.
Expand Down Expand Up @@ -208,10 +209,10 @@ func (c *Config) Validate() error {
return errors.New("ElectionRTT must be > 0")
}
if c.ElectionRTT <= 2*c.HeartbeatRTT {
return errors.New("invalid election rtt")
return errors.New("invalid ElectionRTT, value must be at least 2*HeartbeatRTT")
}
if c.ElectionRTT < 10*c.HeartbeatRTT {
plog.Warningf("ElectionRTT is not a magnitude larger than HeartbeatRTT")
plog.Warningf("ElectionRTT is recommended to be at least 10*HeartbeatRTT")
}
if c.MaxInMemLogSize > 0 &&
c.MaxInMemLogSize < settings.EntryNonCmdFieldsSize+1 {
Expand Down