Skip to content

Commit

Permalink
roachpb: improve comments on the write_too_old field
Browse files Browse the repository at this point in the history
Explain that it's about the quality of the serializability error that
is produced.

Release note: None
  • Loading branch information
andreimatei committed Jan 15, 2020
1 parent 1edb0d5 commit 5e5b0c4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 44 deletions.
67 changes: 33 additions & 34 deletions pkg/roachpb/data.pb.go

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

19 changes: 9 additions & 10 deletions pkg/roachpb/data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -448,17 +448,16 @@ message Transaction {
// If set, a write performed by the transaction could not be performed at the
// transaction's write timestamp because a newer value was present. Had our
// write been performed, it would have overwritten the other value even though
// that value might not have been read by a previous read in the transaction.
// Thus, this flag indicates that, if the key in question had been read
// previously by the transaction, a refresh of the transaction's read span
// will surely fail. As of Dec 2019, the client does not take advantage of
// this flag to avoid hopeless refreshes.
// Note that this flag is not set when a write runs into the write timestamp
// cache (indicating a more recent DeleteRange that did not actually delete
// the respective key. In this case, a there's no reason to think that a
// refresh will not succeed.
//
// that value might not have been read by a previous read in the transaction
// (i.e. lost update anomaly).
// When this flag is set, the transaction's write timestamp is also bumped.
// The flag is used, though, to return a more specific error to the client
// instead of TransactionRetryError(RETRY_SERIALIZABLE).
//
// As explained above, this flag indicates that, if the key in question had
// been read previously by the transaction, a refresh of the transaction's
// read span will surely fail. The client does not currently take advantage of
// this flag to avoid hopeless refreshes, though.
//
// Historically, this field was also important for SNAPSHOT transactions which
// could commit in other situations when the write timestamp is bumped, but
Expand Down

0 comments on commit 5e5b0c4

Please sign in to comment.