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

[dist-txns] Read time for single-tablet transactions should be picked on the tablet server if possible #655

Closed
mbautin opened this issue Dec 12, 2018 · 0 comments
Assignees
Labels
kind/enhancement This is an enhancement of an existing feature

Comments

@mbautin
Copy link
Contributor

mbautin commented Dec 12, 2018

For transactional read operations that only touch one tablet, currently we pick the read hybrid time on the tablet server hosting the YQL engine processing a transaction (i.e. the tablet server that has the transaction manager for this transaction). However, this tablet server might be different from the leader of the tablet that has the data to be read (the transaction participant). If there is also a clock skew, and if the transaction manager's hybrid time is in the future compared to the transaction participant, we will be waiting for the safe time on the transaction participant to reach the read timestamp picked by the transaction manager. To mitigate a potential latency on these single-tablet read-only workloads, we need to defer the choice of the read timestamp to the transaction participant in these cases.

Cc @robertpang @spolitov

@kmuthukk kmuthukk added the kind/enhancement This is an enhancement of an existing feature label Dec 12, 2018
@kmuthukk kmuthukk changed the title Read time for single-tablet transactions should be picked on the tablet server if possible [dist-txns] Read time for single-tablet transactions should be picked on the tablet server if possible Dec 12, 2018
yugabyte-ci pushed a commit that referenced this issue Mar 25, 2019
…ible

Summary:
We could delay picking transaction read time for a Snapshot Isolation transaction until the start of first
operation in that transaction. And if this first operation is single tablet, we could pick the read time at
tablet server, not on the YQL proxy side (YCQL or YSQL).  Moreover, we could perform a read restart
at this tablet server, if necessary, and use the restarted time as read time of the whole transaction.

Also removed start_time from transaction metadata, since it is the same as read time. Instead, added
a new field metadata_write_ht to transaction metadata persisted in the provisional records RocksDB
on every participating tablet, that is only used for compaction-time cleanup of aborted transactions.

Test Plan: ybd --cxx-test ql-transaction-test --gtest_filter QLTransactionTest.PickReadTimeAtServer

Reviewers: timur, robert, mikhail

Reviewed By: mikhail

Subscribers: bharat, ybase, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D6305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement This is an enhancement of an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants