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

ddl: fix data race in the setDDLLabelForDiagnosis #36207

Merged
merged 8 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ func (dc *ddlCtx) setDDLSourceForDiagnosis(job *model.Job) {
ctx, exists := dc.jobCtx.jobCtxMap[job.ID]
if !exists {
ctx = NewJobContext()
ctx.setDDLLabelForDiagnosis(job)
dc.jobCtx.jobCtxMap[job.ID] = ctx
}
ctx.setDDLLabelForDiagnosis(job)
}

func (dc *ddlCtx) getResourceGroupTaggerForTopSQL(job *model.Job) tikvrpc.ResourceGroupTagger {
Expand Down
5 changes: 5 additions & 0 deletions executor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ go_library(
"//parser/model",
"//parser/mysql",
"//parser/terror",
"//parser/types",
"//planner",
"//planner/core",
"//planner/util",
Expand Down Expand Up @@ -215,6 +216,7 @@ go_library(
"@com_github_tikv_client_go_v2//oracle",
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_client_go_v2//tikvrpc",
"@com_github_tikv_client_go_v2//txnkv",
"@com_github_tikv_client_go_v2//txnkv/txnlock",
"@com_github_tikv_client_go_v2//txnkv/txnsnapshot",
"@com_github_tikv_client_go_v2//util",
Expand Down Expand Up @@ -342,6 +344,7 @@ go_test(
"//kv",
"//meta",
"//meta/autoid",
"//metrics",
"//parser",
"//parser/ast",
"//parser/auth",
Expand Down Expand Up @@ -419,6 +422,8 @@ go_test(
"@com_github_pingcap_sysutil//:sysutil",
"@com_github_pingcap_tipb//go-binlog",
"@com_github_pingcap_tipb//go-tipb",
"@com_github_prometheus_client_golang//prometheus",
"@com_github_prometheus_client_model//go",
"@com_github_prometheus_common//model",
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//oracle",
Expand Down
1 change: 1 addition & 0 deletions store/driver/txn/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ go_library(
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_client_go_v2//tikvrpc",
"@com_github_tikv_client_go_v2//tikvrpc/interceptor",
"@com_github_tikv_client_go_v2//txnkv",
"@com_github_tikv_client_go_v2//txnkv/transaction",
"@com_github_tikv_client_go_v2//txnkv/txnsnapshot",
"@com_github_tikv_client_go_v2//txnkv/txnutil",
Expand Down
7 changes: 7 additions & 0 deletions telemetry/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,21 @@ go_test(
embed = [":telemetry"],
deps = [
"//config",
"//ddl",
"//domain",
"//domain/infosync",
"//kv",
"//session",
"//sessionctx",
"//sessionctx/variable",
"//store/mockstore",
"//store/mockstore/unistore",
"//testkit",
"//testkit/testsetup",
"@com_github_jeffail_gabs_v2//:gabs",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//testutils",
"@io_etcd_go_etcd_tests_v3//integration",
"@org_uber_go_goleak//:goleak",
],
Expand Down