From f1803442ed8b51acebd844e4cb5c9abd6eebb468 Mon Sep 17 00:00:00 2001
From: Manish R Jain <manish@dgraph.io>
Date: Fri, 10 Aug 2018 13:00:21 -0700
Subject: [PATCH] Fix wording and check for negative number of replicas.

---
 dgraph/cmd/zero/run.go | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dgraph/cmd/zero/run.go b/dgraph/cmd/zero/run.go
index e96e615a..dc91644b 100644
--- a/dgraph/cmd/zero/run.go
+++ b/dgraph/cmd/zero/run.go
@@ -141,10 +141,11 @@ func run() {
 		rebalanceInterval: Zero.Conf.GetDuration("rebalance_interval"),
 	}
 
-	if opts.numReplicas % 2 == 0 {
-		log.Fatalf("Invalid flag value --replicas=%d - number of replicas cannot be divisible by 2", opts.numReplicas)
+	if opts.numReplicas < 0 || opts.numReplicas%2 == 0 {
+		log.Fatalf("ERROR: Number of replicas must be odd for consensus. Found: %d",
+			opts.numReplicas)
 	}
-	
+
 	if Zero.Conf.GetBool("expose_trace") {
 		trace.AuthRequest = func(req *http.Request) (any, sensitive bool) {
 			return true, true
-- 
GitLab