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

Remove count restriction in leader topology #299

Merged

Conversation

indradhanush
Copy link
Contributor

@indradhanush indradhanush commented Jun 13, 2018

While atleast three instances are required for a functioning cluster
in the leader topology, we should not prevent users from making
deployments with initial count set to one. This change allows users to
incrementally add instances if that fits their requirements better
instead of forcing them to add atleast three right from the onset.

Signed-off-by: Indradhanush Gupta indra@kinvolk.io


Note: Whenever creating a `leader` topology specify instance `count` of 3 or more and would be best if the number is odd, this is so the election can take place.
Note: To have a functioning cluster, you must set the `count` to atleast 3, when creating a `leader` topology. It would be best to if the number is odd, as this prevents a split quorum during the leader election.
Copy link
Contributor

Choose a reason for hiding this comment

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

How about:

Note: To have functioning services in the `leader` topology, you must set the `count` field to at least 3. It is recommended that the number is odd as this prevents a split quorum during the leader election.

@@ -10,8 +10,10 @@ spec:
v1beta2:
# the core/redis habitat service packaged as a Docker image
image: habitat/redis-hab
# count must be at least 3 for a leader-follower topology
count: 3
# While it is possible to deploy only one pod in the
Copy link
Contributor

Choose a reason for hiding this comment

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

While it is possible to deploy only one pod with a service instance in the

# count must be at least 3 for a leader-follower topology
count: 3
# While it is possible to deploy only one pod in the
# leader-follower topology, at least at least 3 instances are
Copy link
Contributor

Choose a reason for hiding this comment

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

At least one at least too many. ;)

count: 3
# While it is possible to deploy only one pod in the
# leader-follower topology, at least at least 3 instances are
# required for a functioning cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

required for services to be started by the supervisor.

switch spec.Service.Topology {
case habv1beta1.TopologyStandalone:
case habv1beta1.TopologyLeader:
if spec.Count < leaderFollowerTopologyMinCount {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just drop this if instead of rewriting the switch to if. What do you think?

@indradhanush indradhanush force-pushed the indradhanush/remove-count-restriction-in-leader-topology branch 2 times, most recently from 4667f91 to aead737 Compare July 12, 2018 09:11
@@ -54,9 +54,6 @@ func validateCustomObject(h habv1beta1.Habitat) error {
switch spec.Service.Topology {
case habv1beta1.TopologyStandalone:
case habv1beta1.TopologyLeader:
if spec.Count < leaderFollowerTopologyMinCount {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the leaderFollowerTopologyMinCount used anywhere after dropping this line? If no, then maybe drop the constant too.

@@ -54,9 +54,6 @@ func validateCustomObject(h habv1beta1.Habitat) error {
switch spec.Service.Topology {
case habv1beta1.TopologyStandalone:
case habv1beta1.TopologyLeader:
if spec.Count < leaderFollowerTopologyMinCount {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here about leaderFollowerTopologyMinCount.

While atleast three instances are required for a functioning cluster
in the leader topology, we should not prevent users from making
deployments with initial count set to one. This change allows users to
incrementally add instances if that fits their requirements better
instead of forcing them to add atleast three right from the onset.

Signed-off-by: Indradhanush Gupta <indra@kinvolk.io>
@indradhanush indradhanush force-pushed the indradhanush/remove-count-restriction-in-leader-topology branch from aead737 to 1640cbd Compare July 12, 2018 10:24
@krnowak
Copy link
Contributor

krnowak commented Jul 12, 2018

LFAD.

@indradhanush indradhanush merged commit 1640cbd into master Jul 12, 2018
@indradhanush
Copy link
Contributor Author

Merged on the command line.

@indradhanush indradhanush deleted the indradhanush/remove-count-restriction-in-leader-topology branch July 12, 2018 10:48
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