diff --git a/examples/gcworker/go.mod b/examples/gcworker/go.mod index 711e70930f..7af1d6b76e 100644 --- a/examples/gcworker/go.mod +++ b/examples/gcworker/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/rawkv/go.mod b/examples/rawkv/go.mod index 39e643a43f..b779427b3c 100644 --- a/examples/rawkv/go.mod +++ b/examples/rawkv/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/1pc_txn/go.mod b/examples/txnkv/1pc_txn/go.mod index 179bce58d2..4926479a1b 100644 --- a/examples/txnkv/1pc_txn/go.mod +++ b/examples/txnkv/1pc_txn/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/async_commit/go.mod b/examples/txnkv/async_commit/go.mod index c63516097f..066120e1ec 100644 --- a/examples/txnkv/async_commit/go.mod +++ b/examples/txnkv/async_commit/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/delete_range/go.mod b/examples/txnkv/delete_range/go.mod index 33036f2a78..2f9d244b9b 100644 --- a/examples/txnkv/delete_range/go.mod +++ b/examples/txnkv/delete_range/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/go.mod b/examples/txnkv/go.mod index b70e0325d9..5a23a1978e 100644 --- a/examples/txnkv/go.mod +++ b/examples/txnkv/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/pessimistic_txn/go.mod b/examples/txnkv/pessimistic_txn/go.mod index ccefa42c02..016964ad93 100644 --- a/examples/txnkv/pessimistic_txn/go.mod +++ b/examples/txnkv/pessimistic_txn/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/unsafedestoryrange/go.mod b/examples/txnkv/unsafedestoryrange/go.mod index 9a562abe29..7f5c8d11ea 100644 --- a/examples/txnkv/unsafedestoryrange/go.mod +++ b/examples/txnkv/unsafedestoryrange/go.mod @@ -6,7 +6,7 @@ require github.com/tikv/client-go/v2 v2.0.0 require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -21,16 +21,16 @@ require ( 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-20241113043844-e1fa7ea8c302 // indirect + github.com/pingcap/kvproto v0.0.0-20241120071417-b5b7843d9037 // 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.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/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // 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-20241111073742-238d4d79ea31 // indirect + github.com/tikv/pd/client v0.0.0-20241220053006-461b86adc78d // 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 @@ -39,14 +39,14 @@ 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.25.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/integration_tests/1pc_test.go b/integration_tests/1pc_test.go index c69bbdbcfe..d4fd03222d 100644 --- a/integration_tests/1pc_test.go +++ b/integration_tests/1pc_test.go @@ -306,3 +306,8 @@ func (s *testOnePCSuite) TestTxnCommitCounter() { s.Equal(diff.AsyncCommit, int64(1)) s.Equal(diff.OnePC, int64(1)) } + +func (s *testOnePCSuite) Test1PCUpdateLatestCommitInf() { + store := tikv.StoreProbe{KVStore: s.store} + testUpdateLatestCommitInfo(s.Require(), store, "1pc") +} diff --git a/integration_tests/2pc_test.go b/integration_tests/2pc_test.go index fdad3b2969..5617607218 100644 --- a/integration_tests/2pc_test.go +++ b/integration_tests/2pc_test.go @@ -2769,3 +2769,8 @@ func (s *testCommitterSuite) Test2PCCleanupLifecycleHooks() { wg.Wait() s.Equal(reachedPost.Load(), true) } + +func (s *testCommitterSuite) Test2PCUpdateLatestCommitInf() { + testUpdateLatestCommitInfo(s.Require(), s.store, "2pc") + testUpdateLatestCommitInfo(s.Require(), s.store, "pipelined") +} diff --git a/integration_tests/async_commit_test.go b/integration_tests/async_commit_test.go index 4c478f45a9..8b1eb90b45 100644 --- a/integration_tests/async_commit_test.go +++ b/integration_tests/async_commit_test.go @@ -663,3 +663,8 @@ func (s *testAsyncCommitSuite) TestAsyncCommitLifecycleHooks() { wg.Wait() s.Equal(reachedPost.Load(), true) } + +func (s *testAsyncCommitSuite) TestAsyncCommitUpdateLatestCommitInf() { + store := tikv.StoreProbe{KVStore: s.store} + testUpdateLatestCommitInfo(s.Require(), store, "async") +} diff --git a/integration_tests/store_test.go b/integration_tests/store_test.go index 8f61b42896..a2628f0fcd 100644 --- a/integration_tests/store_test.go +++ b/integration_tests/store_test.go @@ -36,18 +36,21 @@ package tikv_test import ( "context" + "fmt" "sync" "testing" "time" "github.com/pingcap/failpoint" "github.com/pingcap/kvproto/pkg/kvrpcpb" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/tikv/client-go/v2/oracle" "github.com/tikv/client-go/v2/oracle/oracles" "github.com/tikv/client-go/v2/tikv" "github.com/tikv/client-go/v2/tikvrpc" "github.com/tikv/client-go/v2/txnkv" + "github.com/tikv/client-go/v2/util" ) func TestStore(t *testing.T) { @@ -192,3 +195,58 @@ func (s *testStoreSuite) TestFailBusyServerKV() { s.Nil(err) s.Equal(val, []byte("value")) } + +func testUpdateLatestCommitInfo(require *require.Assertions, store tikv.StoreProbe, mode string) { + doTxn := func() *util.CommitInfo { + var ops []tikv.TxnOption + if mode == "pipelined" { + ops = append(ops, tikv.WithPipelinedMemDB()) + } + txn, err := store.Begin(ops...) + require.Nil(err) + switch mode { + case "async": + txn.SetEnableAsyncCommit(true) + case "1pc": + txn.SetEnable1PC(true) + case "2pc", "pipelined": + // do nothing + default: + require.FailNow("unknown mode:" + mode) + } + err = txn.Set([]byte("key"), []byte("value")) + require.Nil(err) + err = txn.Commit(context.Background()) + require.Nil(err) + return txn.GetCommitter().GetCommitInfo() + } + + txnSize := 8 + mutationLen := 1 + if mode == "pipelined" { + txnSize = 0 + mutationLen = 0 + } + commitInfo1 := doTxn() + require.Equal(commitInfo1, store.GetLastCommitInfo()) + require.Equal(commitInfo1.MutationLen, mutationLen) + require.Equal(commitInfo1.TxnSize, txnSize) + require.Equal(commitInfo1.TxnType, mode) + commitInfo2 := doTxn() + lastInfo := store.GetLastCommitInfo() + require.NotEqual(commitInfo1, lastInfo) + require.Equal(commitInfo2, lastInfo) + require.Greater(lastInfo.CommitTS, commitInfo1.CommitTS) + require.GreaterOrEqual(lastInfo.StartTS, commitInfo1.CommitTS) + + errMsg := fmt.Sprintf("Verified ts: %d, LastCommit: TxnType: %s, StartTS: %d, CommitTS: %d, MutationLen: %d, TxnSize: %d, Primary: [107 101 121]", + lastInfo.StartTS, mode, lastInfo.StartTS, lastInfo.CommitTS, mutationLen, txnSize) + require.PanicsWithValue(errMsg, func() { + lastInfo.Verify(lastInfo.StartTS) + }) + errMsg = fmt.Sprintf("Verified ts: %d, LastCommit: TxnType: %s, StartTS: %d, CommitTS: %d, MutationLen: %d, TxnSize: %d, Primary: [107 101 121]", + lastInfo.CommitTS-1, mode, lastInfo.StartTS, lastInfo.CommitTS, mutationLen, txnSize) + require.PanicsWithValue(errMsg, func() { + lastInfo.Verify(lastInfo.CommitTS - 1) + }) +} diff --git a/internal/mockstore/mocktikv/rpc.go b/internal/mockstore/mocktikv/rpc.go index 1e1ae53419..dbcda642b2 100644 --- a/internal/mockstore/mocktikv/rpc.go +++ b/internal/mockstore/mocktikv/rpc.go @@ -661,6 +661,40 @@ func (h kvHandler) handleSplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpcpb.S return resp } +func (h kvHandler) handleKvFlush(req *kvrpcpb.FlushRequest) *kvrpcpb.FlushResponse { + regionID := req.Context.RegionId + prewriteReq := &kvrpcpb.PrewriteRequest{ + Context: req.Context, + Mutations: req.Mutations, + PrimaryLock: req.PrimaryKey, + StartVersion: req.StartTs, + MinCommitTs: req.MinCommitTs, + LockTtl: req.LockTtl, + AssertionLevel: req.AssertionLevel, + } + + h.cluster.handleDelay(prewriteReq.StartVersion, regionID) + + for _, m := range req.Mutations { + if !h.checkKeyInRegion(m.Key) { + panic("KvPrewrite: key not in region") + } + } + errs := h.mvccStore.Prewrite(prewriteReq) + for i, e := range errs { + if e != nil { + if _, isLocked := errors.Cause(e).(*ErrLocked); !isLocked { + // Keep only one error if it's not a KeyIsLocked error. + errs = errs[i : i+1] + break + } + } + } + return &kvrpcpb.FlushResponse{ + Errors: convertToKeyErrors(errs), + } +} + // Client is a client that sends RPC. // This is same with tikv.Client, define again for avoid circle import. type Client interface { @@ -1070,6 +1104,13 @@ func (c *RPCClient) SendRequest(ctx context.Context, addr string, req *tikvrpc.R Name: "mvcc.num_rows", Value: strconv.Itoa(len(scanResp.Pairs)), }}} + case tikvrpc.CmdFlush: + r := req.Flush() + if err := session.checkRequest(reqCtx, r.Size()); err != nil { + resp.Resp = &kvrpcpb.PrewriteResponse{RegionError: err} + return resp, nil + } + resp.Resp = kvHandler{session}.handleKvFlush(r) default: return nil, errors.Errorf("unsupported this request type %v", req.Type) } diff --git a/oracle/oracles/pd.go b/oracle/oracles/pd.go index 60f0ee7cb3..a9597e1d1c 100644 --- a/oracle/oracles/pd.go +++ b/oracle/oracles/pd.go @@ -47,6 +47,7 @@ import ( "github.com/tikv/client-go/v2/internal/logutil" "github.com/tikv/client-go/v2/metrics" "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/util" pd "github.com/tikv/pd/client" "github.com/tikv/pd/client/clients/tso" "go.uber.org/zap" @@ -153,6 +154,9 @@ type pdOracle struct { // we don't require the ts for validation to be strictly the latest one. // Note that the result can't be reused for different txnScopes. The txnScope is used as the key. tsForValidation singleflight.Group + + // tsVerifier is used to verify the correctness of the partial order between the received timestamp and committed transactions. + tsVerifier *util.TSVerifier } // lastTSO stores the last timestamp oracle gets from PD server and the local time when the TSO is fetched. @@ -166,6 +170,8 @@ type PDOracleOptions struct { UpdateInterval time.Duration // Disable the background periodic update of the last ts. This is for test purposes only. NoUpdateTS bool + // TSVerifier is used to verify the correctness of the timestamp. + TSVerifier *util.TSVerifier } // NewPdOracle create an Oracle that uses a pd client source. @@ -182,6 +188,7 @@ func NewPdOracle(pdClient pd.Client, options *PDOracleOptions) (oracle.Oracle, e c: pdClient, quit: make(chan struct{}), lastTSUpdateInterval: atomic.Int64{}, + tsVerifier: options.TSVerifier, } o.adaptiveUpdateIntervalState.shrinkIntervalCh = make(chan time.Duration, 1) o.lastTSUpdateInterval.Store(int64(options.UpdateInterval)) @@ -228,8 +235,9 @@ func (o *pdOracle) GetAllTSOKeyspaceGroupMinTS(ctx context.Context) (uint64, err type tsFuture struct { tso.TSFuture - o *pdOracle - txnScope string + o *pdOracle + txnScope string + lastCommitInfo *util.CommitInfo } // Wait implements the oracle.Future interface. @@ -241,16 +249,27 @@ func (f *tsFuture) Wait() (uint64, error) { return 0, errors.WithStack(err) } ts := oracle.ComposeTS(physical, logical) + if f.lastCommitInfo != nil { + f.lastCommitInfo.Verify(ts) + } f.o.setLastTS(ts, f.txnScope) return ts, nil } func (o *pdOracle) GetTimestampAsync(ctx context.Context, opt *oracle.Option) oracle.Future { - return &tsFuture{o.c.GetTSAsync(ctx), o, opt.TxnScope} + var commitInfo *util.CommitInfo + if o.tsVerifier != nil { + commitInfo = o.tsVerifier.GetLastCommitInfo() + } + return &tsFuture{o.c.GetTSAsync(ctx), o, opt.TxnScope, commitInfo} } func (o *pdOracle) getTimestamp(ctx context.Context, txnScope string) (uint64, error) { now := time.Now() + var commitInfo *util.CommitInfo + if o.tsVerifier != nil { + commitInfo = o.tsVerifier.GetLastCommitInfo() + } physical, logical, err := o.c.GetTS(ctx) if err != nil { return 0, errors.WithStack(err) @@ -260,7 +279,11 @@ func (o *pdOracle) getTimestamp(ctx context.Context, txnScope string) (uint64, e logutil.Logger(ctx).Warn("get timestamp too slow", zap.Duration("cost time", dist)) } - return oracle.ComposeTS(physical, logical), nil + ts := oracle.ComposeTS(physical, logical) + if commitInfo != nil { + commitInfo.Verify(ts) + } + return ts, nil } func (o *pdOracle) getMinTimestampInAllTSOGroup(ctx context.Context) (uint64, error) { diff --git a/tikv/kv.go b/tikv/kv.go index 8973143504..6b234d92ac 100644 --- a/tikv/kv.go +++ b/tikv/kv.go @@ -143,6 +143,8 @@ type KVStore struct { wg sync.WaitGroup close atomicutil.Bool gP Pool + + tsVerifier *util.TSVerifier } var _ Storage = (*KVStore)(nil) @@ -261,8 +263,10 @@ func requestHealthFeedbackFromKVClient(ctx context.Context, addr string, tikvCli // NewKVStore creates a new TiKV store instance. func NewKVStore(uuid string, pdClient pd.Client, spkv SafePointKV, tikvclient Client, opt ...Option) (*KVStore, error) { + tsVerifier := util.NewTSVerifier() o, err := oracles.NewPdOracle(pdClient, &oracles.PDOracleOptions{ UpdateInterval: defaultOracleUpdateInterval, + TSVerifier: tsVerifier, }) if err != nil { return nil, err @@ -284,7 +288,9 @@ func NewKVStore(uuid string, pdClient pd.Client, spkv SafePointKV, tikvclient Cl ctx: ctx, cancel: cancel, gP: NewSpool(128, 10*time.Second), + tsVerifier: tsVerifier, } + store.clientMu.client = client.NewReqCollapse(client.NewInterceptedClient(tikvclient)) store.clientMu.client.SetEventListener(regionCache.GetClientEventListener()) @@ -858,6 +864,16 @@ func (s *KVStore) updateGlobalTxnScopeTSFromPD(ctx context.Context) bool { return false } +// SetLastCommitInfo sets the last committed transaction's information. +func (s *KVStore) SetLastCommitInfo(ci *util.CommitInfo) { + s.tsVerifier.SetLastCommitInfo(ci) +} + +// GetLastCommitInfo get the last committed transaction's information. +func (s *KVStore) GetLastCommitInfo() *util.CommitInfo { + return s.tsVerifier.GetLastCommitInfo() +} + func isValidSafeTS(ts uint64) bool { return ts != 0 && ts != math.MaxUint64 } diff --git a/txnkv/transaction/2pc.go b/txnkv/transaction/2pc.go index 3298b10de9..4fbcefd5e4 100644 --- a/txnkv/transaction/2pc.go +++ b/txnkv/transaction/2pc.go @@ -120,6 +120,7 @@ type kvstore interface { IsClose() bool // Go run the function in a separate goroutine. Go(f func()) error + storeCommitInfo } // twoPhaseCommitter executes a two-phase commit protocol. @@ -1012,6 +1013,9 @@ func (c *twoPhaseCommitter) doActionOnGroupMutations(bo *retry.Backoffer, action // Already spawned a goroutine for async commit transaction. if actionIsCommit && !actionCommit.retry && !c.isAsyncCommit() { + if !c.txn.IsPipelined() { + c.updateStoreCommitInfo() + } secondaryBo := retry.NewBackofferWithVars(c.store.Ctx(), CommitSecondaryMaxBackoff, c.txn.vars) if c.store.IsClose() { logutil.Logger(bo.GetCtx()).Warn("the store is closed", @@ -1868,6 +1872,7 @@ func (c *twoPhaseCommitter) execute(ctx context.Context) (err error) { logutil.Logger(ctx).Debug("1PC protocol is used to commit this txn", zap.Uint64("startTS", c.startTS), zap.Uint64("commitTS", c.commitTS), zap.Uint64("session", c.sessionID)) + c.updateStoreCommitInfo() return nil } @@ -1955,6 +1960,7 @@ func (c *twoPhaseCommitter) execute(ctx context.Context) (err error) { if c.isAsyncCommit() { // For async commit protocol, the commit is considered success here. c.txn.commitTS = c.commitTS + c.updateStoreCommitInfo() logutil.Logger(ctx).Debug("2PC will use async commit protocol to commit this txn", zap.Uint64("startTS", c.startTS), zap.Uint64("commitTS", c.commitTS), zap.Uint64("sessionID", c.sessionID)) @@ -2372,3 +2378,39 @@ func (c *twoPhaseCommitter) mutationsOfKeys(keys [][]byte) CommitterMutations { } return &res } + +// updateStoreCommitInfo sets the commit info for the store. +func (c *twoPhaseCommitter) updateStoreCommitInfo() { + c.store.SetLastCommitInfo(c.getCommitInfo()) +} + +func (c *twoPhaseCommitter) getCommitInfo() *util.CommitInfo { + var txnType string + if c.txn.isPipelined { + txnType = "pipelined" + } else if c.isAsyncCommit() { + txnType = "async" + } else if c.isOnePC() { + txnType = "1pc" + } else { + txnType = "2pc" + } + var mutationLen int + if !c.txn.isPipelined { + mutationLen = c.mutations.Len() + } + return &util.CommitInfo{ + TxnType: txnType, + StartTS: c.startTS, + CommitTS: atomic.LoadUint64(&c.commitTS), + MutationLen: mutationLen, + TxnSize: c.txnSize, + Primary: c.primaryKey, + } +} + +type storeCommitInfo interface { + SetLastCommitInfo(*util.CommitInfo) + // GetLastCommitInfo get the last committed transaction's information. + GetLastCommitInfo() *util.CommitInfo +} diff --git a/txnkv/transaction/pipelined_flush.go b/txnkv/transaction/pipelined_flush.go index c745e538a5..bad13de021 100644 --- a/txnkv/transaction/pipelined_flush.go +++ b/txnkv/transaction/pipelined_flush.go @@ -338,6 +338,7 @@ func (c *twoPhaseCommitter) commitFlushedMutations(bo *retry.Backoffer) error { zap.Uint64("startTS", c.startTS), zap.Uint64("commitTS", commitTS), ) + c.updateStoreCommitInfo() broadcastToAllStores( c.txn, c.store, diff --git a/txnkv/transaction/test_probe.go b/txnkv/transaction/test_probe.go index d3b049f9cf..8fe8f6fef1 100644 --- a/txnkv/transaction/test_probe.go +++ b/txnkv/transaction/test_probe.go @@ -26,6 +26,7 @@ import ( "github.com/tikv/client-go/v2/kv" "github.com/tikv/client-go/v2/tikvrpc" "github.com/tikv/client-go/v2/txnkv/txnsnapshot" + "github.com/tikv/client-go/v2/util" ) // TxnProbe wraps a txn and exports internal states for testing purpose. @@ -379,6 +380,11 @@ func (c CommitterProbe) ResolveFlushedLocks(bo *retry.Backoffer, start, end []by c.resolveFlushedLocks(bo, start, end, commit) } +// GetCommitInfo expose CommitInfo of committer for testing purpose. +func (c CommitterProbe) GetCommitInfo() *util.CommitInfo { + return c.getCommitInfo() +} + // SendTxnHeartBeat renews a txn's ttl. func SendTxnHeartBeat(bo *retry.Backoffer, store kvstore, primary []byte, startTS, ttl uint64) (newTTL uint64, stopHeartBeat bool, err error) { return sendTxnHeartBeat(bo, store, primary, startTS, ttl, 0) diff --git a/util/commit_ts_verify.go b/util/commit_ts_verify.go new file mode 100644 index 0000000000..78a6089ccd --- /dev/null +++ b/util/commit_ts_verify.go @@ -0,0 +1,71 @@ +// Copyright 2025 TiKV Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package util + +import ( + "fmt" + "sync/atomic" +) + +// CommitInfo stores the information of a COMMITTED transaction. +type CommitInfo struct { + TxnType string + StartTS uint64 + CommitTS uint64 + MutationLen int + TxnSize int + Primary []byte +} + +// String returns the string representation of CommitInfo. +func (c *CommitInfo) String() string { + return fmt.Sprintf("TxnType: %s, StartTS: %d, CommitTS: %d, MutationLen: %d, TxnSize: %d, Primary: %v", + c.TxnType, c.StartTS, c.CommitTS, c.MutationLen, c.TxnSize, c.Primary) +} + +// Verify checks validation of this commit information from the given ts. +func (c *CommitInfo) Verify(ts uint64) { + if ts < c.CommitTS || ts <= c.StartTS { + panic(fmt.Sprintf("Verified ts: %d, LastCommit: %s", ts, c.String())) + } +} + +// TSVerifier is used to verify the commit ts. +type TSVerifier struct { + lastCommitInfo atomic.Pointer[CommitInfo] +} + +// NewTSVerifier creates a new TSVerifier. +func NewTSVerifier() *TSVerifier { + return &TSVerifier{} +} + +// SetLastCommitInfo stores the commit information of a transaction. +func (t *TSVerifier) SetLastCommitInfo(commitInfo *CommitInfo) { + for { + last := t.lastCommitInfo.Load() + if last != nil && commitInfo.CommitTS <= last.CommitTS { + return + } + if t.lastCommitInfo.CompareAndSwap(last, commitInfo) { + return + } + } +} + +// GetLastCommitInfo gets the last commit information of a transaction. +func (t *TSVerifier) GetLastCommitInfo() *CommitInfo { + return t.lastCommitInfo.Load() +}