-
Notifications
You must be signed in to change notification settings - Fork 388
Set default for bootstrapExpect to replicas #721
Conversation
[ "${actual}" = "true" ] | ||
} | ||
|
||
@test "server/StatefulSet: errors if bootstrapExpect < replicas" { |
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.
Is this change backwards compatible? Previously, we would allow bootstrap expect
to be <= replicas
but this change would cause such a setting to change.
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.
Ooh, you're right! Will add to changelog. I could also remove this but I think this is an invalid configuration.
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.
Interesting. I mean, your comment about bootstrapExpect made me realize that my understanding of it was incorrect. I thought it was the min number of servers that needed to be up and running for consensus, which seemed odd but 🤷 . This makes more sense.
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.
To prevent inconsistencies and split-brain (clusters where multiple servers consider themselves leader) situations, you should either specify the same value for -bootstrap-expect or specify no value at all on all the servers.
8958ef4
to
f0d579e
Compare
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.
Excellent change.
In almost all cases, users want to set bootstrapExpect to the number of server replicas. This change defaults it to null in values.yaml and then in the template if it's left as null, then we set the -bootstrap-expect flag to the number of server replicas. This is backwards compatible, if users have been setting this it will continue to be set. Also error out if bootstrapExpect is less than the number of replicas because this is definitely a misconfiguration as the servers won't wait until the proper number have started before electing a leader.
f0d579e
to
7018536
Compare
In almost all cases, users want to set bootstrapExpect to the number of
server replicas. This change defaults it to null in values.yaml and then
in the template if it's left as null, then we set the -bootstrap-expect
flag to the number of server replicas.
This is backwards compatible, if users have been setting this it will
continue to be set.
Also error out if bootstrapExpect is less than the number of replicas
because this is definitely a misconfiguration as the servers won't wait
until the proper number have started before electing a leader.
Before:
After:
Closes #573