Skip to content

Commit

Permalink
Merge branch 'pingcap:master' into fix_prefix_compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyfhust committed Mar 12, 2024
2 parents ab938a4 + 15947c1 commit 1cce48f
Show file tree
Hide file tree
Showing 160 changed files with 4,091 additions and 2,082 deletions.
72 changes: 36 additions & 36 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4740,13 +4740,13 @@ def go_deps():
name = "com_github_lestrrat_go_httprc",
build_file_proto_mode = "disable_global",
importpath = "github.com/lestrrat-go/httprc",
sha256 = "fd0658206207ff68f0561d9a681a99bee765d9cc453665d202a01ce860c72a90",
strip_prefix = "github.com/lestrrat-go/httprc@v1.0.4",
sha256 = "b5ec122596da8970869d3b41a1bc901a440c66a906bbd2fcbe2a19e8728787d7",
strip_prefix = "github.com/lestrrat-go/httprc@v1.0.5",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.4.zip",
"http://ats.apps.svc/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.4.zip",
"https://cache.hawkingrei.com/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.4.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.4.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.5.zip",
"http://ats.apps.svc/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.5.zip",
"https://cache.hawkingrei.com/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.5.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/lestrrat-go/httprc/com_github_lestrrat_go_httprc-v1.0.5.zip",
],
)
go_repository(
Expand All @@ -4766,13 +4766,13 @@ def go_deps():
name = "com_github_lestrrat_go_jwx_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/lestrrat-go/jwx/v2",
sha256 = "28e43e9f0b531d806db5c31f47076375a6f0c87207f1a8a69cc6bde242c83c65",
strip_prefix = "github.com/lestrrat-go/jwx/v2@v2.0.19",
sha256 = "f49d9cb1482cbd4ed113d8fa1c3f197df5ba498dd461641123cff0337e030af2",
strip_prefix = "github.com/lestrrat-go/jwx/v2@v2.0.21",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.19.zip",
"http://ats.apps.svc/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.19.zip",
"https://cache.hawkingrei.com/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.19.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.19.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.21.zip",
"http://ats.apps.svc/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.21.zip",
"https://cache.hawkingrei.com/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.21.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/lestrrat-go/jwx/v2/com_github_lestrrat_go_jwx_v2-v2.0.21.zip",
],
)
go_repository(
Expand Down Expand Up @@ -5806,13 +5806,13 @@ def go_deps():
name = "com_github_pingcap_errors",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/errors",
sha256 = "b4db3d3c222d9039c84baacbbd9c46aa0346f3f04d2577a77475a64ecfefebf9",
strip_prefix = "github.com/pingcap/errors@v0.11.5-0.20231212100244-799fae176cfb",
sha256 = "0edb07dbd73a90f97e06e11e54b270d64d5cabe6142025682d840fe302087b23",
strip_prefix = "github.com/pingcap/errors@v0.11.5-0.20240311024730-e056997136bb",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20231212100244-799fae176cfb.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20231212100244-799fae176cfb.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20231212100244-799fae176cfb.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20231212100244-799fae176cfb.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311024730-e056997136bb.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311024730-e056997136bb.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311024730-e056997136bb.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311024730-e056997136bb.zip",
],
)
go_repository(
Expand Down Expand Up @@ -6911,26 +6911,26 @@ def go_deps():
name = "com_github_stretchr_objx",
build_file_proto_mode = "disable_global",
importpath = "github.com/stretchr/objx",
sha256 = "1a00b3bb5ad41cb72634ace06b7eb7df857404d77a7cab4e401a7c729561fe4c",
strip_prefix = "github.com/stretchr/objx@v0.5.0",
sha256 = "3c22c1d1c4c4024eb16a12f0187775640bf35d51b0a06649febc7797119451c0",
strip_prefix = "github.com/stretchr/objx@v0.5.2",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.0.zip",
"http://ats.apps.svc/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.0.zip",
"https://cache.hawkingrei.com/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.0.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.2.zip",
"http://ats.apps.svc/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.2.zip",
"https://cache.hawkingrei.com/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.2.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/stretchr/objx/com_github_stretchr_objx-v0.5.2.zip",
],
)
go_repository(
name = "com_github_stretchr_testify",
build_file_proto_mode = "disable_global",
importpath = "github.com/stretchr/testify",
sha256 = "e206daaede0bd03de060bdfbeb984ac2c49b83058753fffc93fe0c220ea87532",
strip_prefix = "github.com/stretchr/testify@v1.8.4",
sha256 = "ee5d4f73cb689b1b5432c6908a189f9fbdb172507c49c32dbdf79b239ea9b8e0",
strip_prefix = "github.com/stretchr/testify@v1.9.0",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.8.4.zip",
"http://ats.apps.svc/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.8.4.zip",
"https://cache.hawkingrei.com/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.8.4.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.8.4.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.9.0.zip",
"http://ats.apps.svc/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.9.0.zip",
"https://cache.hawkingrei.com/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.9.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/stretchr/testify/com_github_stretchr_testify-v1.9.0.zip",
],
)
go_repository(
Expand Down Expand Up @@ -10581,13 +10581,13 @@ def go_deps():
name = "org_uber_go_zap",
build_file_proto_mode = "disable_global",
importpath = "go.uber.org/zap",
sha256 = "70582d5e7a6da19b70bb9f42fdb1fff86215002796e06d833d525b908a346b42",
strip_prefix = "go.uber.org/zap@v1.26.0",
sha256 = "b994b96ff0bb504a3d58288ab88b9f3c6604689ea1afb69d25b509769705a6c2",
strip_prefix = "go.uber.org/zap@v1.27.0",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/go.uber.org/zap/org_uber_go_zap-v1.26.0.zip",
"http://ats.apps.svc/gomod/go.uber.org/zap/org_uber_go_zap-v1.26.0.zip",
"https://cache.hawkingrei.com/gomod/go.uber.org/zap/org_uber_go_zap-v1.26.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/go.uber.org/zap/org_uber_go_zap-v1.26.0.zip",
"http://bazel-cache.pingcap.net:8080/gomod/go.uber.org/zap/org_uber_go_zap-v1.27.0.zip",
"http://ats.apps.svc/gomod/go.uber.org/zap/org_uber_go_zap-v1.27.0.zip",
"https://cache.hawkingrei.com/gomod/go.uber.org/zap/org_uber_go_zap-v1.27.0.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/go.uber.org/zap/org_uber_go_zap-v1.27.0.zip",
],
)
go_repository(
Expand Down
9 changes: 7 additions & 2 deletions br/pkg/redact/redact.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ import (

// InitRedact inits the enableRedactLog
func InitRedact(redactLog bool) {
errors.RedactLogEnabled.Store(redactLog)
mode := errors.RedactLogDisable
if redactLog {
mode = errors.RedactLogEnable
}
errors.RedactLogEnabled.Store(mode)
}

// NeedRedact returns whether to redact log
func NeedRedact() bool {
return errors.RedactLogEnabled.Load()
mode := errors.RedactLogEnabled.Load()
return mode != errors.RedactLogDisable && mode != ""
}

// String receives string argument and return omitted information if redact log enabled
Expand Down
10 changes: 6 additions & 4 deletions br/pkg/restore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1520,12 +1520,14 @@ LOOPFORTABLE:
restoreFn := func() error {
filesGroups := getGroupFiles(filesReplica, rc.fileImporter.supportMultiIngest)
for _, filesGroup := range filesGroups {
if importErr := func(fs []*backuppb.File) error {
if importErr := func(fs []*backuppb.File) (err error) {
fileStart := time.Now()
defer func() {
log.Info("import files done", logutil.Files(filesGroup),
zap.Duration("take", time.Since(fileStart)))
updateCh.Inc()
if err == nil {
log.Info("import files done", logutil.Files(filesGroup),
zap.Duration("take", time.Since(fileStart)))
updateCh.Inc()
}
}()
return rc.fileImporter.ImportSSTFiles(ectx, fs, rewriteRules, rc.cipher, rc.dom.Store().GetCodec().GetAPIVersion())
}(filesGroup); importErr != nil {
Expand Down
8 changes: 3 additions & 5 deletions br/pkg/restore/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ func (importer *FileImporter) downloadRawKVSSTV2(
}
log.Debug("download SST", logutil.SSTMeta(sstMeta), logutil.Region(regionInfo.Region))

var atomicResp atomic.Value
var atomicResp atomic.Pointer[import_sstpb.DownloadResponse]
eg, ectx := errgroup.WithContext(ctx)
for _, p := range regionInfo.Region.GetPeers() {
peer := p
Expand All @@ -1176,7 +1176,7 @@ func (importer *FileImporter) downloadRawKVSSTV2(
return nil, err
}

downloadResp := atomicResp.Load().(*import_sstpb.DownloadResponse)
downloadResp := atomicResp.Load()
sstMeta.Range.Start = downloadResp.Range.GetStart()
sstMeta.Range.End = downloadResp.Range.GetEnd()
sstMeta.ApiVersion = apiVersion
Expand All @@ -1186,13 +1186,11 @@ func (importer *FileImporter) downloadRawKVSSTV2(
}

func (importer *FileImporter) ingest(
c context.Context,
ctx context.Context,
files []*backuppb.File,
info *split.RegionInfo,
downloadMetas []*import_sstpb.SSTMeta,
) error {
ctx, cancel := context.WithTimeout(c, gRPCTimeOut)
defer cancel()
for {
ingestResp, errIngest := importer.ingestSSTs(ctx, downloadMetas, info)
if errIngest != nil {
Expand Down

0 comments on commit 1cce48f

Please sign in to comment.