-
Notifications
You must be signed in to change notification settings - Fork 738
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
feat(sensor): disable leader election for jetstream eventbus #3303
base: master
Are you sure you want to change the base?
feat(sensor): disable leader election for jetstream eventbus #3303
Conversation
Signed-off-by: Ryan Currah <[email protected]>
9a54370
to
6a644d0
Compare
What is the reason leader election is not needed when using jetstream? Assume the trigger relies on events from multiple sources, with multiple sensor instances, it will be an issue right? |
Leader election is not needed when using JetStream because, like Kafka consumer groups, it supports horizontal scaling through queue subscriptions, which distribute events across multiple sensor instances, ensuring that only one instance processes each event. Similar to Kafka consumer groups, where each message is processed by only one consumer within a group, JetStream queue subscriptions achieve the same event distribution. It is important to ensure that queue subscriptions are enabled; otherwise, if sensor leader election is turned off, all sensor instances will receive and process the same events, leading to duplicate event processing. Before disabling leader election for JetStream, my PR should verify that queue subscriptions are enabled to ensure that events are handled by only one sensor instance. Queue subscription support was added in this commit: 5461296. |
This is not my concern. My concern is about the following scenario: Sensor |
Hrm how does it work for Kafka? I assume the concerns would have also applied to Kafka, and if so how did you solve it for Kafka? This is the PR in which Kafka was added 95a0877#diff-57d9dbd85ed75b31a65e6880e99ee6ae77344b1760efa44ad73e82a2dce287bcR46 |
Supersedes #3240
Checklist: