Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain committed Dec 9, 2020
1 parent d18f269 commit 065c66a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dgraph/cmd/zero/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ func (n *node) snapshotPeriodically(closer *z.Closer) {
for {
select {
case <-ticker.C:
if err := n.calculateSnapshotAndPurge(); err != nil {
if err := n.calculateAndProposeSnapshot(); err != nil {
glog.Errorf("While calculateAndProposeSnapshot: %v", err)
}

Expand All @@ -687,12 +687,12 @@ func (n *node) snapshotPeriodically(closer *z.Closer) {
}
}

// calculateSnapshotAndPurge works by tracking Alpha group leaders' checkpoint timestamps. It then
// calculateAndProposeSnapshot works by tracking Alpha group leaders' checkpoint timestamps. It then
// finds the minimum checkpoint ts across these groups, say Tmin. And then, iterates over Zero Raft
// logs to determine what all entries we could discard which are below Tmin. It uses that
// information to calculate a snapshot, which it proposes to other Zeros. When the proposal arrives
// via Raft, all Zeros apply it to themselves via applySnapshot in raft.Ready.
func (n *node) calculateSnapshotAndPurge() error {
func (n *node) calculateAndProposeSnapshot() error {
// Only run this on the leader.
if !n.AmLeader() {
return nil
Expand Down

0 comments on commit 065c66a

Please sign in to comment.