mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: add Ready.MustSync
Add Ready.MustSync which indicates that the hard state and raft log entries in a Ready message must be synchronously written to persistent storage.
This commit is contained in:
@@ -487,11 +487,13 @@ func TestNodeStart(t *testing.T) {
|
||||
CommittedEntries: []raftpb.Entry{
|
||||
{Type: raftpb.EntryConfChange, Term: 1, Index: 1, Data: ccdata},
|
||||
},
|
||||
MustSync: true,
|
||||
},
|
||||
{
|
||||
HardState: raftpb.HardState{Term: 2, Commit: 3, Vote: 1},
|
||||
Entries: []raftpb.Entry{{Term: 2, Index: 3, Data: []byte("foo")}},
|
||||
CommittedEntries: []raftpb.Entry{{Term: 2, Index: 3, Data: []byte("foo")}},
|
||||
MustSync: true,
|
||||
},
|
||||
}
|
||||
storage := NewMemoryStorage()
|
||||
@@ -544,6 +546,7 @@ func TestNodeRestart(t *testing.T) {
|
||||
HardState: st,
|
||||
// commit up to index commit index in st
|
||||
CommittedEntries: entries[:st.Commit],
|
||||
MustSync: true,
|
||||
}
|
||||
|
||||
storage := NewMemoryStorage()
|
||||
@@ -588,6 +591,7 @@ func TestNodeRestartFromSnapshot(t *testing.T) {
|
||||
HardState: st,
|
||||
// commit up to index commit index in st
|
||||
CommittedEntries: entries,
|
||||
MustSync: true,
|
||||
}
|
||||
|
||||
s := NewMemoryStorage()
|
||||
|
||||
Reference in New Issue
Block a user