From 3852051711afe376499a06342a6f421ccd52e14c Mon Sep 17 00:00:00 2001 From: Andreas Schroeder Date: Mon, 25 Sep 2017 22:59:11 +0200 Subject: [PATCH] Set min.insync.replicas on topic creation On clusters with a default min.insync.replicas setting, the health check failed as it does not properly set up the topic replica set for the simple health checks. Setting min.insync.replicas explicitly to 1 on topic creation fixes this issue. Resolves: #13 --- check/setup.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check/setup.go b/check/setup.go index 3f26ce7..35170eb 100644 --- a/check/setup.go +++ b/check/setup.go @@ -170,7 +170,8 @@ func (check *HealthCheck) createTopic(name string, forHealthCheck bool) (err err if !exists { topicConfig := `{"version":1,"config":{"delete.retention.ms":"10000",` + - `"cleanup.policy":"delete","compression.type":"uncompressed"}}` + `"cleanup.policy":"delete","compression.type":"uncompressed",` + + `"min.insync.replicas":"1"}}` log.Infof(`creating topic "%s" configuration node`, name) if err = createZkNode(zkConn, topicPath, topicConfig, forHealthCheck); err != nil {