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

[DNM] comparing tidb-cse-7.5 and tidb-7.5 #1087

Open
wants to merge 52 commits into
base: tidb-7.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
17728c3
pd client: uprade and fit get region option (#1069)
CabinfeverB Dec 1, 2023
e6b78d8
resource_control: add ru details in ExecDetails (#1070)
glorv Dec 4, 2023
7b78e50
prefix safepoint kv with keyspace name (#928)
AmoebaProtozoa Aug 7, 2023
cfaa57f
increase large transaction preSplitSizeThreashold (#1059)
coocood Nov 15, 2023
7f5f1ce
support remote coprocessor (#808)
coocood May 29, 2023
fd0ff0f
fix encoding of mvcc get by key (#775)
iosmanthus Apr 20, 2023
08d217a
add const label for metrics (#781)
zeminzhou Apr 26, 2023
359672d
cse: decode batch cop task (#798)
iosmanthus May 12, 2023
4be5abd
Use a new way to create client for v2 (#806)
rleungx May 18, 2023
091227e
Count only one tiflash replica in disaggregated mode. (#805)
JinheLin May 22, 2023
1dc8a4d
Add get min ts implementation (#809)
rleungx May 23, 2023
ca50a26
fix strings import
iosmanthus Dec 21, 2023
605dbe8
run intergration test and unit test in tidb-cse-7.5
iosmanthus Dec 22, 2023
9676f18
close on canceled (#1121)
pingyu Jan 17, 2024
1e7b240
Fix wait recvloop timeout (#1134)
pingyu Jan 27, 2024
f3d4bda
Use correct address for CloseAddr (#1140)
pingyu Jan 27, 2024
abc5c93
tests: Fix timeout of TestResolveTxnFallbackFromAsyncCommit (#1146)
pingyu Jan 29, 2024
038a525
Update pd client for cse (#1199)
rleungx Mar 4, 2024
1bd54fb
Upgrade to the latest pd client (#1217)
rleungx Mar 13, 2024
c2ebf16
update pd client (#1221)
CabinfeverB Mar 13, 2024
3b011e3
rebase branch tidb-7.5 (#1194)
zeminzhou Mar 13, 2024
d5fcee4
Upgrade to the latest pd client (#1227)
rleungx Mar 14, 2024
fb2a7c7
update pd client for tidb-cse-7.5 (#1234)
zeminzhou Mar 18, 2024
462f013
fix issue read req timeout bug cause by pr#1223 (#1232) (#1254)
pingyu Mar 29, 2024
85550c6
*: update pd client to latest master (#1264)
disksing Apr 7, 2024
15f5f67
*: update pd client to latest master (#1283)
disksing Apr 10, 2024
6bfb15c
Support txn file transaction (#1119)
coocood May 8, 2024
abf9065
[cherry-pick] Add keyspace meta in codec (#1323) (#1332)
iosmanthus May 9, 2024
40e651b
fix backoff with nil error (#1348)
pingyu May 21, 2024
e36f29c
txn-file: Fix missing txn chunks in prewrite (#1350)
pingyu May 27, 2024
190ad4e
support api v2 mock (#1361)
ystaticy Jun 6, 2024
8b6b8a7
txn-file: Handle locked keys in split region (#1364)
pingyu Jun 13, 2024
074830f
txn-file: Acquire txn file availability (#1365)
pingyu Jun 17, 2024
5f98b39
txn-file: calculate RU (#1368)
pingyu Jun 20, 2024
b4e4756
merge upstream tidb-7.5 (#1370)
iosmanthus Jul 9, 2024
e8d1e50
handle nil cached region (#1386)
pingyu Jul 11, 2024
3fbc195
remove availability interface (#1387)
pingyu Jul 11, 2024
bab73da
txn-file: Skip write to empty region (#1399)
pingyu Jul 30, 2024
f0fd190
txn-file: Prewrite/commit in parallel (#1403)
pingyu Jul 31, 2024
1de9d43
info to debug (#1413)
pingyu Aug 1, 2024
ea9f424
*: Update golangci-lint to v1.59.1 and fix lint errors (#1415)
pingyu Aug 5, 2024
eed5db5
txn-file: Fix miss slice after region error is met or commit failed (…
pingyu Aug 5, 2024
69d3b9e
txn-file: Improve prewrite/commit concurrency when number of txn chun…
pingyu Aug 7, 2024
8bc2cb7
ru discount (#1418)
pingyu Aug 12, 2024
7426f4f
[tidb-cse-7.5] memdb: fix memdb snapshot get/iter is not actually sna…
pingyu Aug 23, 2024
af18e61
OWNERS: Auto Sync OWNERS files from community membership (#1449)
ti-chi-bot Aug 27, 2024
196943c
txn-file: Get sample keys from `CommitterMutations` (#1454)
pingyu Aug 28, 2024
8cc71f4
txn-file: Get first key inside range of both region & txn chunk (#1455)
pingyu Sep 2, 2024
53f61c5
sort by chunk first (#1456)
pingyu Sep 2, 2024
e9df112
txn-file: Change switch variable to `DisableTxnFile` (#1485)
pingyu Nov 6, 2024
44e6239
membuffer: fix memory leak in red-black tree (#1483) (#1497)
you06 Nov 25, 2024
105df23
new codec by keyspace meta (#1538)
ystaticy Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Integration Test

on:
push:
branches: [ master ]
branches: [ master, tidb-cse-7.5 ]
pull_request:
branches: [ master ]
branches: [ master, tidb-cse-7.5 ]

jobs:

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Unit Test

on:
push:
branches: [ master ]
branches: [ master, tidb-cse-7.5 ]
pull_request:
branches: [ master ]
branches: [ master, tidb-cse-7.5 ]

jobs:
test:
Expand Down Expand Up @@ -44,8 +44,13 @@ jobs:
with:
go-version: 1.21.0

- name: Go generate and check diff
run: |
go generate ./...
git diff --exit-code

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.59.1

1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ linters:
disable-all: true
enable:
- bodyclose
- depguard
- exportloopref
- gofmt
- goimports
Expand Down
77 changes: 77 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- 5kbpers
- AndreMouche
- andylokandy
- breezewish
- brson
- bufferflies
- BusyJay
- cfzjywxk
- Connor1996
- coocood
- disksing
- ekexium
- gengliqi
- glorv
- hicqu
- hunterlxt
- imtbkcat
- innerr
- iosmanthus
- jackysp
- kennytm
- Little-Wallace
- liuzix
- lonng
- LykxSassinator
- lysu
- marsishandsome
- MyonKeminta
- niedhui
- NingLin-P
- nrc
- overvenus
- pingyu
- skyzh
- SpadeA-Tang
- sticnarf
- sunxiaoguang
- tabokie
- TennyZhuang
- tonyxuqqi
- yiwu-arbug
- you06
- youjiali1995
- YuJuncen
- zhangjinpeng87
- zhongzc
- zhouqiang-cl
reviewers:
- 3pointer
- CalvinNeo
- crazycs520
- ethercflow
- fredchenbj
- Fullstop000
- gozssky
- haojinming
- HuSharp
- jayzhan211
- Jibbow
- JmPotato
- Leavrth
- lhy1024
- longfangsong
- lzmhhh123
- Mossaka
- MrCroxx
- nolouch
- rleungx
- Rustin170506
- tier-cap
- v01dstar
- wjhuang2016
- wshwsh12
- Xuanwo
- zyguan
40 changes: 34 additions & 6 deletions config/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ import (

const (
// DefStoreLivenessTimeout is the default value for store liveness timeout.
DefStoreLivenessTimeout = "1s"
DefStoreLivenessTimeout = "1s"
DefGrpcInitialWindowSize = 1 << 27 // 128MiB
DefGrpcInitialConnWindowSize = 1 << 27 // 128MiB
)

// TiKVClient is the config for tikv client.
Expand All @@ -59,6 +61,10 @@ type TiKVClient struct {
GrpcKeepAliveTimeout uint `toml:"grpc-keepalive-timeout" json:"grpc-keepalive-timeout"`
// GrpcCompressionType is the compression type for gRPC channel: none or gzip.
GrpcCompressionType string `toml:"grpc-compression-type" json:"grpc-compression-type"`
// GrpcInitialWindowSize is the value for initial window size on a stream.
GrpcInitialWindowSize int32 `toml:"grpc-initial-window-size" json:"grpc-initial-window-size"`
// GrpcInitialConnWindowSize is the value for initial window size on a connection.
GrpcInitialConnWindowSize int32 `toml:"grpc-initial-conn-window-size" json:"grpc-initial-conn-window-size"`
// CommitTimeout is the max time which command 'commit' will wait.
CommitTimeout string `toml:"commit-timeout" json:"commit-timeout"`
AsyncCommit AsyncCommit `toml:"async-commit" json:"async-commit"`
Expand Down Expand Up @@ -87,6 +93,21 @@ type TiKVClient struct {
// TTLRefreshedTxnSize controls whether a transaction should update its TTL or not.
TTLRefreshedTxnSize int64 `toml:"ttl-refreshed-txn-size" json:"ttl-refreshed-txn-size"`
ResolveLockLiteThreshold uint64 `toml:"resolve-lock-lite-threshold" json:"resolve-lock-lite-threshold"`

// RemoteCoprocessorAddr is the address of the remote coprocessor.
RemoteCoprocessorAddr string `toml:"remote-coprocessor-addr" json:"remote-coprocessor-addr"`

// TxnChunkWriterAddr is the address of the txn chunk writer for file-based txn.
TxnChunkWriterAddr string `toml:"txn-chunk-writer-addr" json:"txn-chunk-writer-addr"`
// TxnChunkWriterConcurrency is the concurrency to request the txn chunk writer for file-based txn.
TxnChunkWriterConcurrency uint `toml:"txn-chunk-writer-concurrency" json:"txn-chunk-writer-concurrency"`
// TxnChunkMaxSize is the maximum size of a txn chunk of file-based txn.
TxnChunkMaxSize uint64 `toml:"txn-chunk-max-size" json:"txn-chunk-max-size"`
// TxnFileMinMutationSize is the minimum size of mutations to use file-based txn.
TxnFileMinMutationSize uint64 `toml:"txn-file-min-mutation-size" json:"txn-file-min-mutation-size"`
// TxnFileRUDiscountRatio is the discount ratio of resource unit for file-based txn.
// Will be ignored if it's <= 0 or >= 1.
TxnFileRUDiscountRatio float64
}

// AsyncCommit is the config for the async commit feature. The switch to enable it is a system variable.
Expand Down Expand Up @@ -121,11 +142,13 @@ type CoprocessorCache struct {
// DefaultTiKVClient returns default config for TiKVClient.
func DefaultTiKVClient() TiKVClient {
return TiKVClient{
GrpcConnectionCount: 4,
GrpcKeepAliveTime: 10,
GrpcKeepAliveTimeout: 3,
GrpcCompressionType: "none",
CommitTimeout: "41s",
GrpcConnectionCount: 4,
GrpcKeepAliveTime: 10,
GrpcKeepAliveTimeout: 3,
GrpcCompressionType: "none",
GrpcInitialWindowSize: DefGrpcInitialWindowSize,
GrpcInitialConnWindowSize: DefGrpcInitialConnWindowSize,
CommitTimeout: "41s",
AsyncCommit: AsyncCommit{
// FIXME: Find an appropriate default limit.
KeysLimit: 256,
Expand Down Expand Up @@ -156,6 +179,11 @@ func DefaultTiKVClient() TiKVClient {
CoprReqTimeout: 60 * time.Second,

ResolveLockLiteThreshold: 16,

TxnChunkWriterConcurrency: 4,
TxnChunkMaxSize: 128 * 1024 * 1024,
TxnFileMinMutationSize: 16 * 1024 * 1024,
TxnFileRUDiscountRatio: 0.125, // filed-based txn costs 1/8 RU of normal txn.
}
}

Expand Down
15 changes: 12 additions & 3 deletions error/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ var (
// ErrTiFlashServerTimeout is the error when tiflash server is timeout.
ErrTiFlashServerTimeout = errors.New("tiflash server timeout")
// ErrQueryInterrupted is the error when the query is interrupted.
ErrQueryInterrupted = errors.New("query interruppted")
// This is deprecated. Keep it only to pass CI :-(. We can remove this later.
ErrQueryInterrupted = errors.New("query interrupted")
// ErrTiKVStaleCommand is the error that the command is stale in tikv.
ErrTiKVStaleCommand = errors.New("tikv stale command")
// ErrTiKVMaxTimestampNotSynced is the error that tikv's max timestamp is not synced.
ErrTiKVMaxTimestampNotSynced = errors.New("tikv max timestamp not synced")
// ErrLockAcquireFailAndNoWaitSet is the error that acquire the lock failed while no wait is setted.
ErrLockAcquireFailAndNoWaitSet = errors.New("lock acquired failed and no wait is setted")
ErrLockAcquireFailAndNoWaitSet = errors.New("lock acquired failed and no wait is set")
// ErrResolveLockTimeout is the error that resolve lock timeout.
ErrResolveLockTimeout = errors.New("resolve lock timeout")
// ErrLockWaitTimeout is the error that wait for the lock is timeout.
Expand All @@ -96,11 +97,19 @@ var (
// ErrIsWitness is the error when a request is send to a witness.
ErrIsWitness = errors.New("peer is witness")
// ErrUnknown is the unknow error.
ErrUnknown = errors.New("unknow")
ErrUnknown = errors.New("unknown")
// ErrResultUndetermined is the error when execution result is unknown.
ErrResultUndetermined = errors.New("execution result undetermined")
)

type ErrQueryInterruptedWithSignal struct {
Signal uint32
}

func (e ErrQueryInterruptedWithSignal) Error() string {
return fmt.Sprintf("query interrupted by signal %d", e.Signal)
}

// MismatchClusterID represents the message that the cluster ID of the PD client does not match the PD.
const MismatchClusterID = "mismatch cluster id"

Expand Down
33 changes: 16 additions & 17 deletions examples/gcworker/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
github.com/pingcap/kvproto v0.0.0-20230904082117-ecdbf1f8c130 // indirect
github.com/pingcap/kvproto v0.0.0-20240613021635-bca367ddc3b9 // indirect
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20230724080549-de985b8e0afc // indirect
github.com/tikv/pd/client v0.0.0-20240509073708-a674e668f8a5 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand All @@ -39,15 +38,15 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
)

Expand Down
33 changes: 16 additions & 17 deletions examples/rawkv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.21
require github.com/tikv/client-go/v2 v2.0.0

require (
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudfoundry/gosigar v1.3.6 // indirect
Expand All @@ -16,22 +15,21 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
github.com/pingcap/kvproto v0.0.0-20230904082117-ecdbf1f8c130 // indirect
github.com/pingcap/kvproto v0.0.0-20240613021635-bca367ddc3b9 // indirect
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20230724080549-de985b8e0afc // indirect
github.com/tikv/pd/client v0.0.0-20240509073708-a674e668f8a5 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand All @@ -40,14 +38,15 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
)

Expand Down
Loading
Loading