-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add validator for leader lease to be larger than heartbeat interval #25747
base: master
Are you sure you want to change the base?
Conversation
DEFINE_validator(leader_lease_duration_ms, | ||
FLAG_DELAYED_COND_VALIDATOR( | ||
FLAGS_raft_heartbeat_interval_ms <= _value, | ||
"Must be greater than raft_heartbeat_interval_ms")); |
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.
"Must be greater than raft_heartbeat_interval_ms")); | |
yb::Format("Must be greater than or equal to raft_heartbeat_interval_ms: $0", FLAGS_raft_heartbeat_interval_ms))); |
DEFINE_validator(raft_heartbeat_interval_ms, | ||
FLAG_DELAYED_COND_VALIDATOR( | ||
_value <= FLAGS_leader_lease_duration_ms, | ||
"Must be less than leader_lease_duration_ms")); |
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.
"Must be less than leader_lease_duration_ms")); | |
yb::Format("Must be less than or equal to leader_lease_duration_ms: $0", FLAGS_leader_lease_duration_ms))); |
Can you please try these cases and paste the output in the comment description as a test:
|
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.
Please change
DEFINE_UNKNOWN_int32(leader_lease_duration_ms
to
DEFINE_NON_RUNTIME_int32(leader_lease_duration_ms
This PR fixes #1348
It brings in delayed validators to make sure
raft_heartbeat_interval_ms
is less thanleader_lease_duration_ms