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

[YSQL] Pick global limit as soon as the query arrives at the YSQL backend process. #21961

Open
1 task done
pao214 opened this issue Apr 13, 2024 · 0 comments
Open
1 task done
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@pao214
Copy link
Contributor

pao214 commented Apr 13, 2024

Jira Link: DB-10877

Description

Motivation

YB uses the notion of a global limit to ensure that it does not miss any recent updates that may have a higher commit ts because of the clock skew.

YSQL raises a read restart error as long as it sees any updates within its read ts and global limit.

There are a few ways to reduce the chance of raising a read restart.

  1. Increase the read snapshot time.
    Downside: Longer wait times.
  2. Reduce global limit.
    Point of this ticket.
  3. Establish causal ordering between events.
    Not the point of this ticket. Best discussed separately.
    Example: local_limit.

Proposal

  • Pick global limit as soon as the query reaches YSQL backend.
  • Look into doing this even before the control goes to the connection manager. Out of scope at the moment.
  • The query layer is not part of the hybrid time propagation but this should not dissuade us since we wish to pick global limit based on the physical time and not hybrid time.

Add Basic Tests

As part of this task, we also want to ensure that we do not increase global time unnecessarily.

  • Ensure YB picks physical time for global time (and not the physical part of the hybrid time).
  • Ensure YB retains the global/local limits picked on txn restarts and stmt restarts (both read restarts and conflict/deadlock restarts).
  • Verify whether we need global_limit to be higher than read ts.

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Status: Pending
Development

No branches or pull requests

2 participants