-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Investigate why the first request picks a local limit only when the read time is not set. #22158
Closed
1 task done
Labels
Comments
pao214
added
area/ysql
Yugabyte SQL (YSQL)
status/awaiting-triage
Issue awaiting triage
labels
Apr 25, 2024
yugabyte-ci
added
kind/bug
This issue is a bug
priority/medium
Medium priority issue
labels
Apr 25, 2024
sushantrmishra
added
2024.1 Backport Required
2.20 Backport Required
and removed
status/awaiting-triage
Issue awaiting triage
labels
Jun 10, 2024
9 tasks
pao214
added a commit
that referenced
this issue
Jul 17, 2024
…s already set. Summary: ### Motivation Setting the local limit to current safe time will help prune writes that arrived after the read RPC arrived at a tablet. ### Impact For a thorough overview of when the read time is provided to DocDB see pg_read_time-test.cc. For a quick summary, the read time may be set before the read RPC arrives at a storage layer node when 1. This a fanout read such as a COUNT(*) query. 2. This is a multi-tablet read and the read time was already picked on some remote storage layer node. 3. This is a REPEATABLE READ transaction, and the read time has already been picked in a previous statement but we are scanning a different tablet. 4. Potentially other scenarios ... Jira: DB-11085 Test Plan: Jenkins ``` ./yb_build.sh --cxx-test pg_local_limit_optimization-test --gtest_filter PgLocalLimitOptimizationTest.SinglePageScan ./yb_build.sh --cxx-test pg_local_limit_optimization-test --gtest_filter PgLocalLimitOptimizationTest.ReadTimePickedOnLocalProxy ./yb_build.sh --cxx-test pg_local_limit_optimization-test --gtest_filter PgLocalLimitOptimizationTest.ReadTimePickedOnRemoteNode ./yb_build.sh --cxx-test pg_local_limit_optimization-test --gtest_filter PgLocalLimitOptimizationTest.ReadTimePickedBeforeTableScan ``` Backport-through: 2.20 Reviewers: pjain, sergei Reviewed By: pjain, sergei Subscribers: yql, ybase Differential Revision: https://phorge.dev.yugabyte.com/D34561
jasonyb
pushed a commit
that referenced
this issue
Jul 17, 2024
Summary: 0c8e378 [#23216]yugabyted: Adding required models for source db details and target recommendation details sub pages. 133ff1c [#23210] yugabyted: yugabyted collect_logs fails to gather logs when yugabyted is not running. 08ca9dd [#23196] DocDB: Handle preview flags in ValidateFlagValue 13c0ced [#23215] docdb: disable packed for colocated tables by default 6146084 [doc][ybm] Reorg to Aeon authentication pages (#23226) Excluded: 56d2d2d [#16408] YSQL: add gflag TEST_generate_ybrowid_sequentially c8e7530 [PLAT-14672] getSessionInfo should return a valid api token 3abd045 [#22594] YSQL: Fix flaky TestTransactionStatusTable.testCreation unit test d67ba12 [#22158] YSQL: Set local limit as safe time even when the read time is already set. 1315a10 [docs] PG compatible logical replication architecture (#23220) 88e92a0 [#23216] yugabyted: Adding a new field ObjectName to model SqlObjectMetadata. Test Plan: Jenkins: rebase: pg15-cherrypicks Reviewers: jason, tfoucher Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D36661
1 task
We do not plan to backport this change to avoid any unintentional changes in previous branches. Feel free to re-open if there is a valid use-case to backport. |
github-project-automation
bot
moved this from Backporting
to Done
in Wait-Queue Based Locking
Sep 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Jira Link: DB-11085
Description
Context
Read time is either picked on docdb
or it is provided to docdb
In the latter case, the local limit is set only for the second RPC to the tablet as part of the txn.
This is stated in c784595.
but no reason was given for why local limit is not used for the first request. Moreover, this claim is not even accurate when the read time is picked on the tablet.
Motivation
local limit is most useful when the original time of the scanned intent is higher than this limit. Then, we can skip checking the uncertainty window because we have just established a causal relation: the read operation happens before the provisional write op. Similar logic applies to fast path writes that bypass the provisional write mechanism.
This local limit logic should be independent of whether the read time is picked on the tablet or provided to the tablet.
NOTE: The local limit is still picked as safe time of the tablet and not provided to docdb. So, the causal relation still holds.
Scenario 1
The read clearly happened before the provisional write is raft-replicated. The operations are concurrent, implying no uncertainty.
Scenario 2
The read clearly happened before the write operation and there is no "real" uncertainty.
Objective
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: