Skip to content

Commit 06bcd2d

Browse files
authored
*: merge some basic enhancements to 8.5 to support get commit ts (#65871)
ref #64281, close #64537
1 parent c46c8a3 commit 06bcd2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+869
-442
lines changed

DEPS.bzl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5646,13 +5646,13 @@ def go_deps():
56465646
name = "com_github_pingcap_kvproto",
56475647
build_file_proto_mode = "disable_global",
56485648
importpath = "github.com/pingcap/kvproto",
5649-
sha256 = "f344381790869f7b6654340ec855ee2758abb0be9103d9e9146cad82f90b7d1f",
5650-
strip_prefix = "github.com/pingcap/[email protected]20251212013835-ed676560b3b4",
5649+
sha256 = "0dd85bbe1714b456b5840979ce6a90a71c1e8a84452f1768f13713c0b5be97f0",
5650+
strip_prefix = "github.com/pingcap/[email protected]20260119070026-e7016d9dbe90",
56515651
urls = [
5652-
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20251212013835-ed676560b3b4.zip",
5653-
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20251212013835-ed676560b3b4.zip",
5654-
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20251212013835-ed676560b3b4.zip",
5655-
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20251212013835-ed676560b3b4.zip",
5652+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20260119070026-e7016d9dbe90.zip",
5653+
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20260119070026-e7016d9dbe90.zip",
5654+
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20260119070026-e7016d9dbe90.zip",
5655+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20260119070026-e7016d9dbe90.zip",
56565656
],
56575657
)
56585658
go_repository(
@@ -6894,13 +6894,13 @@ def go_deps():
68946894
name = "com_github_tikv_client_go_v2",
68956895
build_file_proto_mode = "disable_global",
68966896
importpath = "github.com/tikv/client-go/v2",
6897-
sha256 = "6323c839daa22156b7bcd8e4ca23cfb729a7e6769c93c5379611ef539bd384e0",
6898-
strip_prefix = "github.com/tikv/client-go/[email protected].20260112052152-1d3c5ec76bf8",
6897+
sha256 = "f18823b53d8ed5407680b4539a5b85e20a27b7c7587b364df03b97b995bf76b7",
6898+
strip_prefix = "github.com/tikv/client-go/[email protected].20260128081005-bc0c2a6df45c",
68996899
urls = [
6900-
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260112052152-1d3c5ec76bf8.zip",
6901-
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260112052152-1d3c5ec76bf8.zip",
6902-
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260112052152-1d3c5ec76bf8.zip",
6903-
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260112052152-1d3c5ec76bf8.zip",
6900+
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260128081005-bc0c2a6df45c.zip",
6901+
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260128081005-bc0c2a6df45c.zip",
6902+
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260128081005-bc0c2a6df45c.zip",
6903+
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20260128081005-bc0c2a6df45c.zip",
69046904
],
69056905
)
69066906
go_repository(

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ require (
8787
github.com/pingcap/errors v0.11.5-0.20250523034308-74f78ae071ee
8888
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
8989
github.com/pingcap/fn v1.0.0
90-
github.com/pingcap/kvproto v0.0.0-20251212013835-ed676560b3b4
90+
github.com/pingcap/kvproto v0.0.0-20260119070026-e7016d9dbe90
9191
github.com/pingcap/log v1.1.1-0.20250917021125-19901e015dc9
9292
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
9393
github.com/pingcap/tidb/pkg/parser v0.0.0-20211011031125-9b13dc409c5e
@@ -110,7 +110,7 @@ require (
110110
github.com/stretchr/testify v1.10.0
111111
github.com/tdakkota/asciicheck v0.2.0
112112
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
113-
github.com/tikv/client-go/v2 v2.0.8-0.20260112052152-1d3c5ec76bf8
113+
github.com/tikv/client-go/v2 v2.0.8-0.20260128081005-bc0c2a6df45c
114114
github.com/tikv/pd/client v0.0.0-20251219084741-029eb6e7d5d0
115115
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
116116
github.com/twmb/murmur3 v1.1.6

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ github.com/pingcap/fn v1.0.0/go.mod h1:u9WZ1ZiOD1RpNhcI42RucFh/lBuzTu6rw88a+oF2Z
611611
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E=
612612
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
613613
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
614-
github.com/pingcap/kvproto v0.0.0-20251212013835-ed676560b3b4 h1:uXlwBh9XoxQVfzI9vDkY6X4AusnuQA3ei1SHJ0484h4=
615-
github.com/pingcap/kvproto v0.0.0-20251212013835-ed676560b3b4/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
614+
github.com/pingcap/kvproto v0.0.0-20260119070026-e7016d9dbe90 h1:gDtzZBHhu9jL7nlFhI6TLVnNl2p4aO0P+tlzp7t522o=
615+
github.com/pingcap/kvproto v0.0.0-20260119070026-e7016d9dbe90/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
616616
github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM=
617617
github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4=
618618
github.com/pingcap/log v1.1.1-0.20250917021125-19901e015dc9 h1:qG9BSvlWFEE5otQGamuWedx9LRm0nrHvsQRQiW8SxEs=
@@ -760,8 +760,8 @@ github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2 h1:mbAskLJ0oJf
760760
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU=
761761
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4=
762762
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM=
763-
github.com/tikv/client-go/v2 v2.0.8-0.20260112052152-1d3c5ec76bf8 h1:zXvmqjetn+Kvs7PL98PahiIp/IswDlT0G39p95OuSPg=
764-
github.com/tikv/client-go/v2 v2.0.8-0.20260112052152-1d3c5ec76bf8/go.mod h1:iVLG2tuDVyBd9BN6e9JNFtUeEQarvKN7pTcW+pb3nFw=
763+
github.com/tikv/client-go/v2 v2.0.8-0.20260128081005-bc0c2a6df45c h1:J1IvmFixVIpMKmOCegVg1iKZBbdTSEpg6JJ3+EBouUg=
764+
github.com/tikv/client-go/v2 v2.0.8-0.20260128081005-bc0c2a6df45c/go.mod h1:QTFGkElz5Rp7+poaUZqusJceL8ZjSFu/xMDUGhuScUg=
765765
github.com/tikv/pd/client v0.0.0-20251219084741-029eb6e7d5d0 h1:fguMZ4sSn/oLbUt+zDoNPd6+OE3Li4Rop2/3vFhu8lM=
766766
github.com/tikv/pd/client v0.0.0-20251219084741-029eb6e7d5d0/go.mod h1:X3T+jK+4bLbDKgupmzvVXuySnCNV4Lfdm/bL8TAw3ik=
767767
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=

pkg/ddl/column_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ func checkColumnKVExist(ctx sessionctx.Context, t table.Table, handle kv.Handle,
324324
}
325325
}()
326326
key := tablecodec.EncodeRecordKey(t.RecordPrefix(), handle)
327-
data, err := txn.Get(context.TODO(), key)
327+
data, err := kv.GetValue(context.TODO(), txn, key)
328328
if !isExist {
329329
if terror.ErrorEqual(err, kv.ErrNotExist) {
330330
return nil

pkg/ddl/index.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,7 @@ func (w *addIndexTxnWorker) batchCheckUniqueKey(txn kv.Transaction, idxRecords [
23922392
return nil
23932393
}
23942394

2395-
batchVals, err := txn.BatchGet(context.Background(), uniqueBatchKeys)
2395+
batchVals, err := kv.BatchGetValue(context.Background(), txn, uniqueBatchKeys)
23962396
if err != nil {
23972397
return errors.Trace(err)
23982398
}
@@ -3443,7 +3443,7 @@ func (w *cleanUpIndexWorker) BackfillData(_ context.Context, handleRange reorgBa
34433443
}
34443444

34453445
var found map[string][]byte
3446-
found, err = txn.BatchGet(ctx, globalIndexKeys)
3446+
found, err = kv.BatchGetValue(ctx, txn, globalIndexKeys)
34473447
if err != nil {
34483448
return errors.Trace(err)
34493449
}

pkg/ddl/index_merge_tmp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (w *mergeIndexWorker) batchCheckTemporaryUniqueKey(
4444
return nil
4545
}
4646

47-
batchVals, err := txn.BatchGet(context.Background(), w.originIdxKeys)
47+
batchVals, err := kv.BatchGetValue(context.Background(), txn, w.originIdxKeys)
4848
if err != nil {
4949
return errors.Trace(err)
5050
}

pkg/ddl/index_modify_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ func checkGlobalIndexRow(
941941
require.NoError(t, err)
942942
var value []byte
943943
if indexInfo.Unique {
944-
value, err = txn.Get(context.Background(), key)
944+
value, err = kv.GetValue(context.Background(), txn, key)
945945
} else {
946946
var iter kv.Iterator
947947
iter, err = txn.Iter(key, key.PrefixNext())
@@ -968,7 +968,7 @@ func checkGlobalIndexRow(
968968
require.NoError(t, err)
969969
h := kv.IntHandle(d.GetInt64())
970970
rowKey := tablecodec.EncodeRowKey(pid, h.Encoded())
971-
rowValue, err := txn.Get(context.Background(), rowKey)
971+
rowValue, err := kv.GetValue(context.Background(), txn, rowKey)
972972
require.NoError(t, err)
973973
rowValueDatums, err := tablecodec.DecodeRowToDatumMap(rowValue, tblColMap, time.UTC)
974974
require.NoError(t, err)

pkg/ddl/partition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3875,7 +3875,7 @@ func (w *reorgPartitionWorker) BackfillData(_ context.Context, handleRange reorg
38753875
for i := range w.rowRecords {
38763876
newKeys = append(newKeys, w.rowRecords[i].key)
38773877
}
3878-
found, err = txn.BatchGet(ctx, newKeys)
3878+
found, err = kv.BatchGetValue(ctx, txn, newKeys)
38793879
if err != nil {
38803880
return errors.Trace(err)
38813881
}

pkg/disttask/importinto/conflict_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ func (h *conflictIndexKVHandler) handleBufferedHandles(ctx context.Context) erro
324324
}
325325
for rowKey, val := range res {
326326
handle := rowKeys2Handle[rowKey]
327-
if err := h.encodeAndHandleRow(ctx, handle, val); err != nil {
327+
if err := h.encodeAndHandleRow(ctx, handle, val.Value); err != nil {
328328
return errors.Trace(err)
329329
}
330330
}

pkg/executor/admin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ func (e *RecoverIndexExec) batchMarkDup(txn kv.Transaction, rows []recoverRows)
468468
}
469469
}
470470

471-
values, err := txn.BatchGet(context.Background(), e.batchKeys)
471+
values, err := kv.BatchGetValue(context.Background(), txn, e.batchKeys)
472472
if err != nil {
473473
return err
474474
}
@@ -622,7 +622,7 @@ func (e *CleanupIndexExec) batchGetRecord(txn kv.Transaction) (map[string][]byte
622622
e.batchKeys = append(e.batchKeys, tablecodec.EncodeRecordKey(e.table.RecordPrefix(), h))
623623
return true
624624
})
625-
values, err := txn.BatchGet(context.Background(), e.batchKeys)
625+
values, err := kv.BatchGetValue(context.Background(), txn, e.batchKeys)
626626
if err != nil {
627627
return nil, err
628628
}

0 commit comments

Comments
 (0)