Skip to content

Commit

Permalink
statistics: handle DDL events in the new PQ (#56435)
Browse files Browse the repository at this point in the history
ref #55906
  • Loading branch information
Rustin170506 authored Oct 8, 2024
1 parent 940e29c commit 5f02b09
Show file tree
Hide file tree
Showing 4 changed files with 1,012 additions and 7 deletions.
7 changes: 6 additions & 1 deletion pkg/statistics/handle/autoanalyze/priorityqueue/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_library(
"non_partitioned_table_analysis_job.go",
"queue.go",
"queue_v2.go",
"queue_v2_ddl_handler.go",
"static_partitioned_table_analysis_job.go",
],
importpath = "github.com/pingcap/tidb/pkg/statistics/handle/autoanalyze/priorityqueue",
Expand Down Expand Up @@ -50,18 +51,22 @@ go_test(
"main_test.go",
"non_partitioned_table_analysis_job_test.go",
"queue_test.go",
"queue_v2_ddl_handler_test.go",
"queue_v2_test.go",
"static_partitioned_table_analysis_job_test.go",
],
flaky = True,
shard_count = 34,
shard_count = 46,
deps = [
":priorityqueue",
"//pkg/ddl/notifier",
"//pkg/domain",
"//pkg/meta/model",
"//pkg/parser/model",
"//pkg/session",
"//pkg/sessionctx",
"//pkg/statistics",
"//pkg/statistics/handle/util",
"//pkg/testkit",
"//pkg/testkit/testsetup",
"@com_github_stretchr_testify//require",
Expand Down
6 changes: 0 additions & 6 deletions pkg/statistics/handle/autoanalyze/priorityqueue/queue_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"time"

"github.com/pingcap/errors"
"github.com/pingcap/tidb/pkg/ddl/notifier"
"github.com/pingcap/tidb/pkg/infoschema"
"github.com/pingcap/tidb/pkg/meta/model"
"github.com/pingcap/tidb/pkg/sessionctx"
Expand Down Expand Up @@ -479,11 +478,6 @@ func (pq *AnalysisPriorityQueueV2) GetRunningJobs() map[int64]struct{} {
return runningJobs
}

func (*AnalysisPriorityQueueV2) handleDDLEvent(_ context.Context, _ sessionctx.Context, _ notifier.SchemaChangeEvent) {
// TODO: Handle the ddl event.
// Only care about the add index event.
}

// Push pushes a job into the priority queue.
// Note: This function is thread-safe.
func (pq *AnalysisPriorityQueueV2) Push(job AnalysisJob) error {
Expand Down
Loading

0 comments on commit 5f02b09

Please sign in to comment.