Skip to content

Commit

Permalink
Merge #30041
Browse files Browse the repository at this point in the history
30041: roachpb: add TODO to remove needsRefresh from InitPutRequest r=nvanbenschoten a=nvanbenschoten

As of #27302, a successful `InitPut` always leaves an intent. Because of this,
we can remove its `needsRefresh` flag. However, we can't do so until v2.2.

Release note: None

Co-authored-by: Nathan VanBenschoten <[email protected]>
  • Loading branch information
craig[bot] and nvanbenschoten committed Sep 11, 2018
2 parents bcf150d + e79800b commit 778586d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/roachpb/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,10 +956,14 @@ func (*ConditionalPutRequest) flags() int {

// InitPut, like ConditionalPut, effectively reads and may not write.
// It also may return the actual data read on ConditionFailedErrors,
// so must update the timestamp cache on errors. Unlike CPut, InitPuts
// require a refresh because they may execute successfully without
// leaving an intent (i.e., when the existing value is equal to the
// proposed value).
// so must update the timestamp cache on errors.
//
// Unlike CPut, InitPuts require a refresh because they may execute
// successfully without leaving an intent (i.e., when the existing
// value is equal to the proposed value).
// TODO(nvanbenschoten): As of #27302, this is no longer true. We
// can remove needsRefresh in v2.2, at which point no node in a
// cluster can be running a binary without the referenced change.
func (*InitPutRequest) flags() int {
return isRead | isWrite | isTxn | isTxnWrite | updatesReadTSCache | updatesTSCacheOnError | needsRefresh | consultsTSCache
}
Expand Down

0 comments on commit 778586d

Please sign in to comment.