This PR sets etcd version and min cluster version in request header,
and let server check version compatibility. rafthttp server
will reject any message from peer with incompatible version(too low
version or too high version), and print out warning logs.
The call to transport.RoundTrip closes the request body regardless of
the value of request.Closed. This causes subsequent calls to RoundTrip
using the same request body to fail.
Fixes#2895
This PR set maxIdleConnsPerHost to 128 to let proxy handle 128 concurrent
requests in long term smoothly.
If the number of concurrent requests is bigger than this value,
proxy needs to create one new connection when handling each request in
the delta, which is bad because the creation consumes resource and may
eat up your ephemeral port.
Godeps should allow me to do
godep restore
godep save -r ./...
But that doesn't work. Try it.
This requires update to the following packages:
github.com/prometheus/client_golang/
github.com/prometheus/procfs
github.com/matttproud/golang_protobuf_extensions/
There were 2 major problems.
1. godeps have code.google.com/p/goprotobuf but that repo doesn't exist
2. prometheus/client_golang/_vendor moved to other packages and godep
(with -r) can't handle it.
At the end of this we should be able to use godeps again without tons of
black magic. uggh. what a pain in the ass.
The black magic to actually get godeps back in shape was:
```bash
# remove code.google.com/p/goprotobuf (doesn't exist)
# remove all _vendor lines from prometheus (we still have other
# prometheus lines so restore still works)
vi Godeps/Godeps.json
# remove all the crazy vendoring crud because godep doesn't handle it
# correctly
find . -name \*.go | xargs sed -i
's|github.com/coreos/etcd/Godeps/_workspace/src/||'
# ok now, restore as best we can (everything except it wines about
# goprotobuf
godep restore
# now update the packages which were using the old (dead) goprotobuf
go get -u github.com/prometheus/client_golang/
go get -u github.com/matttproud/golang_protobuf_extensions/
# update prometheus procfs because prometheus/client_golang/ has a
# dependancy on this update
go get -u github.com/prometheus/procfs
# get rid of Godeps directory entirely
git rm -rf Godeps
# ok, now, rewrite the Godeps directory and redo the path rewrites
godep save -r ./...
# now put Godeps back into git
git add Godeps/
# commit the new code
git commit -aA
# And now, you can use godeps!
godep restore
godep save -r ./...
git diff
# nothing!!
```
The commit > unstable might not true for follower. The leader only need
to ensure the entry is stored on the majority of nodes to commit an
entry. So the minority of the cluster might receive commit > unstable
append request. This is normal.
raft node should set initial prev hard state to empty.
Or it will not send the first hard coded state to application
until the state changes again.
This commit fixs the issue. It introduce a small overhead, that
the same tate might send to application twice when restarting.
But this is fine.
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.
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.