Bumps Raft library. (#3201)

This picks up the fix for https://github.com/hashicorp/raft/issues/212,
which can cause out-of-date followers to get stuck in a loop trying to
sync because they don't discard old snapshot data.

There's some incidental reordering of the vendor.json since the last
update to that file was merged by hand.
This commit is contained in:
James Phillips 2017-06-27 18:41:00 -07:00 committed by GitHub
parent 793fda1101
commit 4d0aa9b82a
3 changed files with 13 additions and 10 deletions

View File

@ -4,7 +4,7 @@ test:
go test -timeout=60s ./... go test -timeout=60s ./...
integ: test integ: test
INTEG_TESTS=yes go test -timeout=5s -run=Integ ./... INTEG_TESTS=yes go test -timeout=25s -run=Integ ./...
deps: deps:
go get -d -v ./... go get -d -v ./...

View File

@ -5,6 +5,7 @@ import (
"container/list" "container/list"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"time" "time"
"github.com/armon/go-metrics" "github.com/armon/go-metrics"
@ -1238,6 +1239,7 @@ func (r *Raft) installSnapshot(rpc RPC, req *InstallSnapshotRequest) {
} }
var rpcErr error var rpcErr error
defer func() { defer func() {
io.Copy(ioutil.Discard, rpc.Reader) // ensure we always consume all the snapshot data from the stream [see issue #212]
rpc.Respond(resp, rpcErr) rpc.Respond(resp, rpcErr)
}() }()
@ -1250,6 +1252,7 @@ func (r *Raft) installSnapshot(rpc RPC, req *InstallSnapshotRequest) {
// Ignore an older term // Ignore an older term
if req.Term < r.getCurrentTerm() { if req.Term < r.getCurrentTerm() {
r.logger.Printf("[INFO] raft: Ignoring installSnapshot request with older term of %d vs currentTerm %d", req.Term, r.getCurrentTerm())
return return
} }

18
vendor/vendor.json vendored
View File

@ -467,18 +467,18 @@
"revision": "8ee79997227bf9b34611aee7946ae64735e6fd93", "revision": "8ee79997227bf9b34611aee7946ae64735e6fd93",
"revisionTime": "2016-11-17T03:31:26Z" "revisionTime": "2016-11-17T03:31:26Z"
}, },
{
"checksumSHA1": "V/53BpqgOkSDZCX6snQCAkdO2fM=",
"path": "github.com/googleapis/gax-go",
"revision": "da06d194a00e19ce00d9011a13931c3f6f6887c7",
"revisionTime": "2016-11-07T00:24:06Z"
},
{ {
"checksumSHA1": "PFtXkXPO7pwRtykVUUXtc07wc7U=", "checksumSHA1": "PFtXkXPO7pwRtykVUUXtc07wc7U=",
"path": "github.com/google/gofuzz", "path": "github.com/google/gofuzz",
"revision": "24818f796faf91cd76ec7bddd72458fbced7a6c1", "revision": "24818f796faf91cd76ec7bddd72458fbced7a6c1",
"revisionTime": "2017-06-12T17:47:53Z" "revisionTime": "2017-06-12T17:47:53Z"
}, },
{
"checksumSHA1": "V/53BpqgOkSDZCX6snQCAkdO2fM=",
"path": "github.com/googleapis/gax-go",
"revision": "da06d194a00e19ce00d9011a13931c3f6f6887c7",
"revisionTime": "2016-11-07T00:24:06Z"
},
{ {
"checksumSHA1": "cdOCt0Yb+hdErz8NAQqayxPmRsY=", "checksumSHA1": "cdOCt0Yb+hdErz8NAQqayxPmRsY=",
"path": "github.com/hashicorp/errwrap", "path": "github.com/hashicorp/errwrap",
@ -660,10 +660,10 @@
"revisionTime": "2015-11-16T02:03:38Z" "revisionTime": "2015-11-16T02:03:38Z"
}, },
{ {
"checksumSHA1": "8Na6qG9taUXHDunMYecGxbHbJKE=", "checksumSHA1": "bYn+HDmt7YLFvEV6DagMup8mkZE=",
"path": "github.com/hashicorp/raft", "path": "github.com/hashicorp/raft",
"revision": "939ebd2103731c2f38c7964d8dd24af0e1b26dc3", "revision": "e5e581e04af7c46974b99195347cc0c380c0d841",
"revisionTime": "2017-05-04T20:16:11Z", "revisionTime": "2017-06-09T23:09:26Z",
"version": "library-v2-stage-one", "version": "library-v2-stage-one",
"versionExact": "library-v2-stage-one" "versionExact": "library-v2-stage-one"
}, },