19 Commits

Author SHA1 Message Date
Yicheng Qin
19fc1a7137 rafthttp: update streamReader term in time
Because etcd 2.1 will build stream to any existing peers and etcd 2.0
requires the remote to provide most updated term, it is
necessary for streamReader to know the latest term.
2015-05-26 14:52:42 -07:00
Yicheng Qin
38b8e848ac rafthttp: try stream msgappV1 handler if msgappV2 is unsupported
This helps etcd 2.1 connect to msgappV1 handler when the remote member
doesn't support msgappV2. And it doesn't print out unsupported handler
error to make log clean.
2015-05-26 14:52:41 -07:00
Yicheng Qin
1c1cccd236 rafthttp: stop etcd if it is found removed when stream dial
The original process is stopping etcd only when pipeline message finds itself
has been removed. After this PR, stream dial has this functionality too.
It helps fast etcd stop, which doesn't need to wait for stream break to
fall back to pipeline, and wait for election timeout to send out message
to detect self removal.
2015-04-27 15:10:00 -07:00
Alex Crawford
d9ad6aa2a9 *: update to use IANA-assigned ports 2015-04-06 13:49:43 -07:00
Yicheng Qin
0d88e0d111 rafthttp: introduce msgappv2 stream format
msgappv2 stream is used to send all MsgApp, and replaces the
functionality of msgapp stream. Compared to v1, it has several
advantanges:
1. The output message is exactly the same with the input one, which
cannot be done in v1.
2. It uses one connection to stream persistently, which prevents message
reorder and saves the time to request stream.
3. It transmits 10 addiontional bytes in the procedure of committing one
proposal, which is trivia for idle time.
4. It transmits less bytes when committing mutliple proposals or keep
committing proposals.
2015-04-03 17:08:56 -07:00
Yicheng Qin
0fe9861197 rafthttp: support multiple peer urls 2015-03-04 15:00:07 -08:00
Yicheng Qin
81c67eed9c rafthttp: add functional tests 2015-03-02 14:22:20 -08:00
Yicheng Qin
fc2d7019e5 rafthttp: {nopProcessor, errProcessor} -> fakeRaft 2015-03-02 13:31:56 -08:00
Yicheng Qin
399e3cdf81 rafthttp: add stream http tests 2015-03-02 13:24:50 -08:00
Yicheng Qin
b4b9b9118a rafthttp: report MsgSnap status 2015-03-02 09:38:11 -08:00
Yicheng Qin
9b986fb4c1 rafthttp: report unreachable status of the peer
When it failed to send message to the remote peer, it reports unreachable
to raft.
2015-03-01 16:48:26 -08:00
Yicheng Qin
dee3001086 rafthttp: add back tests that commentted out 2015-02-28 11:35:16 -08:00
Yicheng Qin
1c5a507761 rafthttp: refactor peer and add general stream 2015-02-28 11:35:16 -08:00
Xiang Li
99840c9697 *: cleanup import 2015-02-28 10:12:35 -08:00
Jonathan Boulle
f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
Yicheng Qin
5bb8eeb5cf rafthttp: transport cleanup 2014-12-29 11:21:40 -08:00
Brian Waldon
9a728a127a dep: bump golang.org/x/net/context
Move from code.google.com/p/go.net/context to
golang.org/x/net/context before bumping to latest.
2014-11-20 10:19:12 -08:00
Yicheng Qin
04d416291a *: add rafthttp pkg into test list 2014-11-17 16:45:54 -08:00
Yicheng Qin
5dc5f8145c *: etcdhttp.raftHandler -> rafthttp.RaftHandler 2014-11-17 15:52:24 -08:00