-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into speedup-gc-stat
- Loading branch information
Showing
1,027 changed files
with
97,054 additions
and
23,101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE | ||
|
||
COPYRIGHT AND PERMISSION NOTICE | ||
|
||
Copyright © 1991-2023 Unicode, Inc. | ||
|
||
NOTICE TO USER: Carefully read the following legal agreement. BY | ||
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR | ||
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE | ||
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT | ||
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a | ||
copy of data files and any associated documentation (the "Data Files") or | ||
software and any associated documentation (the "Software") to deal in the | ||
Data Files or Software without restriction, including without limitation | ||
the rights to use, copy, modify, merge, publish, distribute, and/or sell | ||
copies of the Data Files or Software, and to permit persons to whom the | ||
Data Files or Software are furnished to do so, provided that either (a) | ||
this copyright and permission notice appear with all copies of the Data | ||
Files or Software, or (b) this copyright and permission notice appear in | ||
associated Documentation. | ||
|
||
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | ||
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF | ||
THIRD PARTY RIGHTS. | ||
|
||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE | ||
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, | ||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | ||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | ||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA | ||
FILES OR SOFTWARE. | ||
|
||
Except as contained in this notice, the name of a copyright holder shall | ||
not be used in advertising or otherwise to promote the sale, use or other | ||
dealings in these Data Files or Software without prior written | ||
authorization of the copyright holder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,14 @@ | |
|
||
include Makefile.common | ||
|
||
.PHONY: all clean test server dev benchkv benchraw check checklist parser tidy ddltest build_br build_lightning build_lightning-ctl build_dumpling ut bazel_build bazel_prepare bazel_test check-file-perm check-bazel-prepare bazel_lint tazel precheck | ||
.PHONY: help all clean test server dev benchkv benchraw check checklist parser tidy ddltest build_br build_lightning build_lightning-ctl build_dumpling ut bazel_build bazel_prepare bazel_test check-file-perm check-bazel-prepare bazel_lint tazel precheck | ||
|
||
.DEFAULT_GOAL := default | ||
|
||
# Adapted from https://www.thapaliya.com/en/writings/well-documented-makefiles/ | ||
help: ## Display this help and any documented user-facing targets. Other undocumented targets may be present in the Makefile. | ||
help: | ||
@awk 'BEGIN {FS = ": ##"; printf "Usage:\n make <target>\n\nTargets:\n"} /^[a-zA-Z0-9_\.\-\/%]+: ##/ { printf " %-45s %s\n", $$1, $$2 }' $(MAKEFILE_LIST) | ||
|
||
default: server buildsucc | ||
|
||
|
@@ -112,7 +119,9 @@ test_part_br: br_unit_test br_integration_test | |
test_part_dumpling: dumpling_unit_test dumpling_integration_test | ||
|
||
explaintest: server_check | ||
@cd cmd/explaintest && ./run-tests.sh -s ../../bin/tidb-server | ||
@mkdir -p $(TEST_COVERAGE_DIR) | ||
@cd cmd/explaintest && GOCOVERDIR=../../$(TEST_COVERAGE_DIR) ./run-tests.sh -s ../../bin/tidb-server | ||
@$(GO) tool covdata textfmt -i=$(TEST_COVERAGE_DIR) -o=coverage.dat | ||
|
||
ddltest: | ||
@cd cmd/ddltest && $(GO) test --tags=deadllock,intest -o ../../bin/ddltest -c | ||
|
@@ -188,9 +197,9 @@ enterprise-server: | |
|
||
server_check: | ||
ifeq ($(TARGET), "") | ||
$(GOBUILD) $(RACE_FLAG) -ldflags '$(CHECK_LDFLAGS)' -o bin/tidb-server ./tidb-server | ||
$(GOBUILD) -cover $(RACE_FLAG) -ldflags '$(CHECK_LDFLAGS)' -o bin/tidb-server ./tidb-server | ||
else | ||
$(GOBUILD) $(RACE_FLAG) -ldflags '$(CHECK_LDFLAGS)' -o '$(TARGET)' ./tidb-server | ||
$(GOBUILD) -cover $(RACE_FLAG) -ldflags '$(CHECK_LDFLAGS)' -o '$(TARGET)' ./tidb-server | ||
endif | ||
|
||
linux: | ||
|
@@ -257,6 +266,9 @@ tools/bin/vfsgendev: | |
tools/bin/gotestsum: | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install gotest.tools/[email protected] | ||
|
||
tools/bin/mockgen: | ||
GOBIN=$(shell pwd)/tools/bin $(GO) install go.uber.org/mock/[email protected] | ||
|
||
# Usage: | ||
# | ||
# $ make vectorized-bench VB_FILE=Time VB_FUNC=builtinCurrentDateSig | ||
|
@@ -361,15 +373,18 @@ br_compatibility_test_prepare: | |
br_compatibility_test: | ||
@cd br && tests/run_compatible.sh run | ||
|
||
mock_s3iface: | ||
@mockgen -package mock github.com/aws/aws-sdk-go/service/s3/s3iface S3API > br/pkg/mock/s3iface.go | ||
mock_s3iface: tools/bin/mockgen | ||
tools/bin/mockgen -package mock github.com/aws/aws-sdk-go/service/s3/s3iface S3API > br/pkg/mock/s3iface.go | ||
|
||
# mock interface for lightning and IMPORT INTO | ||
mock_lightning: | ||
@mockgen -package mock github.com/pingcap/tidb/br/pkg/lightning/backend Backend,EngineWriter,TargetInfoGetter,ChunkFlushStatus > br/pkg/mock/backend.go | ||
@mockgen -package mock github.com/pingcap/tidb/br/pkg/lightning/backend/encode Encoder,EncodingBuilder,Rows,Row > br/pkg/mock/encode.go | ||
@mockgen -package mocklocal github.com/pingcap/tidb/br/pkg/lightning/backend/local DiskUsage,TiKVModeSwitcher > br/pkg/mock/mocklocal/local.go | ||
@mockgen -package mock github.com/pingcap/tidb/br/pkg/utils TaskRegister > br/pkg/mock/task_register.go | ||
mock_lightning: tools/bin/mockgen | ||
tools/bin/mockgen -package mock github.com/pingcap/tidb/br/pkg/lightning/backend Backend,EngineWriter,TargetInfoGetter,ChunkFlushStatus > br/pkg/mock/backend.go | ||
tools/bin/mockgen -package mock github.com/pingcap/tidb/br/pkg/lightning/backend/encode Encoder,EncodingBuilder,Rows,Row > br/pkg/mock/encode.go | ||
tools/bin/mockgen -package mocklocal github.com/pingcap/tidb/br/pkg/lightning/backend/local DiskUsage,TiKVModeSwitcher > br/pkg/mock/mocklocal/local.go | ||
tools/bin/mockgen -package mock github.com/pingcap/tidb/br/pkg/utils TaskRegister > br/pkg/mock/task_register.go | ||
|
||
gen_mock: tools/bin/mockgen | ||
tools/bin/mockgen -package mock github.com/pingcap/tidb/disttask/framework/scheduler TaskTable,SubtaskExecutor,Pool,Scheduler,InternalScheduler > disttask/framework/mock/scheduler_mock.go | ||
|
||
# There is no FreeBSD environment for GitHub actions. So cross-compile on Linux | ||
# but that doesn't work with CGO_ENABLED=1, so disable cgo. The reason to have | ||
|
@@ -440,7 +455,13 @@ bazel_ci_prepare: | |
--run_under="cd $(CURDIR) && " \ | ||
//tools/tazel:tazel | ||
|
||
bazel_prepare: | ||
bazel_ci_simple_prepare: | ||
bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) //:gazelle | ||
bazel $(BAZEL_GLOBAL_CONFIG) run $(BAZEL_CMD_CONFIG) \ | ||
--run_under="cd $(CURDIR) && " \ | ||
//tools/tazel:tazel | ||
|
||
bazel_prepare: ## Update and generate BUILD.bazel files. Please run this before commit. | ||
bazel run //:gazelle | ||
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro DEPS.bzl%go_deps -build_file_proto_mode=disable -prune | ||
bazel run \ | ||
|
@@ -469,7 +490,7 @@ bazel_test: failpoint-enable bazel_prepare | |
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... | ||
|
||
|
||
bazel_coverage_test: check-bazel-prepare failpoint-enable bazel_ci_prepare | ||
bazel_coverage_test: check-bazel-prepare failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) --jobs=35 --build_tests_only --test_keep_going=false \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \ | ||
-- //... -//cmd/... -//tests/graceshutdown/... \ | ||
|
@@ -506,49 +527,70 @@ bazel_golangcilinter: | |
@com_github_golangci_golangci_lint//cmd/golangci-lint:golangci-lint \ | ||
-- run $$($(PACKAGE_DIRECTORIES)) --config ./.golangci.yaml | ||
|
||
bazel_brietest: failpoint-enable bazel_ci_prepare | ||
bazel_brietest: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/brietest/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
bazel_pessimistictest: failpoint-enable bazel_ci_prepare | ||
bazel_pessimistictest: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/pessimistictest/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
bazel_sessiontest: failpoint-enable bazel_ci_prepare | ||
bazel_sessiontest: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/sessiontest/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
bazel_statisticstest: failpoint-enable bazel_ci_prepare | ||
bazel_statisticstest: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/statisticstest/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
bazel_txntest: failpoint-enable bazel_ci_prepare | ||
bazel_txntest: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/txntest/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
bazel_addindextest: failpoint-enable bazel_ci_prepare | ||
bazel_addindextest: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/addindextest/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always | ||
bazel_importintotest: failpoint-enable bazel_ci_prepare | ||
bazel_importintotest: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/importintotest/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always | ||
bazel_importintotest2: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/importintotest2/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always | ||
bazel_importintotest3: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/importintotest3/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always | ||
bazel_importintotest4: failpoint-enable bazel_ci_simple_prepare | ||
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \ | ||
--@io_bazel_rules_go//go/config:cover_format=go_cover \ | ||
-- //tests/realtikvtest/importintotest4/... | ||
./build/jenkins_collect_coverage.sh | ||
|
||
bazel_lint: bazel_prepare | ||
bazel build //... --//build:with_nogo_flag=true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ reviewers: | |
- TonsnakeLin | ||
- tsthght | ||
- TszKitLo40 | ||
- ywqzzy | ||
- zhangjinpeng1987 | ||
- zhongzc | ||
- zhuo-zhi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.