Skip to content

Commit 93082a4

Browse files
committed
Merge remote-tracking branch 'upstream/master' into test-fix-ut-create-drop-create
2 parents 3a7a6a5 + 464a126 commit 93082a4

File tree

1,441 files changed

+58872
-39296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,441 files changed

+58872
-39296
lines changed

.codecov.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,24 @@ flag_management:
7272

7373
ignore:
7474
- "LICENSES"
75-
- "*_test.go"
75+
- "**/*_test.go"
7676
- ".git"
77-
- "*.yml"
78-
- "*.md"
79-
- "cmd/.*"
80-
- "docs/.*"
81-
- "vendor/.*"
82-
- "pkg/ddl/failtest/.*"
83-
- "pkg/ddl/testutil/.*"
84-
- "pkg/executor/seqtest/.*"
85-
- "pkg/metrics/.*"
86-
- "pkg/expression/generator/.*"
87-
- "br/pkg/mock/.*"
88-
- "pkg/testkit/**/*"
89-
- "pkg/server/internal/testutil/**/*"
90-
- "pkg/statistics/handle/cache/internal/testutil/.*"
77+
- "**/*.yml"
78+
- "**/*.md"
79+
- "cmd"
80+
- "docs"
81+
- "vendor"
82+
- "pkg/ddl/failtest"
83+
- "pkg/ddl/testutil"
84+
- "pkg/executor/seqtest"
85+
- "pkg/metrics"
86+
- "pkg/expression/generator"
87+
- "br/pkg/mock"
88+
- "pkg/testkit"
89+
- "pkg/server/internal/testutil"
90+
- "pkg/statistics/handle/cache/internal/testutil"
9191
- "pkg/session/testutil.go"
9292
- "pkg/store/mockstore/unistore/testutil.go"
93-
- "k8s.io/apimachinery/pkg/**/*"
94-
- "build/**/*"
93+
- "k8s.io/apimachinery/pkg"
94+
- "build"
9595

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ updates:
1010
allow:
1111
- dependency-name: "golang.org/*"
1212
- dependency-name: "github.com/golangci/golangci-lint"
13+
- dependency-name: "github.com/mgechev/revive"
1314
- dependency-name: "github.com/prometheus/*"
1415
- dependency-name: "go.uber.org/*"
1516
open-pull-requests-limit: 2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tests/integrationtest/integration-test.out
1313
tests/integrationtest/integrationtest_tidb-server
1414
tests/integrationtest/portgenerator
1515
tests/integrationtest/s/
16+
tests/integrationtest/replayer/
1617
*.fail.go
1718
tools/bin/
1819
vendor
@@ -39,3 +40,4 @@ bazel-tidb
3940
*.log.json
4041
genkeyword
4142
test_coverage
43+
coverage.dat

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ linters:
2525
- predeclared
2626
- revive
2727
- lll
28+
- gofmt
2829

2930
linters-settings:
3031
staticcheck:
@@ -389,6 +390,13 @@ linters-settings:
389390
- name: waitgroup-by-value
390391
severity: warning
391392
disabled: false
393+
gofmt:
394+
# https://golangci-lint.run/usage/linters/#gofmt
395+
# disable for faster check
396+
simplify: false
397+
rewrite-rules:
398+
- pattern: 'interface{}'
399+
replacement: 'any'
392400
issues:
393401
exclude-rules:
394402
- path: _test\.go

DEPS.bzl

Lines changed: 992 additions & 944 deletions
Large diffs are not rendered by default.

MODULE.bazel.lock

Lines changed: 29 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ check: check-bazel-prepare parser_yacc check-parallel lint tidy testSuite errdoc
4444

4545
fmt:
4646
@echo "gofmt (simplify)"
47-
@gofmt -s -l -w $(FILES) 2>&1 | $(FAIL_ON_STDOUT)
47+
@gofmt -s -l -w -r 'interface{} -> any' $(FILES) 2>&1 | $(FAIL_ON_STDOUT)
4848

4949
check-static: tools/bin/golangci-lint
5050
GO111MODULE=on CGO_ENABLED=0 tools/bin/golangci-lint run -v $$($(PACKAGE_DIRECTORIES)) --config .golangci.yml
@@ -137,22 +137,19 @@ ut: tools/bin/ut tools/bin/xprog failpoint-enable
137137
gotest_in_verify_ci: tools/bin/xprog tools/bin/ut failpoint-enable
138138
@echo "Running gotest_in_verify_ci"
139139
@mkdir -p $(TEST_COVERAGE_DIR)
140-
@export TZ='Asia/Shanghai'; \
141140
tools/bin/ut --junitfile "$(TEST_COVERAGE_DIR)/tidb-junit-report.xml" --coverprofile "$(TEST_COVERAGE_DIR)/tidb_cov.unit_test.out" --except unstable.txt || { $(FAILPOINT_DISABLE); exit 1; }
142141
@$(FAILPOINT_DISABLE)
143142
@$(CLEAN_UT_BINARY)
144143

145144
gotest_unstable_in_verify_ci: tools/bin/xprog tools/bin/ut failpoint-enable
146-
@echo "Running gotest_in_verify_ci"
145+
@echo "Running gotest_unstable_in_verify_ci"
147146
@mkdir -p $(TEST_COVERAGE_DIR)
148-
@export TZ='Asia/Shanghai'; \
149147
tools/bin/ut --junitfile "$(TEST_COVERAGE_DIR)/tidb-junit-report.xml" --coverprofile "$(TEST_COVERAGE_DIR)/tidb_cov.unit_test.out" --only unstable.txt || { $(FAILPOINT_DISABLE); exit 1; }
150148
@$(FAILPOINT_DISABLE)
151149
@$(CLEAN_UT_BINARY)
152150

153151
race: failpoint-enable
154152
@mkdir -p $(TEST_COVERAGE_DIR)
155-
@export TZ='Asia/Shanghai'; \
156153
tools/bin/ut --race --junitfile "$(TEST_COVERAGE_DIR)/tidb-junit-report.xml" --coverprofile "$(TEST_COVERAGE_DIR)/tidb_cov.unit_test" --except unstable.txt || { $(FAILPOINT_DISABLE); exit 1; }
157154
@$(FAILPOINT_DISABLE)
158155
@$(CLEAN_UT_BINARY)
@@ -390,10 +387,11 @@ gen_mock: mockgen
390387
tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor TaskTable,Pool,TaskExecutor,Extension > pkg/disttask/framework/mock/task_executor_mock.go
391388
tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/disttask/framework/scheduler Scheduler,CleanUpRoutine,TaskManager > pkg/disttask/framework/mock/scheduler_mock.go
392389
tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/disttask/framework/scheduler Extension > pkg/disttask/framework/scheduler/mock/scheduler_mock.go
393-
tools/bin/mockgen -package execute github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/execute SubtaskExecutor > pkg/disttask/framework/mock/execute/execute_mock.go
390+
tools/bin/mockgen -package execute github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/execute StepExecutor > pkg/disttask/framework/mock/execute/execute_mock.go
394391
tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/disttask/importinto MiniTaskExecutor > pkg/disttask/importinto/mock/import_mock.go
395392
tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/disttask/framework/planner LogicalPlan,PipelineSpec > pkg/disttask/framework/mock/plan_mock.go
396393
tools/bin/mockgen -package mock github.com/pingcap/tidb/pkg/util/sqlexec RestrictedSQLExecutor > pkg/util/sqlexec/mock/restricted_sql_executor_mock.go
394+
tools/bin/mockgen -package mockstorage github.com/pingcap/tidb/br/pkg/storage ExternalStorage > br/pkg/mock/storage/storage.go
397395

398396
# There is no FreeBSD environment for GitHub actions. So cross-compile on Linux
399397
# but that doesn't work with CGO_ENABLED=1, so disable cgo. The reason to have

OWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ approvers:
104104
- you06
105105
- youjiali1995
106106
- YuJuncen
107+
- ywqzzy
107108
- zanmato1984
108109
- zhaoxinyu
109110
- zhouqiang-cl
@@ -145,7 +146,7 @@ reviewers:
145146
- TonsnakeLin
146147
- tsthght
147148
- TszKitLo40
148-
- ywqzzy
149+
- xzhangxian1008
149150
- zhangjinpeng1987
150151
- zhongzc
151152
- zhuo-zhi

WORKSPACE

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ versions.check(minimum_bazel_version = "6.0.0")
1616

1717
http_archive(
1818
name = "io_bazel_rules_go",
19-
sha256 = "c8035e8ae248b56040a65ad3f0b7434712e2037e5dfdcebfe97576e620422709",
19+
sha256 = "80a98277ad1311dacd837f9b16db62887702e9f1d1c4c9f796d0121a46c8e184",
2020
urls = [
21-
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.44.0/rules_go-v0.44.0.zip",
22-
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.44.0/rules_go-v0.44.0.zip",
23-
"https://github.com/bazelbuild/rules_go/releases/download/v0.44.0/rules_go-v0.44.0.zip",
24-
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.44.0/rules_go-v0.44.0.zip",
21+
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
22+
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
23+
"https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
24+
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
2525
],
2626
)
2727

2828
http_archive(
2929
name = "bazel_gazelle",
30-
sha256 = "b7387f72efb59f876e4daae42f1d3912d0d45563eac7cb23d1de0b094ab588cf",
30+
sha256 = "32938bda16e6700063035479063d9d24c60eda8d79fd4739563f50d331cb3209",
3131
urls = [
32-
"http://bazel-cache.pingcap.net:8080/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
33-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
34-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
35-
"http://ats.apps.svc/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz",
32+
"http://bazel-cache.pingcap.net:8080/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
33+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
34+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
35+
"http://ats.apps.svc/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
3636
],
3737
)
3838

@@ -64,7 +64,7 @@ go_download_sdk(
6464
"https://mirrors.aliyun.com/golang/{}",
6565
"https://dl.google.com/go/{}",
6666
],
67-
version = "1.21.5",
67+
version = "1.21.6",
6868
)
6969

7070
go_register_toolchains(

br/cmd/br/backup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ func runBackupCommand(command *cobra.Command, cmdName string) error {
4545
return nil
4646
}
4747

48-
if cfg.IgnoreStats {
49-
// Do not run stat worker in BR.
50-
session.DisableStats4Test()
51-
}
48+
// No need to cache the coproceesor result
49+
config.GetGlobalConfig().TiKVClient.CoprCache.CapacityMB = 0
5250

5351
if err := task.RunBackup(ctx, tidbGlue, cmdName, &cfg); err != nil {
5452
log.Error("failed to backup", zap.Error(err))
@@ -110,6 +108,8 @@ func NewBackupCommand() *cobra.Command {
110108
build.LogInfo(build.BR)
111109
utils.LogEnvVariables()
112110
task.LogArguments(c)
111+
// Do not run stat worker in BR.
112+
session.DisableStats4Test()
113113

114114
// Do not run ddl worker in BR.
115115
config.GetGlobalConfig().Instance.TiDBEnableDDL.Store(false)

0 commit comments

Comments
 (0)