Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: undo quota acquisition on failed proposals #17856

Merged
merged 1 commit into from
Aug 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/storage/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -2592,9 +2592,6 @@ func (r *Replica) tryExecuteWriteBatch(
log.Event(ctx, "applied timestamp cache")

ch, tryAbandon, undoQuotaAcquisition, pErr := r.propose(ctx, lease, ba, endCmds, spans)
if pErr != nil {
return nil, pErr, proposalNoRetry
}
defer func() {
// NB: We may be double free-ing here, consider the following cases:
// - The request was evaluated and the command resulted in an error, but a
Expand All @@ -2605,6 +2602,9 @@ func (r *Replica) tryExecuteWriteBatch(
undoQuotaAcquisition()
}
}()
if pErr != nil {
return nil, pErr, proposalNoRetry
}

// After the command is proposed to Raft, invoking endCmds.done is now the
// responsibility of processRaftCommand.
Expand Down