-
Notifications
You must be signed in to change notification settings - Fork 198
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 support for pipelines controller statefulset ordinals #2361
Conversation
cb48950
to
ca0d5eb
Compare
a9a023a
to
f704975
Compare
The following is the coverage report on the affected files.
|
f704975
to
28b6ca2
Compare
if p.Performance.StatefulsetOrdinals == nil { | ||
p.Performance.StatefulsetOrdinals = ptr.Bool(false) | ||
} else if *p.Performance.StatefulsetOrdinals { | ||
if p.Performance.Replicas != nil && *p.Performance.Replicas > 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.
If p.Performance.Replicas != nil
then we might have to set the buckets to 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.
in statefulset mode, bucket should be equal to replicas, not to 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.
@jkhelil I guess @PuneetPunamiya try to say bucket should be 1
, when p.Performance.Replicas == nil
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.
yeah sorry for the confusion
+1 on what @jkandasa said
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.
When replicas is not specified (it's nil), the default behavior of a StatefulSet is to create a single pod, in StatefulSet's Knative mode, the default behavior is to create one bucket, so there is no need to enforce that mode, it works by default.
However, when replicas is explicitly set (not nil), I found that if we don’t enforce the bucket assignment to equal to replicas, the election mode and StatefulSet mode can interfere with each other. This results in some pods being in election mode while others are in StatefulSet mode, leading to inconsistent behavior.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jkandasa The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
6e12802
to
41c04dc
Compare
The following is the coverage report on the affected files.
|
41c04dc
to
6875fc5
Compare
The following is the coverage report on the affected files.
|
6875fc5
to
6c9ca21
Compare
The following is the coverage report on the affected files.
|
@PuneetPunamiya PTAL |
Thanks @jkhelil 🤙🏻 |
Changes
To handle HA on pipelines controller, there are two mechanisms available for scaling controllers horizontally via knative/pkg:
- Using leader election, which allows for failover, but can result in hot-spotting.(this is the default pipelines controller mode)
- Using StatefulSet ordinals, which doesn't allow for failover, but guarantees keys are evenly spread across replicas.
This PR adds support for pipelines controller statefulset ordinals
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lint
before submitting a PRSee the contribution guide for more details.
Release Notes