628 Commits

Author SHA1 Message Date
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
Yicheng Qin
239c8dd479 raft: add comment to newLog 2014-11-24 21:47:12 -08:00
Xiang Li
9455119968 raft: always check leader changes in node run loop 2014-11-24 19:07:10 -08:00
Xiang Li
65ad1f6ffd raft: attach Index to Entry in all tests 2014-11-24 17:13:47 -08:00
Xiang Li
10ebf1a335 raft: fix memoryStorage append 2014-11-24 16:36:59 -08:00
Xiang Li
2876c652ab raft: fix for go vet 2014-11-24 15:00:38 -08:00
Xiang Li
62a8df304a raft: fix error message in TestLogRestore 2014-11-24 11:10:02 -08:00
Xiang Li
e8afdcfe0a raft: refactor testUnstableEnts 2014-11-24 10:40:38 -08:00
Xiang Li
3dd4c458ca raft: refactor term in log.go 2014-11-24 10:13:56 -08:00
Xiang Li
94190286ff raft: add comment for append in unstableEntries in log.go 2014-11-24 09:05:40 -08:00
Xiang Li
0a46c70f5d raft: use empty slice in unstableEntries in log.go 2014-11-24 09:04:45 -08:00
Xiang Li
bc0e72acb9 raft: clean up panic in log.go 2014-11-24 09:01:25 -08:00