Skip to content

Commit f3afd71

Browse files
lcwangchaoti-chi-bot
authored andcommitted
This is an automated cherry-pick of pingcap#59358
Signed-off-by: ti-chi-bot <[email protected]>
1 parent 6921c31 commit f3afd71

File tree

6 files changed

+4282
-1
lines changed

6 files changed

+4282
-1
lines changed

metrics/grafana/tidb.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19054,7 +19054,7 @@
1905419054
"targets": [
1905519055
{
1905619056
"exemplar": true,
19057-
"expr": "avg(tidb_server_ttl_watermark_delay{k8s_cluster=\"$k8s_cluster\",tidb_cluster=\"$tidb_cluster\", type=\"schedule\"}) by (type, name)",
19057+
"expr": "max(tidb_server_ttl_watermark_delay{k8s_cluster=\"$k8s_cluster\",tidb_cluster=\"$tidb_cluster\", type=\"schedule\"}) by (type, name)",
1905819058
"interval": "",
1905919059
"legendFormat": "{{ name }}",
1906019060
"queryType": "randomWalk",

pkg/ttl/ttlworker/BUILD.bazel

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
2+
3+
go_library(
4+
name = "ttlworker",
5+
srcs = [
6+
"config.go",
7+
"del.go",
8+
"job.go",
9+
"job_manager.go",
10+
"scan.go",
11+
"session.go",
12+
"task_manager.go",
13+
"timer.go",
14+
"timer_sync.go",
15+
"worker.go",
16+
],
17+
importpath = "github.com/pingcap/tidb/pkg/ttl/ttlworker",
18+
visibility = ["//visibility:public"],
19+
deps = [
20+
"//pkg/infoschema",
21+
"//pkg/infoschema/context",
22+
"//pkg/kv",
23+
"//pkg/meta/model",
24+
"//pkg/metrics",
25+
"//pkg/parser/ast",
26+
"//pkg/parser/terror",
27+
"//pkg/sessionctx",
28+
"//pkg/sessionctx/vardef",
29+
"//pkg/store/driver/error",
30+
"//pkg/timer/api",
31+
"//pkg/timer/runtime",
32+
"//pkg/timer/tablestore",
33+
"//pkg/ttl/cache",
34+
"//pkg/ttl/client",
35+
"//pkg/ttl/metrics",
36+
"//pkg/ttl/session",
37+
"//pkg/ttl/sqlbuilder",
38+
"//pkg/types",
39+
"//pkg/util",
40+
"//pkg/util/chunk",
41+
"//pkg/util/intest",
42+
"//pkg/util/logutil",
43+
"//pkg/util/sqlexec",
44+
"//pkg/util/timeutil",
45+
"@com_github_pingcap_errors//:errors",
46+
"@com_github_pingcap_failpoint//:failpoint",
47+
"@com_github_tikv_client_go_v2//tikv",
48+
"@com_github_tikv_client_go_v2//tikvrpc",
49+
"@io_etcd_go_etcd_client_v3//:client",
50+
"@org_golang_x_exp//maps",
51+
"@org_golang_x_time//rate",
52+
"@org_uber_go_multierr//:multierr",
53+
"@org_uber_go_zap//:zap",
54+
],
55+
)
56+
57+
go_test(
58+
name = "ttlworker_test",
59+
timeout = "moderate",
60+
srcs = [
61+
"del_test.go",
62+
"job_manager_integration_test.go",
63+
"job_manager_test.go",
64+
"scan_integration_test.go",
65+
"scan_test.go",
66+
"session_integration_test.go",
67+
"session_test.go",
68+
"task_manager_integration_test.go",
69+
"task_manager_test.go",
70+
"timer_sync_test.go",
71+
"timer_test.go",
72+
],
73+
embed = [":ttlworker"],
74+
flaky = True,
75+
race = "on",
76+
shard_count = 50,
77+
deps = [
78+
"//pkg/domain",
79+
"//pkg/infoschema",
80+
"//pkg/infoschema/context",
81+
"//pkg/kv",
82+
"//pkg/meta/model",
83+
"//pkg/metrics",
84+
"//pkg/parser/ast",
85+
"//pkg/parser/mysql",
86+
"//pkg/sessionctx",
87+
"//pkg/sessionctx/vardef",
88+
"//pkg/sessionctx/variable",
89+
"//pkg/statistics",
90+
"//pkg/store/mockstore",
91+
"//pkg/testkit",
92+
"//pkg/testkit/testfailpoint",
93+
"//pkg/testkit/testflag",
94+
"//pkg/timer/api",
95+
"//pkg/timer/tablestore",
96+
"//pkg/ttl/cache",
97+
"//pkg/ttl/client",
98+
"//pkg/ttl/metrics",
99+
"//pkg/ttl/session",
100+
"//pkg/types",
101+
"//pkg/util",
102+
"//pkg/util/chunk",
103+
"//pkg/util/logutil",
104+
"//pkg/util/mock",
105+
"//pkg/util/skip",
106+
"//pkg/util/sqlexec",
107+
"//pkg/util/timeutil",
108+
"@com_github_google_uuid//:uuid",
109+
"@com_github_ngaut_pools//:pools",
110+
"@com_github_pingcap_errors//:errors",
111+
"@com_github_pingcap_failpoint//:failpoint",
112+
"@com_github_prometheus_client_golang//prometheus",
113+
"@com_github_prometheus_client_model//go",
114+
"@com_github_stretchr_testify//assert",
115+
"@com_github_stretchr_testify//mock",
116+
"@com_github_stretchr_testify//require",
117+
"@com_github_tikv_client_go_v2//testutils",
118+
"@com_github_tikv_client_go_v2//tikv",
119+
"@com_github_tikv_client_go_v2//tikvrpc",
120+
"@org_golang_x_time//rate",
121+
"@org_uber_go_atomic//:atomic",
122+
"@org_uber_go_zap//:zap",
123+
],
124+
)

0 commit comments

Comments
 (0)