From 4aa15294a8808a86a2d23d17ba1b8220a4661647 Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Sun, 24 Aug 2014 20:11:24 -0700 Subject: [PATCH] raft: re-remove clusterId from raft --- raft/log.go | 4 ++-- raft/raft_test.go | 4 ---- raft/snapshot.go | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/raft/log.go b/raft/log.go index 1fc331248..8766f677b 100644 --- a/raft/log.go +++ b/raft/log.go @@ -175,8 +175,8 @@ func (l *raftLog) compact(i int64) int64 { return int64(len(l.ents)) } -func (l *raftLog) snap(d []byte, clusterId, index, term int64, nodes []int64) { - l.snapshot = Snapshot{clusterId, d, nodes, index, term} +func (l *raftLog) snap(d []byte, index, term int64, nodes []int64) { + l.snapshot = Snapshot{d, nodes, index, term} } func (l *raftLog) shouldCompact() bool { diff --git a/raft/raft_test.go b/raft/raft_test.go index 511cf930f..4d81ed662 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -792,7 +792,6 @@ func TestRecvMsgBeat(t *testing.T) { func TestRestore(t *testing.T) { s := Snapshot{ - ClusterId: 0xBEEF, Index: defaultCompactThreshold + 1, Term: defaultCompactThreshold + 1, Nodes: []int64{0, 1, 2}, @@ -803,9 +802,6 @@ func TestRestore(t *testing.T) { t.Fatal("restore fail, want succeed") } - if sm.clusterId != s.ClusterId { - t.Errorf("sm.cluster = %x, want %x", sm.clusterId, s.ClusterId) - } if sm.raftLog.lastIndex() != s.Index { t.Errorf("log.lastIndex = %d, want %d", sm.raftLog.lastIndex(), s.Index) } diff --git a/raft/snapshot.go b/raft/snapshot.go index 95a8ca49d..61893391d 100644 --- a/raft/snapshot.go +++ b/raft/snapshot.go @@ -3,7 +3,6 @@ package raft var emptySnapshot = Snapshot{} type Snapshot struct { - ClusterId int64 Data []byte // the configuration Nodes []int64