Skip to content

Commit

Permalink
build: Update etcd
Browse files Browse the repository at this point in the history
This picks up some changes to prevote (etcd-io/etcd#8525 and
etcd-io/etcd#9204), as well as a new ErrProposalDropped that we're not
yet using.

Release note: None
  • Loading branch information
bdarnell committed Jan 28, 2018
1 parent 54550b6 commit a8c854d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 20 additions & 4 deletions pkg/storage/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
})
}

Expand Down Expand Up @@ -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})
}
Expand Down
2 changes: 1 addition & 1 deletion vendor
Submodule vendor updated 314 files

0 comments on commit a8c854d

Please sign in to comment.