Skip to content

Commit

Permalink
kvserver: document replica lifecycle
Browse files Browse the repository at this point in the history
Part of the research for cockroachdb#72374, which in turn was inspired by cockroachdb#38322.

Release note: None
  • Loading branch information
tbg committed Nov 15, 2021
1 parent db2d016 commit 25182d3
Show file tree
Hide file tree
Showing 3 changed files with 315 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/kv/kvserver/replica_application_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,10 @@ func (b *replicaAppBatch) Stage(cmdI apply.Command) (apply.CheckedCommand, error
// Acquire the split or merge lock, if necessary. If a split or merge
// command was rejected with a below-Raft forced error then its replicated
// result was just cleared and this will be a no-op.
//
// TODO(tbg): can't this happen in splitPreApply which is called from
// b.runPreApplyTriggersAfterStagingWriteBatch and similar for merges? That
// way, it would become less of a one-off.
if splitMergeUnlock, err := b.r.maybeAcquireSplitMergeLock(ctx, cmd.raftCmd); err != nil {
var err error
if cmd.raftCmd.ReplicatedEvalResult.Split != nil {
Expand Down
Loading

0 comments on commit 25182d3

Please sign in to comment.