Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Add safeguard so that dry-runs won't perform replacement actions #138

Merged
merged 1 commit into from
May 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -969,12 +969,17 @@ private boolean checkAndReplaceDeadBrokers() {
return false;
}

LOG.info("Replacing {} in {}", brokerName, clusterName);
brokerReplacer.replaceBroker(brokerName);
zookeeperClient.recordBrokerTermination(clusterName, brokerName);
actionReporter.sendMessage(clusterName, "broker replacement : " + brokerName);
Email.notifyOnBrokerReplacement(drkafkaConfig.getNotificationEmails(),
clusterName, brokerName);
if (!clusterConfig.dryRun()){
LOG.info("Replacing {} in {}", brokerName, clusterName);
brokerReplacer.replaceBroker(brokerName);
zookeeperClient.recordBrokerTermination(clusterName, brokerName);
actionReporter.sendMessage(clusterName, "broker replacement : " + brokerName);
Email.notifyOnBrokerReplacement(drkafkaConfig.getNotificationEmails(),
clusterName, brokerName);
} else {
LOG.info("Dry run: Replacing {} in {}", brokerName, clusterName);
}

}
return true;
}
Expand Down