diff --git a/drkafka/src/main/java/com/pinterest/doctorkafka/KafkaClusterManager.java b/drkafka/src/main/java/com/pinterest/doctorkafka/KafkaClusterManager.java index 932144ca..ef970c1f 100644 --- a/drkafka/src/main/java/com/pinterest/doctorkafka/KafkaClusterManager.java +++ b/drkafka/src/main/java/com/pinterest/doctorkafka/KafkaClusterManager.java @@ -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; }