diff --git a/Gopkg.lock b/Gopkg.lock index fd0b18ffe92d..5d8a65ff7edd 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -198,7 +198,7 @@ branch = "master" name = "github.com/coreos/etcd" packages = ["raft","raft/raftpb"] - revision = "1e488f3548f3c952b9896b9279674420657d7f56" + revision = "ce0ad377d21819592c3d8c29417d9d7a5ac53f2f" [[projects]] name = "github.com/cpuguy83/go-md2man" diff --git a/pkg/storage/replica.go b/pkg/storage/replica.go index 4246d45431f0..e3e9dc3c158d 100644 --- a/pkg/storage/replica.go +++ b/pkg/storage/replica.go @@ -3098,7 +3098,12 @@ func (r *Replica) propose( } } - if err := r.submitProposalLocked(proposal); err != nil { + if err := r.submitProposalLocked(proposal); err == raft.ErrProposalDropped { + // Silently ignore dropped proposals (they were always silently ignored + // prior to the introduction of ErrProposalDropped). + // TODO(bdarnell): Handle ErrProposalDropped better. + // https://github.com/cockroachdb/cockroach/issues/21849 + } else if err != nil { delete(r.mu.proposals, proposal.idKey) return nil, nil, undoQuotaAcquisition, roachpb.NewError(err) } @@ -3291,8 +3296,16 @@ func (r *Replica) stepRaftGroup(req *RaftMessageRequest) error { // other replica is not quiesced, so we don't need to wake the leader. r.unquiesceLocked() r.refreshLastUpdateTimeForReplicaLocked(req.FromReplica.ReplicaID) - return false, /* unquiesceAndWakeLeader */ - raftGroup.Step(req.Message) + err := raftGroup.Step(req.Message) + if err == raft.ErrProposalDropped { + // A proposal was forwarded to this replica but we couldn't propose it. + // Swallow the error since we don't have an effective way of signaling + // this to the sender. + // TODO(bdarnell): Handle ErrProposalDropped better. + // https://github.com/cockroachdb/cockroach/issues/21849 + err = nil + } + return false /* unquiesceAndWakeLeader */, err }) } @@ -4175,7 +4188,10 @@ func (r *Replica) refreshProposalsLocked(refreshAtDelta int, reason refreshRaftR sort.Sort(reproposals) for _, p := range reproposals { log.Eventf(p.ctx, "re-submitting command %x to Raft: %s", p.idKey, reason) - if err := r.submitProposalLocked(p); err != nil { + if err := r.submitProposalLocked(p); err == raft.ErrProposalDropped { + // TODO(bdarnell): Handle ErrProposalDropped better. + // https://github.com/cockroachdb/cockroach/issues/21849 + } else if err != nil { delete(r.mu.proposals, p.idKey) p.finishRaftApplication(proposalResult{Err: roachpb.NewError(err), ProposalRetry: proposalErrorReproposing}) } diff --git a/vendor b/vendor index 3cf34fb0b0df..1fb3eecf3ee8 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 3cf34fb0b0df3b14773fb7f374e779996973ddf3 +Subproject commit 1fb3eecf3ee812eafd14b224ed1cfce284494986