feat: batch TSO requests and low-resolution timestamp cache (#420) - #538
Merged
Conversation
s2x
force-pushed
the
fix/420-batch-tso-low-res-cache
branch
from
September 9, 2026 18:29
10e9732 to
81fa04c
Compare
…mestamp is the highest of the grant (#420)
s2x
marked this pull request as ready for review
September 9, 2026 19:34
s2x
force-pushed
the
fix/420-batch-tso-low-res-cache
branch
from
September 9, 2026 19:34
f792f0c to
b9f8f3b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #420
Batch TSO requests and add a low-resolution timestamp cache, cutting PD round trips on hot paths.
Changes
PdClientInterface::getTimestampBatch(int $count)requests up to$counttimestamps in a singleTsoRPC; grants are handed out as consecutive values with correct 18-bit logical wrap, never exceeding the granted count.PdClientInterface::getLowResolutionTimestamp()serves a timestamp cached for at mostlowResTimestampMaxStalenessMs(default unset = fresh RPC per call, behaviour unchanged); negative clock age is treated as stale.CheckTxnStatus.current_ts) uses the low-resolution timestamp; start/commit timestamps never do.pessimisticLockBatch()acquires onefor_update_tsper locking pass instead of one per region, saving one PD round trip per additional locked region.for_update_tsand spends only one TSO call.Changelog
Code Review