*: support returning commit ts for Get / BatchGet / Coprocessor#19230
*: support returning commit ts for Get / BatchGet / Coprocessor#19230ti-chi-bot[bot] merged 3 commits intotikv:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for returning commit timestamps with Get/BatchGet/Coprocessor operations, enabling TiDB to retrieve both values and their commit timestamps in a single request. This is a cherry-pick of PRs #19103 and #19166 to resolve issue #19102.
Key changes:
- Introduces
ValueEntryandKvPairEntrytypes to carry both values and optional commit timestamps - Adds
load_commit_tsparameters throughout the storage stack to control commit timestamp loading - Updates Get/BatchGet RPC handlers to return commit timestamps when
need_commit_tsis set - Adds support for
_tidb_commit_tsvirtual column in TableScan coprocessor requests
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| components/txn_types/src/types.rs | Defines new ValueEntry and KvPairEntry types to encapsulate values with optional commit timestamps |
| src/storage/txn/store.rs | Extends Store trait with get_entry and incremental_get_entry methods, updates batch_get and scanner signatures to support commit timestamp loading |
| src/storage/mvcc/reader/point_getter.rs | Adds get_entry method and updates lock handling to skip access_locks when commit_ts is required |
| src/storage/mvcc/reader/scanner/forward.rs | Updates LatestKvPolicy to return ValueEntry and load commit timestamps from write CF keys |
| src/storage/mvcc/reader/scanner/backward.rs | Updates BackwardKvScanner to track and return commit timestamps with values |
| src/storage/mod.rs | Adds get_entry method that wraps existing get to support commit timestamp loading |
| src/server/service/kv.rs | Updates Get and BatchGet RPC handlers to check need_commit_ts flag and populate response commit timestamps |
| src/storage/errors.rs | Adds map_kv_pair_entries function and updates mapping logic to handle commit timestamps in responses |
| components/tidb_query_executors/src/table_scan_executor.rs | Implements support for _tidb_commit_ts virtual column in table scans |
| components/tidb_query_datatype/src/codec/table.rs | Defines EXTRA_COMMIT_TS_COL_ID constant for the commit timestamp virtual column |
| components/tidb_query_common/src/storage/mod.rs | Adds OwnedKvPairEntry struct and updates Storage trait with commit timestamp support |
| components/api_version/src/keyspace.rs | Renames KvPair trait to KvPairEntry and adds commit_ts support |
| tests/integrations/server/kv_service.rs | Adds comprehensive tests for Get and BatchGet with commit timestamp support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
60c818c to
63d59de
Compare
|
/hold wait for cargo-deny fix |
63d59de to
81a67e8
Compare
…kv#19103) close tikv#19102 The Get / BatchGet will return the commit_ts for each value if `need_commit_ts` is specified. Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
…ocessor request (tikv#19166) close pingcap/tidb#64949 coprocessor: support return _tidb_commit_ts column for TableScan coprocessor request Signed-off-by: tiancaiamao <tiancaiamao@gmail.com>
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
81a67e8 to
e6ddae0
Compare
|
/unhold |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, ekexium The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…#19230) close tikv#19102, ref pingcap/tidb#64949 - The Get / BatchGet will return the commit_ts for each value if `need_commit_ts` is specified. - coprocessor: support return _tidb_commit_ts column for TableScan coprocessor request Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> Signed-off-by: tiancaiamao <tiancaiamao@gmail.com> Co-authored-by: tiancaiamao <tiancaiamao@gmail.com>
…#19230) (tikv#19295) close tikv#19312 support returning commit ts for Get / BatchGet / Coprocessor Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> Signed-off-by: tiancaiamao <tiancaiamao@gmail.com> Co-authored-by: tiancaiamao <tiancaiamao@gmail.com>
…#19230) (tikv#19295) close tikv#19312 support returning commit ts for Get / BatchGet / Coprocessor Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> Signed-off-by: tiancaiamao <tiancaiamao@gmail.com> Co-authored-by: tiancaiamao <tiancaiamao@gmail.com> Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
…#19230) (tikv#19295) close tikv#19312 support returning commit ts for Get / BatchGet / Coprocessor Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> Signed-off-by: tiancaiamao <tiancaiamao@gmail.com> Co-authored-by: tiancaiamao <tiancaiamao@gmail.com> Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
This is a cherry-pick to support returning the commit ts for Get / BatchGet / Coprocessor
cherry pick the following PRs:
What is changed and how it works?
Issue Number: Close #19102
ref pingcap/tidb#64949
What's Changed:
Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note