-
Notifications
You must be signed in to change notification settings - Fork 27
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
Stop Kafka Service Before Running Broker Recovery Process #309
Conversation
@@ -42,6 +44,7 @@ public class BrokerRecoveryAction extends NodeAction { | |||
private static final int retryIntervalMilliseconds = 1000; | |||
|
|||
public static final String ATTR_TRY_TO_RESTART_KEY = "try_restart"; | |||
public static final String ATTR_STOP_SERVICE_BEFORE_REPLACEMENT = "stop_service_before_replacement"; |
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.
Why do we need this? We should always do replacements by stopping the broker first, so no need to make it configurable in my opinion.
@@ -126,6 +129,37 @@ public void runAction() { | |||
|
|||
getResult().appendOut("Start replacing broker"); | |||
|
|||
// Try to gracefully shutdown service before replacing broker. | |||
// This can make sure the broker is not the leader of any partition. |
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.
nit: replace this comment with
// This ensures partition leaderships are moved away from the broker before the replacement process starts.
This PR introduces logic to attempt stopping the Kafka service on a broker before executing other broker recovery actions. This action triggers leadership failover, allowing other brokers to become leaders of Kafka topic partitions.