cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

kv: pass explicit Now timestamp on BatchRequest, remove timestamp downcasting

Open nvb opened this issue 3 years ago • 2 comments

First commit from #76233.

This commit adds an explicit ClockTimestamp field called Now to the BatchRequest header, which mirrors the Now field on the BatchResponse header.

In doing so, it removes the last instance where we downcasted a Timestamp to a ClockTimestamp using the TryToClockTimestamp method. With this change, MVCC ("operation") timestamps never flow back into HLC clocks as clock signals. This was enabled by #80706 and sets the groundwork to remove synthetic timestamps in v23.1 — the role they played in dynamic typing of clock timestamps is now entirely fulfilled by statically typed ClockTimestamp channels.

This is an important step in separating out the MVCC timestamp domain from the clock timestamp domain and clarifying the roles of the two layers. In turn, this layering opens the door for CockroachDB to start thinking about dynamic clock synchronization error bounds.

nvb avatar Aug 08 '22 18:08 nvb

This change is Reviewable

cockroach-teamcity avatar Aug 08 '22 18:08 cockroach-teamcity

TFTR!

Was this implicitly an approval for https://github.com/cockroachdb/cockroach/pull/76233 as well, or does that still need another look?

nvb avatar Aug 10 '22 16:08 nvb

TFTR!

bors r+

nvb avatar Aug 11 '22 19:08 nvb

Build failed (retrying...):

craig[bot] avatar Aug 11 '22 21:08 craig[bot]

Build failed (retrying...):

craig[bot] avatar Aug 12 '22 00:08 craig[bot]

bors r-

This seems to be causing issues in bors. CI was all green until the last rebase, so something might be up.

nvb avatar Aug 12 '22 00:08 nvb

Canceled.

craig[bot] avatar Aug 12 '22 00:08 craig[bot]

I think it might have skewed with https://github.com/cockroachdb/cockroach/pull/83213. The benchmark (BenchmarkMVCCGCWithForegroundTraffic) added in that PR now seems to be failing.

nvb avatar Aug 12 '22 00:08 nvb

bors r+

nvb avatar Aug 12 '22 03:08 nvb

Build failed (retrying...):

craig[bot] avatar Aug 12 '22 04:08 craig[bot]

Build succeeded:

craig[bot] avatar Aug 12 '22 08:08 craig[bot]