|
|
@@ -509,7 +509,7 @@ func TestApplyConfChangeShouldStop(t *testing.T) {
|
|
|
NodeID: 2,
|
|
|
}
|
|
|
// remove non-local member
|
|
|
- shouldStop, err := srv.applyConfChange(cc, nil)
|
|
|
+ shouldStop, err := srv.applyConfChange(cc, &raftpb.ConfState{})
|
|
|
if err != nil {
|
|
|
t.Fatalf("unexpected error %v", err)
|
|
|
}
|
|
|
@@ -519,7 +519,7 @@ func TestApplyConfChangeShouldStop(t *testing.T) {
|
|
|
|
|
|
// remove local member
|
|
|
cc.NodeID = 1
|
|
|
- shouldStop, err = srv.applyConfChange(cc, nil)
|
|
|
+ shouldStop, err = srv.applyConfChange(cc, &raftpb.ConfState{})
|
|
|
if err != nil {
|
|
|
t.Fatalf("unexpected error %v", err)
|
|
|
}
|
|
|
@@ -1095,10 +1095,7 @@ func TestApplySnapshotAndCommittedEntries(t *testing.T) {
|
|
|
func TestAddMember(t *testing.T) {
|
|
|
n := newNodeConfChangeCommitterRecorder()
|
|
|
n.readyc <- raft.Ready{
|
|
|
- SoftState: &raft.SoftState{
|
|
|
- RaftState: raft.StateLeader,
|
|
|
- Nodes: []uint64{2345, 3456},
|
|
|
- },
|
|
|
+ SoftState: &raft.SoftState{RaftState: raft.StateLeader},
|
|
|
}
|
|
|
cl := newTestCluster(nil)
|
|
|
cl.SetStore(store.New())
|
|
|
@@ -1132,10 +1129,7 @@ func TestAddMember(t *testing.T) {
|
|
|
func TestRemoveMember(t *testing.T) {
|
|
|
n := newNodeConfChangeCommitterRecorder()
|
|
|
n.readyc <- raft.Ready{
|
|
|
- SoftState: &raft.SoftState{
|
|
|
- RaftState: raft.StateLeader,
|
|
|
- Nodes: []uint64{1234, 2345, 3456},
|
|
|
- },
|
|
|
+ SoftState: &raft.SoftState{RaftState: raft.StateLeader},
|
|
|
}
|
|
|
cl := newTestCluster(nil)
|
|
|
cl.SetStore(store.New())
|
|
|
@@ -1169,10 +1163,7 @@ func TestRemoveMember(t *testing.T) {
|
|
|
func TestUpdateMember(t *testing.T) {
|
|
|
n := newNodeConfChangeCommitterRecorder()
|
|
|
n.readyc <- raft.Ready{
|
|
|
- SoftState: &raft.SoftState{
|
|
|
- RaftState: raft.StateLeader,
|
|
|
- Nodes: []uint64{1234, 2345, 3456},
|
|
|
- },
|
|
|
+ SoftState: &raft.SoftState{RaftState: raft.StateLeader},
|
|
|
}
|
|
|
cl := newTestCluster(nil)
|
|
|
cl.SetStore(store.New())
|
|
|
@@ -1579,7 +1570,7 @@ func (n *nodeRecorder) Ready() <-chan raft.Ready { return nil }
|
|
|
func (n *nodeRecorder) Advance() {}
|
|
|
func (n *nodeRecorder) ApplyConfChange(conf raftpb.ConfChange) *raftpb.ConfState {
|
|
|
n.record(action{name: "ApplyConfChange", params: []interface{}{conf}})
|
|
|
- return nil
|
|
|
+ return &raftpb.ConfState{}
|
|
|
}
|
|
|
func (n *nodeRecorder) Stop() {
|
|
|
n.record(action{name: "Stop"})
|
|
|
@@ -1643,7 +1634,7 @@ func (n *nodeConfChangeCommitterRecorder) Ready() <-chan raft.Ready {
|
|
|
}
|
|
|
func (n *nodeConfChangeCommitterRecorder) ApplyConfChange(conf raftpb.ConfChange) *raftpb.ConfState {
|
|
|
n.record(action{name: "ApplyConfChange:" + conf.Type.String()})
|
|
|
- return nil
|
|
|
+ return &raftpb.ConfState{}
|
|
|
}
|
|
|
|
|
|
type waitWithResponse struct {
|