Skip to content

sql: permit non-synthetic future time AOST queries#117098

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/sqlFutureTs
Dec 27, 2023
Merged

sql: permit non-synthetic future time AOST queries#117098
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/sqlFutureTs

Conversation

@nvb
Copy link
Copy Markdown
Contributor

@nvb nvb commented Dec 27, 2023

Informs #101938.

This commit removes the restriction that future-time AOST queries must use "synthetic" timestamps. This restriction was introduced back when it was unsafe for requests to operate at future timestamps unless they were marked as synthetic. This is no longer the case. It is important that we allow this, because future-time queries can issue subqueries with AOST timestamps (e.g. for SQL leasing with the "count-leases" internal executor use).

Requests that are too far in the future will still be rejected during range lease checks. For details, see Replica.checkRequestTimeRLocked.

Release note: None

@nvb nvb requested a review from rafiss December 27, 2023 02:19
@nvb nvb requested review from a team as code owners December 27, 2023 02:19
@nvb nvb requested review from michae2 and miretskiy and removed request for a team December 27, 2023 02:19
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Informs cockroachdb#101938.

This commit removes the restriction that future-time AOST queries must
use "synthetic" timestamps. This restriction was introduced back when it
was unsafe for requests to operate at future timestamps unless they were
marked as synthetic. This is no longer the case. It is important that we
allow this, because future-time queries can issue subqueries with AOST
timestamps (e.g. for SQL leasing with the "count-leases" internal
executor use).

Requests that are too far in the future will still be rejected during
range lease checks. For details, see `Replica.checkRequestTimeRLocked`.

Release note: None
@nvb nvb force-pushed the nvanbenschoten/sqlFutureTs branch from 28d6800 to f719e85 Compare December 27, 2023 03:21
@nvb nvb requested a review from a team as a code owner December 27, 2023 03:21
Copy link
Copy Markdown
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: TIL about synthetic timestamps.

Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @rafiss)

@nvb
Copy link
Copy Markdown
Contributor Author

nvb commented Dec 27, 2023

TFTR!

bors r=michae2

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 27, 2023

Build succeeded:

@craig craig bot merged commit 3325d32 into cockroachdb:master Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants