Xiang Li
48f75ca645
raft: add TestUnstableMaybeTerm
2014-12-03 11:30:59 -08:00
Xiang Li
058356d9bd
raft: add TestUnstableLastIndex
2014-12-03 11:11:31 -08:00
Xiang Li
98ebfa3468
raft: add TestUnstableFirstIndex
2014-12-03 11:11:11 -08:00
Yicheng Qin
23b32a6cbe
Merge pull request #1716 from yichengq/225
...
raft: panic if loaded commit is out of range
2014-12-02 22:14:12 -08:00
Yicheng Qin
38768e5396
raft: panic if loaded commit is out of range
2014-12-02 22:09:34 -08:00
Xiang Li
b3841afcc3
raft: do not restore snapshot if local raft has longer matching history
...
Raft should not restore the snapshot if it has longer matching history.
Or restoring snapshot might remove the matched entries.
2014-12-02 21:34:14 -08:00
Xiang Li
3209fd544b
raft: panic on bad slice
2014-12-02 17:48:03 -08:00
Xiang Li
79014556e9
Merge pull request #1831 from xiang90/fix_unstable
...
raft: fix unstable
2014-12-02 14:43:11 -08:00
Xiang Li
2f5b748a90
raft: clearify that the firstIndex might not be available.
2014-12-02 14:27:52 -08:00
Yicheng Qin
1c7b9317a9
Merge pull request #1833 from yichengq/244
...
raft: not call stableTo for restored snapshot
2014-12-02 13:20:39 -08:00
Yicheng Qin
551a56fb98
raft: not call stableTo for restored snapshot
...
Stable has been set when restoring the snapshot in raftlog, so we don't need
to set it after advance.
2014-12-02 13:10:35 -08:00
Xiang Li
b7ca56e3c8
raft: move good case of truncateAndAppend to the first place
2014-12-02 13:05:55 -08:00
Xiang Li
3cadaca1a3
Merge pull request #1830 from xiang90/raft_snap_log
...
raft: log snapshot events
2014-12-02 12:06:15 -08:00
Xiang Li
411063e14f
raft: log snapshot events
2014-12-02 11:57:10 -08:00
Xiang Li
788d1e59a2
raft: use index in entry
2014-12-02 10:25:27 -08:00
Xiang Li
51de095d2c
raft: logging state change events and events on bad path
2014-12-02 10:08:19 -08:00
Xiang Li
312db7f0f3
raft: fix memory storage
...
Memory storage should append all entries that have greater index
than the snap.Matedata.Index. We first truncate the old parts of
incoming entries. Then truncate the existing entries in the storage.
At last, we append the incoming entries to the existing entries.
2014-12-01 16:37:16 -08:00
Xiang Li
19ccdbee18
Merge pull request #1806 from xiang90/no_copy
...
No copy
2014-12-01 13:15:13 -08:00
Xiang Li
92d4112feb
Merge pull request #1809 from xiang90/unstable
...
raft: stableTo checks term matching
2014-12-01 11:09:40 -08:00
Xiang Li
649176934a
raft: add tests for stableTo
2014-12-01 10:54:34 -08:00
Xiang Li
3c0fbe285c
raft: stableTo checks term matching
...
stableTo should only mark the index stable if the term is matched. After raft sends out unstable
entries to application, raft makes progress without waiting for reply. When the appliaction
calls the stableTo to notify the entries up to "index" are stable, raft might have truncated
some entries before "index" due to leader lost. raft must verify the (index,term) of stableTo,
before marking the entries as stable.
2014-11-28 14:13:07 -08:00
Xiang Li
d214e87aee
raft: make unstable.entries immutable; copy the entries at bad path
2014-11-27 19:35:03 -08:00
Xiang Li
d244e3bf6e
raft: fix node bench
2014-11-26 23:07:35 -08:00
Xiang Li
fe0bc4ff36
Merge pull request #1805 from xiang90/fix_raft_b
...
raft: fix start term
2014-11-26 21:41:38 -08:00
Xiang Li
746c66b466
raft: fix start term
2014-11-26 21:21:13 -08:00
Xiang Li
7929e46dd8
raft: clean up
2014-11-26 15:31:07 -08:00
Xiang Li
8a626257c7
raft: move unstable related function to log_unstable.go
2014-11-26 15:25:24 -08:00
Yicheng Qin
0f070f3d2d
raft: no need to save dummy entry into stable storage
2014-11-26 14:04:56 -08:00
Xiang Li
66252c7d62
raft: move all unstable stuff into one struct for future cleanup
2014-11-26 13:36:17 -08:00
Yicheng Qin
ab2a40ea37
Merge branch 'log_interface'
...
Conflicts:
raft/log.go
2014-11-26 12:16:02 -08:00
Xiang Li
732cfa1ad6
raft: remove the applysnap from Storage interface
2014-11-26 11:28:51 -08:00
Xiang Li
e23f9e76d1
raft: do not applysnapshot in raft
2014-11-26 10:59:13 -08:00
Xiang Li
39e6631447
raft: always write dummy entry to storage
2014-11-25 23:27:40 -08:00
Xiang Li
8de98d4903
raft: clean up
2014-11-25 16:21:50 -08:00
Xiang Li
9bd1786fe4
raft: memory storage does not append out of date entries
2014-11-25 15:18:40 -08:00
Xiang Li
9df0e7715d
raft: do not panic on out of date compaction
2014-11-25 15:14:39 -08:00
Xiang Li
01cbcce8ba
etcdserver: do not applySnapshot twice
2014-11-25 14:53:49 -08:00
Yicheng Qin
7e6e305c4f
Merge branch 'log_interface'
...
Conflicts:
raft/raft.go
2014-11-25 14:22:11 -08:00
Yicheng Qin
4b43824be9
raft: not compact log if the compact index < first index of the log
...
It should ignore the compact operation instead of panic because the case that
the log is restored from snapshot before executing compact is reasonable.
2014-11-25 11:51:20 -08:00
Yicheng Qin
8aa89dba3d
raft: make if checking match the error in storage.Term
2014-11-25 00:52:13 -08:00
Yicheng Qin
8ee1bf31d6
raft: use IsEmptySnap to check the empty snapshot
2014-11-25 00:37:21 -08:00
Yicheng Qin
e466126510
raft: set snapshot to nil when it is saved
2014-11-25 00:30:22 -08:00
Yicheng Qin
e17bcd8932
raft: remove wont-fix TODO in ApplyConfChange
2014-11-25 00:10:44 -08:00
Yicheng Qin
85d0e2f130
raft: remove unused raftLog.isOutOfAppliedBounds
2014-11-25 00:07:55 -08:00
Yicheng Qin
1e0f87df8c
raft: stricter checking in raftLog.slice
2014-11-25 00:05:00 -08:00
Yicheng Qin
1d01c8aa2d
raft: remove unused raftLog.at function
2014-11-24 23:52:28 -08:00
Yicheng Qin
2c06a1d815
raft: not set applied when restore log from snapshot
...
applied is only updated by application level through Advance.
2014-11-24 23:37:47 -08:00
Yicheng Qin
0d200baf72
raft: refine raftLog.term
2014-11-24 23:27:57 -08:00
Yicheng Qin
7fcaca6d18
raft: simplify raftLog.lastIndex
2014-11-24 23:08:51 -08:00
Yicheng Qin
8670f4012b
raft: remove useless line in raftLog.append
2014-11-24 22:42:55 -08:00