-
Notifications
You must be signed in to change notification settings - Fork 588
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
Expose Broker API to step down if not leader #8295
Conversation
9ed493b
to
7ae8e4a
Compare
7ae8e4a
to
280452e
Compare
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.
Looks good 🚀 Just some small comments.
broker/src/main/java/io/camunda/zeebe/broker/transport/adminapi/AdminApiRequestHandler.java
Outdated
Show resolved
Hide resolved
broker/src/main/java/io/camunda/zeebe/broker/transport/adminapi/AdminApiRequestHandler.java
Outdated
Show resolved
Hide resolved
broker/src/main/java/io/camunda/zeebe/broker/transport/adminapi/AdminApiRequestHandler.java
Outdated
Show resolved
Hide resolved
broker/src/main/java/io/camunda/zeebe/broker/transport/adminapi/AdminApiRequestHandler.java
Outdated
Show resolved
Hide resolved
broker/src/main/java/io/camunda/zeebe/broker/bootstrap/PartitionManagerStep.java
Show resolved
Hide resolved
Instead of using a partition listener to subscribe/unsubscribe based on becoming leader or follower we simply subscribe to admin requests on all partitions and never unsubscribe. The admin api handles requests on followers gracefully.
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.
Unsubscribing the request topics still unsubscribes all instead of specific types. Please fix it. Otherwise all good 👍
transport/src/main/java/io/camunda/zeebe/transport/impl/AtomixServerTransport.java
Show resolved
Hide resolved
transport/src/main/java/io/camunda/zeebe/transport/impl/AtomixServerTransport.java
Show resolved
Hide resolved
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.
Great! 🚀
bors r+ |
Build succeeded: |
Description
This introduces a new Admin API for the Broker. The only supported request so far is
STEP_DOWN_IF_NOT_LEADER
.The handler has access to the Raft partitions by getting the partition manager injected after partitions are started.
The handler is a
PartitionListener
so it subscribes and unsubscribes to messages when it transitions between leader, follower and inactive. This is optional behavior and could be removed as thestepDownIfNotLeader
is a no-op when the broker is not the leader for this partition.Related issues
closes #8224
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/0.25
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation: