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: restore synthetic timestamp handling in MVCCValue.GetLocalTimestamp #107195

Merged
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
11 changes: 11 additions & 0 deletions pkg/storage/mvcc_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ func (v MVCCValue) LocalTimestampNeeded(keyTS hlc.Timestamp) bool {
// provided key version timestamp and returned.
func (v MVCCValue) GetLocalTimestamp(keyTS hlc.Timestamp) hlc.ClockTimestamp {
if v.LocalTimestamp.IsEmpty() {
if keyTS.Synthetic {
// A synthetic version timestamp means that the version timestamp is
// disconnected from real time and did not come from an HLC clock on the
// leaseholder that wrote the value or from somewhere else in the system.
// As a result, the version timestamp cannot be cast to a clock timestamp,
// so we return min_clock_timestamp instead. The effect of this is that
// observed timestamps can not be used to avoid uncertainty retries for
// values without a local timestamp and with a synthetic version
// timestamp.
return hlc.MinClockTimestamp
}
return hlc.ClockTimestamp(keyTS)
}
return v.LocalTimestamp
Expand Down