From 87a39546b07b00cf22a89c5c7f7c81274e63f753 Mon Sep 17 00:00:00 2001 From: Rohan Prasad Date: Wed, 31 Mar 2021 17:08:27 +0530 Subject: [PATCH 1/6] Add flag for snapshot duration frequency --- compose/compose.go | 2 +- dgraph/cmd/alpha/run.go | 10 ++++++++-- worker/draft.go | 19 +++++++++++++------ worker/server_state.go | 9 +++++---- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/compose/compose.go b/compose/compose.go index fe38ccf9987..98ec03f9d9d 100644 --- a/compose/compose.go +++ b/compose/compose.go @@ -311,7 +311,7 @@ func getAlpha(idx int, raft string) service { } if opts.SnapshotAfter != "" { - raft = fmt.Sprintf("%s; snapshot-after=%s", raft, opts.SnapshotAfter) + raft = fmt.Sprintf("%s; snapshot-after-entries=%s", raft, opts.SnapshotAfter) } svc.Command += fmt.Sprintf(` --raft "%s"`, raft) diff --git a/dgraph/cmd/alpha/run.go b/dgraph/cmd/alpha/run.go index a3d4789c3b4..4d0e6721cc7 100644 --- a/dgraph/cmd/alpha/run.go +++ b/dgraph/cmd/alpha/run.go @@ -158,9 +158,15 @@ they form a Raft group and provide synchronous replication. Flag("learner", `Make this Alpha a "learner" node. In learner mode, this Alpha will not participate `+ "in Raft elections. This can be used to achieve a read-only replica."). - Flag("snapshot-after", + Flag("snapshot-after-entries", "Create a new Raft snapshot after N number of Raft entries. The lower this number, "+ - "the more frequent snapshot creation will be."). + "the more frequent snapshot creation will be. Snapshots are created if either "+ + "snapshot-after-duration or snapshot-after-entries threshold is crossed."). + Flag("snapshot-after-duration", + "Frequency at which we should create a new raft snapshots. Set "+ + "to 0 to disable duration based snapshot. Snapshots are "+ + "created if either snapshot-after-duration or "+ + "snapshot-after-entries threshold is crossed."). Flag("pending-proposals", "Number of pending mutation proposals. Useful for rate limiting."). String()) diff --git a/worker/draft.go b/worker/draft.go index afe668d248d..7e8664a2fbe 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -997,10 +997,15 @@ func (n *node) updateRaftProgress() error { func (n *node) checkpointAndClose(done chan struct{}) { slowTicker := time.NewTicker(time.Minute) + lastSnapshotTime := time.Now() defer slowTicker.Stop() - snapshotAfter := x.WorkerConfig.Raft.GetUint64("snapshot-after") - x.AssertTruef(snapshotAfter > 10, "raft.snapshot-after must be a number greater than 10") + snapshotAfterEntries := x.WorkerConfig.Raft.GetUint64("snapshot-after-entries") + x.AssertTruef(snapshotAfterEntries > 10, "raft.snapshot-after must be a number greater than 10") + + snapshotAfterDuration, err := time.ParseDuration(x.WorkerConfig.Raft.GetString("snapshot-after-duration")) + x.AssertTruef(err == nil, "raft.snapshot-after-duration must be a duration, recieved: %s", + x.WorkerConfig.Raft.GetString("snapshot-after-duration")) for { select { @@ -1026,16 +1031,17 @@ func (n *node) checkpointAndClose(done chan struct{}) { // If we don't have a snapshot, or if there are too many log files in Raft, // calculate a new snapshot. - calculate := raft.IsEmptySnap(snap) || n.Store.NumLogFiles() > 4 + calculate := raft.IsEmptySnap(snap) || n.Store.NumLogFiles() > 4 || + (snapshotAfterDuration != 0 && time.Since(lastSnapshotTime) > snapshotAfterDuration) if chk, err := n.Store.Checkpoint(); err == nil { if first, err := n.Store.FirstIndex(); err == nil { // Save some cycles by only calculating snapshot if the checkpoint has gone // quite a bit further than the first index. - calculate = calculate || chk >= first+snapshotAfter + calculate = calculate || chk >= first+snapshotAfterEntries glog.V(3).Infof("Evaluating snapshot first:%d chk:%d (chk-first:%d) "+ - "snapshotAfter:%d snap:%v", first, chk, chk-first, - snapshotAfter, calculate) + "snapshotAfterEntries:%d snap:%v", first, chk, chk-first, + snapshotAfterEntries, calculate) } } // We keep track of the applied index in the p directory. Even if we don't take @@ -1056,6 +1062,7 @@ func (n *node) checkpointAndClose(done chan struct{}) { if err := n.proposeSnapshot(); err != nil { glog.Errorf("While calculating and proposing snapshot: %v", err) } + lastSnapshotTime = time.Now() } go n.abortOldTransactions() } diff --git a/worker/server_state.go b/worker/server_state.go index 13306aec843..1f9d7520b80 100644 --- a/worker/server_state.go +++ b/worker/server_state.go @@ -38,10 +38,11 @@ const ( // For easy readability, keep the options without default values (if any) at the end of // the *Defaults string. Also, since these strings are printed in --help text, avoid line // breaks. - AclDefaults = `access-ttl=6h; refresh-ttl=30d; secret-file=;` - AuditDefaults = `compress=false; days=10; size=100; dir=; output=; encrypt-file=;` - BadgerDefaults = `compression=snappy; goroutines=8; max-retries=-1;` - RaftDefaults = `learner=false; snapshot-after=10000; pending-proposals=256; idx=; group=;` + AclDefaults = `access-ttl=6h; refresh-ttl=30d; secret-file=;` + AuditDefaults = `compress=false; days=10; size=100; dir=; output=; encrypt-file=;` + BadgerDefaults = `compression=snappy; goroutines=8; max-retries=-1;` + RaftDefaults = `learner=false; snapshot-after-entries=10000; ` + + `snapshot-after-duration=30m; pending-proposals=256; idx=; group=;` SecurityDefaults = `token=; whitelist=;` LudicrousDefaults = `enabled=false; concurrency=2000;` CDCDefaults = `file=; kafka=; sasl_user=; sasl_password=; ca_cert=; client_cert=; ` + From 0e34417117299673d028c9da32cf249e0d92f462 Mon Sep 17 00:00:00 2001 From: Rohan Prasad Date: Wed, 31 Mar 2021 20:16:34 +0530 Subject: [PATCH 2/6] Add comment for zero value --- worker/draft.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/draft.go b/worker/draft.go index 7e8664a2fbe..77701c2b3b0 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -1003,9 +1003,7 @@ func (n *node) checkpointAndClose(done chan struct{}) { snapshotAfterEntries := x.WorkerConfig.Raft.GetUint64("snapshot-after-entries") x.AssertTruef(snapshotAfterEntries > 10, "raft.snapshot-after must be a number greater than 10") - snapshotAfterDuration, err := time.ParseDuration(x.WorkerConfig.Raft.GetString("snapshot-after-duration")) - x.AssertTruef(err == nil, "raft.snapshot-after-duration must be a duration, recieved: %s", - x.WorkerConfig.Raft.GetString("snapshot-after-duration")) + snapshotAfterDuration := x.WorkerConfig.Raft.GetDuration("snapshot-after-duration") for { select { @@ -1031,6 +1029,8 @@ func (n *node) checkpointAndClose(done chan struct{}) { // If we don't have a snapshot, or if there are too many log files in Raft, // calculate a new snapshot. + // For snapshotAfterDuration, 0 is a special value used to + // disable time based snapshots. calculate := raft.IsEmptySnap(snap) || n.Store.NumLogFiles() > 4 || (snapshotAfterDuration != 0 && time.Since(lastSnapshotTime) > snapshotAfterDuration) From 144a09d02703a57f664edbaccdd9606c2d476845 Mon Sep 17 00:00:00 2001 From: Rohan Prasad Date: Wed, 31 Mar 2021 20:40:12 +0530 Subject: [PATCH 3/6] Update last snapshot only if proposal passes --- worker/draft.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker/draft.go b/worker/draft.go index 77701c2b3b0..a5c9cea8502 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -1061,8 +1061,9 @@ func (n *node) checkpointAndClose(done chan struct{}) { // or our checkpoint already crossed the SnapshotAfter threshold. if err := n.proposeSnapshot(); err != nil { glog.Errorf("While calculating and proposing snapshot: %v", err) + } else { + lastSnapshotTime = time.Now() } - lastSnapshotTime = time.Now() } go n.abortOldTransactions() } From bc3218cd9c0174149fea3b173b85e793740ee960 Mon Sep 17 00:00:00 2001 From: Rohan Prasad Date: Thu, 1 Apr 2021 11:42:51 +0530 Subject: [PATCH 4/6] Use both entiries and duration based flags for snapshots --- dgraph/cmd/alpha/run.go | 8 ++--- worker/docker-compose.yml | 63 +++++++++++++++------------------------ worker/draft.go | 26 +++++++++------- 3 files changed, 42 insertions(+), 55 deletions(-) diff --git a/dgraph/cmd/alpha/run.go b/dgraph/cmd/alpha/run.go index 4d0e6721cc7..b00739d5acc 100644 --- a/dgraph/cmd/alpha/run.go +++ b/dgraph/cmd/alpha/run.go @@ -160,13 +160,11 @@ they form a Raft group and provide synchronous replication. "in Raft elections. This can be used to achieve a read-only replica."). Flag("snapshot-after-entries", "Create a new Raft snapshot after N number of Raft entries. The lower this number, "+ - "the more frequent snapshot creation will be. Snapshots are created if either "+ - "snapshot-after-duration or snapshot-after-entries threshold is crossed."). + "the more frequent snapshot creation will be. Snapshots are created only if both "+ + "snapshot-after-duration and snapshot-after-entries threshold are crossed."). Flag("snapshot-after-duration", "Frequency at which we should create a new raft snapshots. Set "+ - "to 0 to disable duration based snapshot. Snapshots are "+ - "created if either snapshot-after-duration or "+ - "snapshot-after-entries threshold is crossed."). + "to 0 to disable duration based snapshot."). Flag("pending-proposals", "Number of pending mutation proposals. Useful for rate limiting."). String()) diff --git a/worker/docker-compose.yml b/worker/docker-compose.yml index e8d0b6bac79..b7ce05f097d 100644 --- a/worker/docker-compose.yml +++ b/worker/docker-compose.yml @@ -15,11 +15,9 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha --my=alpha1:7080 - --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 - --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" - --raft "snapshot-after=100;" - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha1:7080 + --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=1; group=1; + snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha2: image: dgraph/dgraph:latest working_dir: /data/alpha2 @@ -33,11 +31,9 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha --my=alpha2:7080 - --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 - --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" - --raft "snapshot-after=100;" - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha2:7080 + --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=2; group=1; + snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha3: image: dgraph/dgraph:latest working_dir: /data/alpha3 @@ -51,11 +47,9 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha --my=alpha3:7080 - --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 - --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" - --raft "snapshot-after=100;" - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha3:7080 + --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=3; group=1; + snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha4: image: dgraph/dgraph:latest working_dir: /data/alpha4 @@ -69,11 +63,9 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha --my=alpha4:7080 - --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 - --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" - --raft "snapshot-after=100;" - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha4:7080 + --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=4; group=2; + snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha5: image: dgraph/dgraph:latest working_dir: /data/alpha5 @@ -87,11 +79,9 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha --my=alpha5:7080 - --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 - --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" - --raft "snapshot-after=100;" - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha5:7080 + --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=5; group=2; + snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha6: image: dgraph/dgraph:latest working_dir: /data/alpha6 @@ -105,11 +95,9 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph alpha --my=alpha6:7080 - --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 - --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" - --raft "snapshot-after=100;" - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha6:7080 + --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=6; group=2; + snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" jaeger: image: jaegertracing/all-in-one:1.18 working_dir: /working/jaeger @@ -133,9 +121,8 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph zero --raft "idx=1;" --my=zero1:5080 - --replicas=3 --logtostderr -v=2 --bindall - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph zero --trace "jaeger=http://jaeger:14268;" --raft='idx=1' + --my=zero1:5080 --replicas=3 --logtostderr -v=2 --bindall zero2: image: dgraph/dgraph:latest working_dir: /data/zero2 @@ -151,9 +138,8 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph zero --raft "idx=2;" --my=zero2:5080 - --replicas=3 --logtostderr -v=2 --peer=zero1:5080 - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph zero --trace "jaeger=http://jaeger:14268;" --raft='idx=2' + --my=zero2:5080 --replicas=3 --logtostderr -v=2 --peer=zero1:5080 zero3: image: dgraph/dgraph:latest working_dir: /data/zero3 @@ -169,7 +155,6 @@ services: source: $GOPATH/bin target: /gobin read_only: true - command: /gobin/dgraph zero --raft "idx=3;" --my=zero3:5080 - --replicas=3 --logtostderr -v=2 --peer=zero1:5080 - --trace "jaeger=http://jaeger:14268;" + command: /gobin/dgraph zero --trace "jaeger=http://jaeger:14268;" --raft='idx=3' + --my=zero3:5080 --replicas=3 --logtostderr -v=2 --peer=zero1:5080 volumes: {} diff --git a/worker/draft.go b/worker/draft.go index a5c9cea8502..8360c4079b4 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -1031,19 +1031,23 @@ func (n *node) checkpointAndClose(done chan struct{}) { // calculate a new snapshot. // For snapshotAfterDuration, 0 is a special value used to // disable time based snapshots. - calculate := raft.IsEmptySnap(snap) || n.Store.NumLogFiles() > 4 || - (snapshotAfterDuration != 0 && time.Since(lastSnapshotTime) > snapshotAfterDuration) - - if chk, err := n.Store.Checkpoint(); err == nil { - if first, err := n.Store.FirstIndex(); err == nil { - // Save some cycles by only calculating snapshot if the checkpoint has gone - // quite a bit further than the first index. - calculate = calculate || chk >= first+snapshotAfterEntries - glog.V(3).Infof("Evaluating snapshot first:%d chk:%d (chk-first:%d) "+ - "snapshotAfterEntries:%d snap:%v", first, chk, chk-first, - snapshotAfterEntries, calculate) + calculate := raft.IsEmptySnap(snap) || n.Store.NumLogFiles() > 4 + + // Only take snapshot if both snapshotAfterDuration and + // snapshotAfterEntries requirements are met. + if snapshotAfterDuration == 0 || time.Since(lastSnapshotTime) > snapshotAfterDuration { + if chk, err := n.Store.Checkpoint(); err == nil { + if first, err := n.Store.FirstIndex(); err == nil { + // Save some cycles by only calculating snapshot if the checkpoint has gone + // quite a bit further than the first index. + calculate = calculate || chk >= first+snapshotAfterEntries + glog.V(3).Infof("Evaluating snapshot first:%d chk:%d (chk-first:%d) "+ + "snapshotAfterEntries:%d snap:%v", first, chk, chk-first, + snapshotAfterEntries, calculate) + } } } + // We keep track of the applied index in the p directory. Even if we don't take // snapshot for a while and let the Raft logs grow and restart, we would not have to // run all the log entries, because we can tell Raft.Config to set Applied to that From 792ebcdc7cedf06288d2eb4a704642515747f1de Mon Sep 17 00:00:00 2001 From: Rohan Prasad Date: Thu, 1 Apr 2021 17:01:21 +0530 Subject: [PATCH 5/6] Minor fixes --- worker/draft.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/worker/draft.go b/worker/draft.go index 8360c4079b4..f27d0ae6594 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -1003,7 +1003,7 @@ func (n *node) checkpointAndClose(done chan struct{}) { snapshotAfterEntries := x.WorkerConfig.Raft.GetUint64("snapshot-after-entries") x.AssertTruef(snapshotAfterEntries > 10, "raft.snapshot-after must be a number greater than 10") - snapshotAfterDuration := x.WorkerConfig.Raft.GetDuration("snapshot-after-duration") + snapshotFrequency := x.WorkerConfig.Raft.GetDuration("snapshot-after-duration") for { select { @@ -1029,17 +1029,16 @@ func (n *node) checkpointAndClose(done chan struct{}) { // If we don't have a snapshot, or if there are too many log files in Raft, // calculate a new snapshot. - // For snapshotAfterDuration, 0 is a special value used to - // disable time based snapshots. calculate := raft.IsEmptySnap(snap) || n.Store.NumLogFiles() > 4 - // Only take snapshot if both snapshotAfterDuration and - // snapshotAfterEntries requirements are met. - if snapshotAfterDuration == 0 || time.Since(lastSnapshotTime) > snapshotAfterDuration { + // Only take snapshot if both snapshotFrequency and + // snapshotAfterEntries requirements are met. If set to 0, + // we consider duration condition to be disabled. + if snapshotFrequency == 0 || time.Since(lastSnapshotTime) > snapshotFrequency { if chk, err := n.Store.Checkpoint(); err == nil { if first, err := n.Store.FirstIndex(); err == nil { - // Save some cycles by only calculating snapshot if the checkpoint has gone - // quite a bit further than the first index. + // Save some cycles by only calculating snapshot if the checkpoint + // has gone quite a bit further than the first index. calculate = calculate || chk >= first+snapshotAfterEntries glog.V(3).Infof("Evaluating snapshot first:%d chk:%d (chk-first:%d) "+ "snapshotAfterEntries:%d snap:%v", first, chk, chk-first, From 5a5bf34b239b3f5989a1a73bd676928fd4fe401a Mon Sep 17 00:00:00 2001 From: Rohan Prasad Date: Thu, 1 Apr 2021 20:24:08 +0530 Subject: [PATCH 6/6] Fix docker compose --- compose/compose.go | 2 +- worker/docker-compose.yml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compose/compose.go b/compose/compose.go index 98ec03f9d9d..f7c12fe5d6b 100644 --- a/compose/compose.go +++ b/compose/compose.go @@ -311,7 +311,7 @@ func getAlpha(idx int, raft string) service { } if opts.SnapshotAfter != "" { - raft = fmt.Sprintf("%s; snapshot-after-entries=%s", raft, opts.SnapshotAfter) + raft = fmt.Sprintf("%s; %s", raft, opts.SnapshotAfter) } svc.Command += fmt.Sprintf(` --raft "%s"`, raft) diff --git a/worker/docker-compose.yml b/worker/docker-compose.yml index b7ce05f097d..757f12dfd68 100644 --- a/worker/docker-compose.yml +++ b/worker/docker-compose.yml @@ -1,4 +1,4 @@ -# Auto-generated with: [./compose -a 6 -z 3 -j -w --port_offset=0 --expose_ports=false -O ../worker/docker-compose.yml --mem= --snapshot_after=100 --names=false] +# Auto-generated with: [./compose -a 6 -z 3 -j -w --port_offset=0 --expose_ports=false -O ../worker/docker-compose.yml --mem= --snapshot_after=snapshot-after-entries=100; snapshot-after-duration=1m --names=false] # version: "3.5" services: @@ -17,7 +17,7 @@ services: read_only: true command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha1:7080 --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=1; group=1; - snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" + snapshot-after-entries=100; snapshot-after-duration=1m" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha2: image: dgraph/dgraph:latest working_dir: /data/alpha2 @@ -33,7 +33,7 @@ services: read_only: true command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha2:7080 --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=2; group=1; - snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" + snapshot-after-entries=100; snapshot-after-duration=1m" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha3: image: dgraph/dgraph:latest working_dir: /data/alpha3 @@ -49,7 +49,7 @@ services: read_only: true command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha3:7080 --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=3; group=1; - snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" + snapshot-after-entries=100; snapshot-after-duration=1m" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha4: image: dgraph/dgraph:latest working_dir: /data/alpha4 @@ -65,7 +65,7 @@ services: read_only: true command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha4:7080 --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=4; group=2; - snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" + snapshot-after-entries=100; snapshot-after-duration=1m" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha5: image: dgraph/dgraph:latest working_dir: /data/alpha5 @@ -81,7 +81,7 @@ services: read_only: true command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha5:7080 --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=5; group=2; - snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" + snapshot-after-entries=100; snapshot-after-duration=1m" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" alpha6: image: dgraph/dgraph:latest working_dir: /data/alpha6 @@ -97,7 +97,7 @@ services: read_only: true command: /gobin/dgraph alpha --trace "jaeger=http://jaeger:14268;" --my=alpha6:7080 --zero=zero1:5080,zero2:5080,zero3:5080 --logtostderr -v=2 --raft "idx=6; group=2; - snapshot-after-entries=100" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" + snapshot-after-entries=100; snapshot-after-duration=1m" --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" jaeger: image: jaegertracing/all-in-one:1.18 working_dir: /working/jaeger