Skip to content

Commit

Permalink
storage: add comment on readOnlyCmdMu
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
tbg committed Dec 14, 2018
1 parent df26cf6 commit 2e3af6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/storage/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ type Replica struct {
// Held in read mode during read-only commands. Held in exclusive mode to
// prevent read-only commands from executing. Acquired before the embedded
// RWMutex.
//
// This mutex ensures proper interleaving of splits with concurrent reads.
// Splits register an MVCC write span latch, but reads at lower timestamps
// aren't held up by this latch, which could result in reads on the RHS
// executed through the LHS after this is valid. For more detail, see:
// https://github.com/cockroachdb/cockroach/issues/32583.
readOnlyCmdMu syncutil.RWMutex

// rangeStr is a string representation of a RangeDescriptor that can be
Expand Down

0 comments on commit 2e3af6b

Please sign in to comment.