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

Proposal: remove broker ingress channel #2254

Closed
yolocs opened this issue Dec 3, 2019 · 12 comments · Fixed by #2290
Closed

Proposal: remove broker ingress channel #2254

yolocs opened this issue Dec 3, 2019 · 12 comments · Fixed by #2290
Assignees
Labels
area/performance kind/feature-request proposal/0.12 Proposed (not planned) work items for 0.12 release
Milestone

Comments

@yolocs
Copy link
Contributor

yolocs commented Dec 3, 2019

Problem
Broker currently creates two channels: trigger and ingress. The ingress channel is used to stage events replied by triggers. However, it seems like it's a meaningless additional hop that introduced latency and reliability issue. I think a better approach is to directly send replies to the ingress service.

One might argument the ingress channel can help with reliability. Since a reply is a http response, there is no indicator of whether the response is successful or not. A lost reply means a lost event that cannot be recovered. And because (in most cases) the ingress channel provides durability, it can help preventing losing replied events.

This is not true because if the ingress channel is down, we will anyway lose replied events. This is essentially the same as directly replying to the ingress service except that the ingress channel itself is yet another potential point of failure.

How should we do if the ingress service is down? It probably worths its own issue but here is my rough idea.

The current flow is:

(channel outbound) -[req]-> (filter service) -[req]-> (consumer) -[resp with event]-> (filter) -[resp with event]-> (channel outbound) -[ack message]-> (the real channel e.g. kafka)
                                                                                                                                       |
                                                                                                                                       -[req with event]-> (replyURL)

The channel outbound can first try send the replied event to the replyURL, then decide whether to ack or unack the message. In this way, if it fails to deliver the replied event, the flow will be retried again.

Persona:
Dev

Exit Criteria

  1. Ingress channel is removed from broker and replyURL is replaced with the ingress service endpoint.
  2. (Optional for this issue) Adjust channel outbound logic to try deliver replies first.

Time Estimate (optional):
1 week.

@yolocs
Copy link
Contributor Author

yolocs commented Dec 3, 2019

/area performance

@yolocs
Copy link
Contributor Author

yolocs commented Dec 3, 2019

/assign @grantr

@mikehelmick
Copy link
Contributor

related #1555

@yolocs
Copy link
Contributor Author

yolocs commented Dec 3, 2019

/assign @yolocs

@grantr
Copy link
Contributor

grantr commented Dec 3, 2019

/unassign

@aslom
Copy link
Member

aslom commented Dec 4, 2019

@yolocs could you show what is current architecture - ingress channel how it is used in particualr?
Also in the flow what is channel outbound and why is it used twice?

(channel outbound) -[req]-> (filter service) -[req]-> (consumer) -[resp with event]-> (filter) -[resp with event]-> (channel outbound) -[ack message]-> (the real channel e.g. kafka)

@aslom
Copy link
Member

aslom commented Dec 4, 2019

We could discuss it in more detail Channels WG? Add to agenda https://docs.google.com/document/d/1uxlulaAf2m_yZUqCIeI-inul2gsqP69PElnZdO0FHUo/edit#heading=h.pd8ef9j5o38k

@yolocs
Copy link
Contributor Author

yolocs commented Dec 4, 2019

@yolocs could you show what is current architecture - ingress channel how it is used in particualr?
Also in the flow what is channel outbound and why is it used twice?

"Channel outbound" is the channel component which pushes events to subscribers. For IMC, it's the imc-dispatcher. The flow above has [req] and [resp]. "Channel outbound" makes a [req] and in the end it will receive a [resp] - that's why it appeared twice.

I'll try to create a nicer flow chart to explain the broker internals.

@lionelvillard
Copy link
Member

I drew one a long time ago. Not sure if it's accurate

broker 001

@yolocs
Copy link
Contributor Author

yolocs commented Dec 4, 2019

Thanks, @lionelvillard! Nice chart and I think it's still accurate.

What I'm proposing is to have (5) directly link back to the "broker ingress" rather than going through the "broker ingress channel" (called topic in this chart).

@capri-xiyue capri-xiyue added the proposal/0.12 Proposed (not planned) work items for 0.12 release label Dec 5, 2019
@yolocs
Copy link
Contributor Author

yolocs commented Dec 6, 2019

Found in the comment:

// 5. Ingress Channel is created to get events from Triggers back into this Broker via the
// Ingress Deployment.
// - Ideally this wouldn't exist and we would point the Trigger's reply directly to the K8s
// Service. However, Subscriptions only allow us to send replies to Channels, so we need
// this as an intermediary.

Since we now have Destination instead of Channel in the Reply. It seems there is no more reason to have the ingress channel.

@matzew
Copy link
Member

matzew commented Dec 10, 2019

+1 I guess :-)

/cc @vaikas @Abd4llA

@akashrv akashrv added this to the v0.12.0 milestone Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance kind/feature-request proposal/0.12 Proposed (not planned) work items for 0.12 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants