Skip to content

Commit

Permalink
Set min.insync.replicas on topic creation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
andreas-schroeder committed Sep 25, 2017
1 parent 65b1ac2 commit 3852051
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion check/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3852051

Please sign in to comment.