-
Notifications
You must be signed in to change notification settings - Fork 117
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 ConsumerGroup scheduling #1632
Add ConsumerGroup scheduling #1632
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1632 +/- ##
============================================
+ Coverage 71.86% 72.64% +0.77%
- Complexity 595 597 +2
============================================
Files 122 122
Lines 4521 4569 +48
Branches 171 171
============================================
+ Hits 3249 3319 +70
+ Misses 1008 977 -31
- Partials 264 273 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
b1fe326
to
87933be
Compare
87933be
to
de48c2f
Compare
Flaky |
de48c2f
to
4cc955a
Compare
Can I please get a review of this PR? @matzew @aliok @devguyio @aavarghese @lionelvillard |
control-plane/pkg/apis/internals/kafka/eventing/v1alpha1/consumer_group_types.go
Show resolved
Hide resolved
|
||
if _, err := r.InternalsClient.Consumers(cg.GetNamespace()).Create(ctx, c, metav1.CreateOptions{}); err != nil { | ||
return fmt.Errorf("failed to create consumer %s/%s: %w", c.GetNamespace(), c.GetName(), err) | ||
// Check if there is a consumer for the given placement. |
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 there is no consumer, we create/reconcile an internal consumer and return it ?
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.
Yes
} | ||
|
||
// Stable sort consumers so that we give consumers different deletion | ||
// priorities based on their state. |
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.
I may lack context, but what state? the IsLessThan
compares what?
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.
I'll make this part more explicit in a follow-up PR.
IsLessThan
defines the order for deleting consumers in the same placement.
Imagine there are consumer c1
and consumer c2
in pod p1
.
We want to have only one consumer for a placement, so we remove one of them based on their state.
In our case, we're considering readiness or the creation time as a state, meaning that we try to keep ready consumers over not ready ones or if they aren't ready we remove the most recently created ones.
I gave a first review. any more to read for better context ? |
The scheduler doc and API may be helpful: https://github.com/knative/eventing/tree/main/pkg/scheduler |
Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
8207334
to
59cbd86
Compare
The following is the coverage report on the affected files.
|
/lgtm /hold |
} | ||
} | ||
|
||
func ConsumerTopics(topics ...string) ConsumerSpecOption { |
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.
For consistency, can some of these funcs be renamed to WithConsumerTopics
, WithConsumerPlacement
, WithConsumerConfigs
, WithConsumerBootstrapServersConfig
, etc. Wdyt?
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.
All looks good! Func name change not critical for this iteration so..
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aavarghese, pierDipi 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 |
Thanks! /unhold |
Part of #1537
Proposed Changes
Release Note
Docs