Skip to content

Commit

Permalink
Merge branch 'master' into zimuxia/add-vector-index
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala committed Sep 10, 2024
2 parents d73fb20 + aad3f7a commit 055c889
Show file tree
Hide file tree
Showing 1,076 changed files with 40,970 additions and 25,452 deletions.
72 changes: 36 additions & 36 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4606,13 +4606,13 @@ def go_deps():
name = "com_github_klauspost_compress",
build_file_proto_mode = "disable_global",
importpath = "github.com/klauspost/compress",
sha256 = "828c3b96d97362e230f267b3729ffaf8cedd92e39fba9ec92170001a4120d550",
strip_prefix = "github.com/klauspost/[email protected].7",
sha256 = "a009d53eecbdb9d6b789e9a0662fa41c87a85ab280291b2b5a5d9664bb1c5e8f",
strip_prefix = "github.com/klauspost/[email protected].9",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.7.zip",
"http://ats.apps.svc/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.7.zip",
"https://cache.hawkingrei.com/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.7.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.7.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.9.zip",
"http://ats.apps.svc/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.9.zip",
"https://cache.hawkingrei.com/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.9.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/klauspost/compress/com_github_klauspost_compress-v1.17.9.zip",
],
)
go_repository(
Expand Down Expand Up @@ -6010,13 +6010,13 @@ def go_deps():
name = "com_github_pingcap_kvproto",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/kvproto",
sha256 = "b1af34db24f2650cd2a687fa9c58bd746eb3ca76e08afe5dbe2ac569ce54b597",
strip_prefix = "github.com/pingcap/[email protected]20240716095229-5f7ffec83ea7",
sha256 = "368b662c8669d91bcd488b780b8ecb273855b8fc54c1043907171bdebc3ffc54",
strip_prefix = "github.com/pingcap/[email protected]20240904041139-1de8accd5bb7",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240716095229-5f7ffec83ea7.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240716095229-5f7ffec83ea7.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240716095229-5f7ffec83ea7.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240716095229-5f7ffec83ea7.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240904041139-1de8accd5bb7.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240904041139-1de8accd5bb7.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240904041139-1de8accd5bb7.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240904041139-1de8accd5bb7.zip",
],
)
go_repository(
Expand Down Expand Up @@ -6049,13 +6049,13 @@ def go_deps():
name = "com_github_pingcap_tipb",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/tipb",
sha256 = "6e910c9689f1a81bad2ae55be1746d456c317d696ff2687390d3fb30f7d05c6d",
strip_prefix = "github.com/pingcap/[email protected]20240703084358-e46e4632bd2b",
sha256 = "598bb728ddaf83863e7c79c8790cd2ae907c7ae762b13bfcf4164da5b9e2e4dc",
strip_prefix = "github.com/pingcap/[email protected]20240823074000-a40c2347786e",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240703084358-e46e4632bd2b.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240703084358-e46e4632bd2b.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240703084358-e46e4632bd2b.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240703084358-e46e4632bd2b.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240823074000-a40c2347786e.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240823074000-a40c2347786e.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240823074000-a40c2347786e.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/tipb/com_github_pingcap_tipb-v0.0.0-20240823074000-a40c2347786e.zip",
],
)
go_repository(
Expand Down Expand Up @@ -6192,13 +6192,13 @@ def go_deps():
name = "com_github_prometheus_client_golang",
build_file_proto_mode = "disable_global",
importpath = "github.com/prometheus/client_golang",
sha256 = "918154e4bad6d83dc5efb4856fd14c12e6fa543d5b0d6296fea8794465001829",
strip_prefix = "github.com/prometheus/client_golang@v1.19.1",
sha256 = "0668027e16b22f659865f6a5c7e0c236a1e095a45ed609d75da2573c98b773ce",
strip_prefix = "github.com/prometheus/client_golang@v1.20.2",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.19.1.zip",
"http://ats.apps.svc/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.19.1.zip",
"https://cache.hawkingrei.com/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.19.1.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.19.1.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.20.2.zip",
"http://ats.apps.svc/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.20.2.zip",
"https://cache.hawkingrei.com/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.20.2.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/prometheus/client_golang/com_github_prometheus_client_golang-v1.20.2.zip",
],
)
go_repository(
Expand All @@ -6218,13 +6218,13 @@ def go_deps():
name = "com_github_prometheus_common",
build_file_proto_mode = "disable_global",
importpath = "github.com/prometheus/common",
sha256 = "f7986d2ffaedbd2b1b5a4506e4d8225796bd037f8d5d4aa185c4786fb6f3b3d9",
strip_prefix = "github.com/prometheus/common@v0.55.0",
sha256 = "f69de750db71d71076a6ca22b366f4c22263133315838b2d28dff0f2d075ea2c",
strip_prefix = "github.com/prometheus/common@v0.57.0",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.55.0.zip",
"http://ats.apps.svc/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.55.0.zip",
"https://cache.hawkingrei.com/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.55.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.55.0.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.57.0.zip",
"http://ats.apps.svc/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.57.0.zip",
"https://cache.hawkingrei.com/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.57.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/prometheus/common/com_github_prometheus_common-v0.57.0.zip",
],
)
go_repository(
Expand Down Expand Up @@ -10443,13 +10443,13 @@ def go_deps():
name = "org_golang_x_sys",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/sys",
sha256 = "fbc83ddb0aee236ee85c0f8294e7c9b6f79d28794d22e7d0957fcd64ca252960",
strip_prefix = "golang.org/x/sys@v0.24.0",
sha256 = "95e485046cac79d164d4d35a13e93b2a866a1ac2148184c37ca71514ddd94a52",
strip_prefix = "golang.org/x/sys@v0.25.0",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/golang.org/x/sys/org_golang_x_sys-v0.24.0.zip",
"http://ats.apps.svc/gomod/golang.org/x/sys/org_golang_x_sys-v0.24.0.zip",
"https://cache.hawkingrei.com/gomod/golang.org/x/sys/org_golang_x_sys-v0.24.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/golang.org/x/sys/org_golang_x_sys-v0.24.0.zip",
"http://bazel-cache.pingcap.net:8080/gomod/golang.org/x/sys/org_golang_x_sys-v0.25.0.zip",
"http://ats.apps.svc/gomod/golang.org/x/sys/org_golang_x_sys-v0.25.0.zip",
"https://cache.hawkingrei.com/gomod/golang.org/x/sys/org_golang_x_sys-v0.25.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/golang.org/x/sys/org_golang_x_sys-v0.25.0.zip",
],
)
go_repository(
Expand Down
35 changes: 11 additions & 24 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
aliases:
sig-critical-approvers-tidb-server:
- yudongusa
- easonn7
- BenMeadowcroft
sig-critical-approvers-tidb-lightning:
- yudongusa
- easonn7
- BenMeadowcroft
sig-critical-approvers-parser:
- yudongusa
- easonn7
- BenMeadowcroft
sig-approvers-autoid-service: # approvers for auto-id service
- bb7133
- tiancaiamao
Expand Down Expand Up @@ -40,10 +40,7 @@ aliases:
- D3Hunter
- gmhdbjd
- lance6716
- lichunzhu
- okJiang
sig-approvers-domain: # approvers for domain pkg
- zimulala
- D3Hunter
- gmhdbjd
- lance6716
Expand All @@ -53,28 +50,24 @@ aliases:
- Benjamin2037
- tangenta
- wjhuang2016
- ywqzzy
- zimulala
- D3Hunter
- gmhdbjd
- lance6716
sig-approvers-disttask: # approvers for disttask pkg
- Benjamin2037
- D3Hunter
- gmhdbjd
- lance6716
- tangenta
- wjhuang2016
- ywqzzy
sig-approvers-dumpling: # approvers for dumpling module
- Benjamin2037
- gmhdbjd
- lichunzhu
- okJiang
- lance6716
- tangenta
sig-approvers-infoschema: # approvers for infoschema pkg
- zimulala
- wjhuang2016
- tangenta
- ywqzzy
- D3Hunter
- Benjamin2037
- gmhdbjd
Expand All @@ -83,15 +76,13 @@ aliases:
- gmhdbjd
- tangenta
- wjhuang2016
- ywqzzy
- zimulala
- D3Hunter
- lance6716
sig-approvers-owner: # approvers for `owner` pkg
- Benjamin2037
- lichunzhu
- tangenta
- wjhuang2016
- ywqzzy
- zimulala
- D3Hunter
sig-approvers-parser: # approvers for `parser` module.
- bb7133
- BornChanger
Expand All @@ -104,31 +95,27 @@ aliases:
- lance6716
- tangenta
- wjhuang2016
- ywqzzy
sig-approvers-table: # approvers for table packages.
- Benjamin2037
- cfzjywxk
- gmhdbjd
- tangenta
- wjhuang2016
- ywqzzy
- zimulala
sig-approvers-lock: # approvers for lock pkg
- Benjamin2037
- lance6716
- tangenta
- wjhuang2016
- zimulala
sig-approvers-tidb-binlog: # approvers for tidb-binlog module
- Benjamin2037
- gmhdbjd
- lichunzhu
- lance6716
sig-approvers-planner: # approvers for planner module
- AilinKid
- Rustin170506
- elsa0520
- fixdb
- hawkingrei
- hi-rustin
- qw4990
- time-and-fate
- winoros
10 changes: 5 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ versions.check(minimum_bazel_version = "6.0.0")

http_archive(
name = "io_bazel_rules_go",
sha256 = "b2038e2de2cace18f032249cb4bb0048abf583a36369fa98f687af1b3f880b26",
sha256 = "f4a9314518ca6acfa16cc4ab43b0b8ce1e4ea64b81c38d8a3772883f153346b8",
urls = [
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip",
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip",
],
)

Expand Down
2 changes: 1 addition & 1 deletion br/cmd/br/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ go_library(
"//br/pkg/utils",
"//br/pkg/version/build",
"//pkg/config",
"//pkg/parser/model",
"//pkg/meta/model",
"//pkg/session",
"//pkg/util",
"//pkg/util/gctuner",
Expand Down
2 changes: 1 addition & 1 deletion br/cmd/br/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/pingcap/tidb/br/pkg/task"
"github.com/pingcap/tidb/br/pkg/utils"
"github.com/pingcap/tidb/br/pkg/version/build"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/meta/model"
tidblogutil "github.com/pingcap/tidb/pkg/util/logutil"
"github.com/spf13/cobra"
"go.uber.org/zap"
Expand Down
3 changes: 3 additions & 0 deletions br/pkg/aws/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ go_library(
deps = [
"//br/pkg/config",
"//br/pkg/glue",
"//br/pkg/logutil",
"//br/pkg/utils",
"//pkg/util",
"@com_github_aws_aws_sdk_go//aws",
"@com_github_aws_aws_sdk_go//aws/awserr",
"@com_github_aws_aws_sdk_go//aws/client",
"@com_github_aws_aws_sdk_go//aws/request",
"@com_github_aws_aws_sdk_go//aws/session",
"@com_github_aws_aws_sdk_go//service/cloudwatch",
"@com_github_aws_aws_sdk_go//service/ec2",
Expand Down
45 changes: 45 additions & 0 deletions br/pkg/aws/ebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/ec2"
Expand All @@ -19,6 +21,7 @@ import (
"github.com/pingcap/log"
"github.com/pingcap/tidb/br/pkg/config"
"github.com/pingcap/tidb/br/pkg/glue"
"github.com/pingcap/tidb/br/pkg/logutil"
"github.com/pingcap/tidb/br/pkg/utils"
"github.com/pingcap/tidb/pkg/util"
"go.uber.org/atomic"
Expand All @@ -41,11 +44,53 @@ type EC2Session struct {

type VolumeAZs map[string]string

type ebsBackupRetryer struct {
delegate request.Retryer
}

func (e *ebsBackupRetryer) MaxRetries() int {
return e.delegate.MaxRetries()
}

var backOffTimeOverride = map[string]time.Duration{
// From the SDK:
// Sadly it seems there isn't an exported operation name...
// const opCreateSnapshots = "CreateSnapshots"
// The quota for create snapshots is 5 per minute.
// Back off for a longer time so we won't excced it.
"CreateSnapshots": 20 * time.Second,
// const opCreateVolume = "CreateVolume"
"CreateVolume": 20 * time.Second,
}

func (e *ebsBackupRetryer) RetryRules(r *request.Request) time.Duration {
backOff := e.delegate.RetryRules(r)
if override, ok := backOffTimeOverride[r.Operation.Name]; ok {
backOff = max(override, backOff)
}
log.Warn(
"Retrying an operation.",
logutil.ShortError(r.Error),
zap.Duration("backoff", backOff),
zap.StackSkip("stack", 1),
)
return backOff
}

func (e *ebsBackupRetryer) ShouldRetry(r *request.Request) bool {
return e.delegate.ShouldRetry(r)
}

func NewEC2Session(concurrency uint, region string) (*EC2Session, error) {
// aws-sdk has builtin exponential backoff retry mechanism, see:
// https://github.com/aws/aws-sdk-go/blob/db4388e8b9b19d34dcde76c492b17607cd5651e2/aws/client/default_retryer.go#L12-L16
// with default retryer & max-retry=9, we will wait for at least 30s in total
awsConfig := aws.NewConfig().WithMaxRetries(9).WithRegion(region)
defRetry := new(client.DefaultRetryer)
ourRetry := ebsBackupRetryer{
delegate: defRetry,
}
awsConfig.Retryer = ourRetry
// TiDB Operator need make sure we have the correct permission to call aws api(through aws env variables)
// we may change this behaviour in the future.
sessionOptions := session.Options{Config: *awsConfig}
Expand Down
4 changes: 2 additions & 2 deletions br/pkg/backup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ go_library(
"//pkg/distsql",
"//pkg/kv",
"//pkg/meta",
"//pkg/parser/model",
"//pkg/meta/model",
"//pkg/statistics/handle",
"//pkg/statistics/handle/util",
"//pkg/util",
Expand Down Expand Up @@ -78,7 +78,7 @@ go_test(
"//br/pkg/rtree",
"//br/pkg/storage",
"//br/pkg/utils",
"//pkg/parser/model",
"//pkg/meta/model",
"//pkg/sessionctx/variable",
"//pkg/testkit",
"//pkg/testkit/testsetup",
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/backup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/pingcap/tidb/pkg/distsql"
"github.com/pingcap/tidb/pkg/kv"
"github.com/pingcap/tidb/pkg/meta"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/meta/model"
"github.com/pingcap/tidb/pkg/util"
filter "github.com/pingcap/tidb/pkg/util/table-filter"
"github.com/tikv/client-go/v2/oracle"
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/backup/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/pingcap/tidb/br/pkg/rtree"
"github.com/pingcap/tidb/br/pkg/storage"
"github.com/pingcap/tidb/br/pkg/utils"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/meta/model"
"github.com/pingcap/tidb/pkg/testkit"
"github.com/stretchr/testify/require"
"github.com/tikv/client-go/v2/oracle"
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/backup/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/pingcap/tidb/br/pkg/summary"
"github.com/pingcap/tidb/br/pkg/utils"
"github.com/pingcap/tidb/pkg/kv"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/meta/model"
"github.com/pingcap/tidb/pkg/statistics/handle"
"github.com/pingcap/tidb/pkg/statistics/handle/util"
tidbutil "github.com/pingcap/tidb/pkg/util"
Expand Down
Loading

0 comments on commit 055c889

Please sign in to comment.