Sfoglia il codice sorgente

raft: add learner field to progress stringer

Jingyi Hu 6 anni fa
parent
commit
30034e5ff5
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      raft/progress.go

+ 2 - 1
raft/progress.go

@@ -185,7 +185,8 @@ func (pr *Progress) needSnapshotAbort() bool {
 }
 
 func (pr *Progress) String() string {
-	return fmt.Sprintf("next = %d, match = %d, state = %s, waiting = %v, pendingSnapshot = %d", pr.Next, pr.Match, pr.State, pr.IsPaused(), pr.PendingSnapshot)
+	return fmt.Sprintf("next = %d, match = %d, state = %s, waiting = %v, pendingSnapshot = %d, recentActive = %v, isLearner = %v",
+		pr.Next, pr.Match, pr.State, pr.IsPaused(), pr.PendingSnapshot, pr.RecentActive, pr.IsLearner)
 }
 
 type inflights struct {