From 50d50a9d07af61506d2347ddfb778b7bdcebf84d Mon Sep 17 00:00:00 2001 From: rahulgurnani Date: Tue, 11 Aug 2020 11:19:39 +0530 Subject: [PATCH 1/2] Fix DGRAPH-2185 --- dgraph/cmd/zero/run.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dgraph/cmd/zero/run.go b/dgraph/cmd/zero/run.go index c420f185c10..425971ed5cb 100644 --- a/dgraph/cmd/zero/run.go +++ b/dgraph/cmd/zero/run.go @@ -186,6 +186,10 @@ func run() { } glog.Infof("Setting Config to: %+v", opts) + if opts.nodeId == 0 { + log.Fatalf("ERROR: Cannot idx flag cannot be 0. Please try again with idx as a positive integer") + } + x.WorkerConfig = x.WorkerOptions{ LudicrousMode: Zero.Conf.GetBool("ludicrous_mode"), } From 37c3d9dcc274dcb0e3cf63a3af80d97fe34efddc Mon Sep 17 00:00:00 2001 From: rahulgurnani Date: Tue, 11 Aug 2020 11:45:39 +0530 Subject: [PATCH 2/2] Update the help message for idx flag in dgraph zero --- dgraph/cmd/zero/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dgraph/cmd/zero/run.go b/dgraph/cmd/zero/run.go index 425971ed5cb..bda8a491692 100644 --- a/dgraph/cmd/zero/run.go +++ b/dgraph/cmd/zero/run.go @@ -83,7 +83,7 @@ instances to achieve high-availability. "addr:port of this server, so other Dgraph alphas can talk to this.") flag.IntP("port_offset", "o", 0, "Value added to all listening port numbers. [Grpc=5080, HTTP=6080]") - flag.Uint64("idx", 1, "Unique node index for this server.") + flag.Uint64("idx", 1, "Unique node index for this server. idx cannot be 0.") flag.Int("replicas", 1, "How many replicas to run per data shard."+ " The count includes the original shard.") flag.String("peer", "", "Address of another dgraphzero server.")