Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: support the vector index #56403

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
378 changes: 85 additions & 293 deletions DEPS.bzl

Large diffs are not rendered by default.

29 changes: 23 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,16 @@ endif
# make bench-daily TO=/path/to/file.json
.PHONY: bench-daily
bench-daily:
go test github.com/pingcap/tidb/pkg/session -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/distsql -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/executor -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/executor/test/splittest -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/tablecodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/expression -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/util/rowcodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/util/codec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/distsql -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/planner/core/tests/partition -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/session -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/statistics -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/tablecodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/util/codec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/util/rowcodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test github.com/pingcap/tidb/pkg/util/benchdaily -run TestBenchDaily -bench Ignore \
-date `git log -n1 --date=unix --pretty=format:%cd` \
-commit `git log -n1 --pretty=format:%h` \
Expand Down Expand Up @@ -565,7 +566,15 @@ dumpling_bins:

.PHONY: generate_grafana_scripts
generate_grafana_scripts:
@cd metrics/grafana && mv tidb_summary.json tidb_summary.json.committed && ./generate_json.sh && diff -u tidb_summary.json.committed tidb_summary.json && rm tidb_summary.json.committed
@cd pkg/metrics/grafana && \
mv tidb_summary.json tidb_summary.json.committed && \
mv tidb_resource_control.json tidb_resource_control.json.committed && \
./generate_json.sh && \
diff -u tidb_summary.json.committed tidb_summary.json && \
diff -u tidb_resource_control.json.committed tidb_resource_control.json && \
rm tidb_summary.json.committed && \
rm tidb_resource_control.json.committed


.PHONY: bazel_ci_prepare
bazel_ci_prepare:
Expand Down Expand Up @@ -623,6 +632,14 @@ bazel_coverage_test: failpoint-enable bazel_ci_simple_prepare
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...

.PHONY: bazel_coverage_test_ddlargsv1
bazel_coverage_test_ddlargsv1: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) --nohome_rc coverage $(BAZEL_CMD_CONFIG) $(BAZEL_INSTRUMENTATION_FILTER) --jobs=35 --build_tests_only --test_keep_going=false \
--@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=deadlock,intest \
--define gc_linkopts=-X,github.com/pingcap/tidb/pkg/ddl.ForceDDLJobVersionToV1InTest=true \
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...

.PHONY: bazel_build
bazel_build:
mkdir -p bin
Expand Down
3 changes: 3 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ approvers:
- winoros
- WizardXiao
- wjhuang2016
- wk989898
- wshwsh12
- xhebox
- xiongjiwei
Expand Down Expand Up @@ -127,6 +128,7 @@ reviewers:
- dhysum
- fengou1
- fzzf678
- ghazalfamilyusa
- iamxy
- JmPotato
- js00070
Expand All @@ -145,6 +147,7 @@ reviewers:
- shihongzhi
- spongedu
- tangwz
- terry1purcell
- Tjianke
- TonsnakeLin
- tsthght
Expand Down
4 changes: 2 additions & 2 deletions br/cmd/br/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ func runRestoreCommand(command *cobra.Command, cmdName string) error {

if err := task.RunRestore(GetDefaultContext(), tidbGlue, cmdName, &cfg); err != nil {
log.Error("failed to restore", zap.Error(err))
printWorkaroundOnFullRestoreError(command, err)
printWorkaroundOnFullRestoreError(err)
return errors.Trace(err)
}
return nil
}

// print workaround when we met not fresh or incompatible cluster error on full cluster restore
func printWorkaroundOnFullRestoreError(command *cobra.Command, err error) {
func printWorkaroundOnFullRestoreError(err error) {
if !errors.ErrorEqual(err, berrors.ErrRestoreNotFreshCluster) &&
!errors.ErrorEqual(err, berrors.ErrRestoreIncompatibleSys) {
return
Expand Down
11 changes: 10 additions & 1 deletion br/pkg/checkpoint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,30 @@ go_library(
srcs = [
"backup.go",
"checkpoint.go",
"external_storage.go",
"log_restore.go",
"restore.go",
"storage.go",
"ticker.go",
],
importpath = "github.com/pingcap/tidb/br/pkg/checkpoint",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/glue",
"//br/pkg/logutil",
"//br/pkg/metautil",
"//br/pkg/pdutil",
"//br/pkg/rtree",
"//br/pkg/storage",
"//br/pkg/summary",
"//br/pkg/utils",
"//pkg/domain",
"//pkg/kv",
"//pkg/meta/model",
"//pkg/parser/model",
"//pkg/util",
"//pkg/util/sqlexec",
"@com_github_google_uuid//:uuid",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_kvproto//pkg/brpb",
Expand All @@ -38,11 +45,13 @@ go_test(
srcs = ["checkpoint_test.go"],
flaky = True,
race = "on",
shard_count = 5,
shard_count = 6,
deps = [
":checkpoint",
"//br/pkg/gluetidb",
"//br/pkg/pdutil",
"//br/pkg/storage",
"//br/pkg/utiltest",
"//pkg/meta/model",
"//pkg/parser/model",
"@com_github_pingcap_kvproto//pkg/brpb",
Expand Down
18 changes: 9 additions & 9 deletions br/pkg/checkpoint/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ func StartCheckpointBackupRunnerForTest(
tick time.Duration,
timer GlobalTimer,
) (*CheckpointRunner[BackupKeyType, BackupValueType], error) {
runner := newCheckpointRunner[BackupKeyType, BackupValueType](
ctx, storage, cipher, timer, flushPositionForBackup(), valueMarshalerForBackup)

err := runner.initialLock(ctx)
checkpointStorage, err := newExternalCheckpointStorage(ctx, storage, timer)
if err != nil {
return nil, errors.Annotate(err, "Failed to initialize checkpoint lock.")
return nil, errors.Trace(err)
}
runner := newCheckpointRunner[BackupKeyType, BackupValueType](
checkpointStorage, cipher, valueMarshalerForBackup)

runner.startCheckpointMainLoop(ctx, tick, tick, tick)
return runner, nil
}
Expand All @@ -74,13 +74,13 @@ func StartCheckpointRunnerForBackup(
cipher *backuppb.CipherInfo,
timer GlobalTimer,
) (*CheckpointRunner[BackupKeyType, BackupValueType], error) {
runner := newCheckpointRunner[BackupKeyType, BackupValueType](
ctx, storage, cipher, timer, flushPositionForBackup(), valueMarshalerForBackup)

err := runner.initialLock(ctx)
checkpointStorage, err := newExternalCheckpointStorage(ctx, storage, timer)
if err != nil {
return nil, errors.Trace(err)
}
runner := newCheckpointRunner[BackupKeyType, BackupValueType](
checkpointStorage, cipher, valueMarshalerForBackup)

runner.startCheckpointMainLoop(
ctx,
defaultTickDurationForFlush,
Expand Down
Loading