Skip to content

Commit

Permalink
test refactored memdb
Browse files Browse the repository at this point in the history
Signed-off-by: you06 <[email protected]>
  • Loading branch information
you06 committed Aug 23, 2024
1 parent f42c523 commit bafc701
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 34 deletions.
25 changes: 6 additions & 19 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6097,19 +6097,6 @@ def go_deps():
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pkg/xattr/com_github_pkg_xattr-v0.4.9.zip",
],
)
go_repository(
name = "com_github_plar_go_adaptive_radix_tree",
build_file_proto_mode = "disable_global",
importpath = "github.com/plar/go-adaptive-radix-tree",
sha256 = "aee2f222c06b9e07f3ee50ddf4f5e81d10e3f36066f9c67bff82e5650d627f4f",
strip_prefix = "github.com/you06/[email protected]",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/you06/go-adaptive-radix-tree/com_github_you06_go_adaptive_radix_tree-v0.0.0-20240523051018-0278e8bfcd2b.zip",
"http://ats.apps.svc/gomod/github.com/you06/go-adaptive-radix-tree/com_github_you06_go_adaptive_radix_tree-v0.0.0-20240523051018-0278e8bfcd2b.zip",
"https://cache.hawkingrei.com/gomod/github.com/you06/go-adaptive-radix-tree/com_github_you06_go_adaptive_radix_tree-v0.0.0-20240523051018-0278e8bfcd2b.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/you06/go-adaptive-radix-tree/com_github_you06_go_adaptive_radix_tree-v0.0.0-20240523051018-0278e8bfcd2b.zip",
],
)
go_repository(
name = "com_github_pmezard_go_difflib",
build_file_proto_mode = "disable_global",
Expand Down Expand Up @@ -7193,13 +7180,13 @@ def go_deps():
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sha256 = "98ea72c014769cf66340ba1658aaa259ba32957e066e3fe9f081a1364a7661ef",
strip_prefix = "github.com/you06/client-go/[email protected].0-alpha.0.20240801122022-90e7e39c64bf",
sha256 = "211a414fbebde387169f9d3cc46e5749d51c2cb5aed1e268fd869edc34037653",
strip_prefix = "github.com/tikv/client-go/[email protected].8-0.20240823034643-41d133b6b615",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/you06/client-go/v2/com_github_you06_client_go_v2-v2.0.0-alpha.0.20240801122022-90e7e39c64bf.zip",
"http://ats.apps.svc/gomod/github.com/you06/client-go/v2/com_github_you06_client_go_v2-v2.0.0-alpha.0.20240801122022-90e7e39c64bf.zip",
"https://cache.hawkingrei.com/gomod/github.com/you06/client-go/v2/com_github_you06_client_go_v2-v2.0.0-alpha.0.20240801122022-90e7e39c64bf.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/you06/client-go/v2/com_github_you06_client_go_v2-v2.0.0-alpha.0.20240801122022-90e7e39c64bf.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240823034643-41d133b6b615.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240823034643-41d133b6b615.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240823034643-41d133b6b615.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20240823034643-41d133b6b615.zip",
],
)
go_repository(
Expand Down
6 changes: 1 addition & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ require (
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/plar/go-adaptive-radix-tree v1.0.5 // indirect
github.com/qri-io/jsonpointer v0.1.1 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
)
Expand Down Expand Up @@ -336,7 +335,4 @@ replace (
sourcegraph.com/sourcegraph/appdash-data => github.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67
)

replace (
github.com/plar/go-adaptive-radix-tree => github.com/you06/go-adaptive-radix-tree v0.0.0-20240523051018-0278e8bfcd2b
github.com/tikv/client-go/v2 => github.com/you06/client-go/v2 v2.0.0-alpha.0.20240801122022-90e7e39c64bf
)
replace github.com/tikv/client-go/v2 => github.com/tikv/client-go/v2 v2.0.8-0.20240823034643-41d133b6b615
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@ github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM=
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tikv/client-go/v2 v2.0.8-0.20240823034643-41d133b6b615 h1:q6bYw7MWImtvqmRhpEWI5R52CEWzzeICIZxvwMOw7d4=
github.com/tikv/client-go/v2 v2.0.8-0.20240823034643-41d133b6b615/go.mod h1:4HDOAx8OXAJPtqhCZ03IhChXgaFs4B3+vSrPWmiPxjg=
github.com/tikv/pd/client v0.0.0-20240805092608-838ee7983b78 h1:PtW+yTvs9eGTMblulaCHmJ5OtifuE4SJXCACCtkd6ko=
github.com/tikv/pd/client v0.0.0-20240805092608-838ee7983b78/go.mod h1:TxrJRY949Vl14Lmarx6hTNP/HEDYzn4dP0KmjdzQ59w=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
Expand Down Expand Up @@ -885,10 +887,6 @@ github.com/xitongsys/parquet-go-source v0.0.0-20190524061010-2b72cbee77d5/go.mod
github.com/xitongsys/parquet-go-source v0.0.0-20200817004010-026bad9b25d0 h1:a742S4V5A15F93smuVxA60LQWsrCnN8bKeWDBARU1/k=
github.com/xitongsys/parquet-go-source v0.0.0-20200817004010-026bad9b25d0/go.mod h1:HYhIKsdns7xz80OgkbgJYrtQY7FjHWHKH6cvN7+czGE=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/you06/client-go/v2 v2.0.0-alpha.0.20240801122022-90e7e39c64bf h1:IFGLQQlJwXQzPEA4LLCM8vPbx3aS2MuN7PFAjRUIQF0=
github.com/you06/client-go/v2 v2.0.0-alpha.0.20240801122022-90e7e39c64bf/go.mod h1:MUVF8ijSeVTMy1z+kKGCngKspHBVF7aUG/FZVt3fXkE=
github.com/you06/go-adaptive-radix-tree v0.0.0-20240523051018-0278e8bfcd2b h1:gSNk6E3PAahr4Ro3b+Oo5NHivzgWIv9zwrTFIAUeESE=
github.com/you06/go-adaptive-radix-tree v0.0.0-20240523051018-0278e8bfcd2b/go.mod h1:15VOUO7R9MhJL8HOJdpydR0rvanrtRE6fA6XSa/tqWE=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
7 changes: 1 addition & 6 deletions pkg/store/driver/txn/txn_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import (
"github.com/tikv/client-go/v2/tikvrpc"
"github.com/tikv/client-go/v2/tikvrpc/interceptor"
"github.com/tikv/client-go/v2/txnkv"
"github.com/tikv/client-go/v2/txnkv/transaction"
"github.com/tikv/client-go/v2/txnkv/txnsnapshot"
"go.uber.org/zap"
)
Expand Down Expand Up @@ -371,11 +370,7 @@ func (txn *tikvTxn) extractKeyExistsErr(errExist *tikverr.ErrKeyExist) error {
)
}
} else {
if memdb := txn.KVTxn.GetUnionStore().GetMemBuffer().GetMemDB(); memdb != nil {
value, err = memdb.SelectValueHistory(key, func(value []byte) bool { return len(value) != 0 })
} else {
value, err = transaction.ToArenaArt(txn.KVTxn.GetUnionStore().GetMemBuffer()).SelectValueHistory(key, func(value []byte) bool { return len(value) != 0 })
}
value, err = txn.KVTxn.GetUnionStore().GetMemBuffer().GetMemDB().SelectValueHistory(key, func(value []byte) bool { return len(value) != 0 })
}
if err != nil {
return genKeyExistsError("UNKNOWN", key.String(), err)
Expand Down

0 comments on commit bafc701

Please sign in to comment.