Skip to content

Commit

Permalink
ttl: Add CommandClient to trigger TTL job manually (#40346)
Browse files Browse the repository at this point in the history
close #40345
  • Loading branch information
lcwangchao authored Jan 10, 2023
1 parent f5362f9 commit 9826913
Show file tree
Hide file tree
Showing 8 changed files with 827 additions and 38 deletions.
2 changes: 1 addition & 1 deletion domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2483,7 +2483,7 @@ func (do *Domain) StartTTLJobManager() {
logutil.BgLogger().Info("ttlJobManager exited.")
}()

ttlJobManager := ttlworker.NewJobManager(do.ddl.GetID(), do.sysSessionPool, do.store)
ttlJobManager := ttlworker.NewJobManager(do.ddl.GetID(), do.sysSessionPool, do.store, do.etcdClient)
do.ttlJobManager = ttlJobManager
ttlJobManager.Start()

Expand Down
26 changes: 26 additions & 0 deletions ttl/client/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "client",
srcs = ["command.go"],
importpath = "github.com/pingcap/tidb/ttl/client",
visibility = ["//visibility:public"],
deps = [
"//util/logutil",
"@com_github_google_uuid//:uuid",
"@com_github_pingcap_errors//:errors",
"@io_etcd_go_etcd_client_v3//:client",
"@org_uber_go_zap//:zap",
],
)

go_test(
name = "client_test",
srcs = ["command_test.go"],
embed = [":client"],
deps = [
"@com_github_pingcap_errors//:errors",
"@com_github_stretchr_testify//require",
"@io_etcd_go_etcd_tests_v3//integration",
],
)
Loading

0 comments on commit 9826913

Please sign in to comment.