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

utils: skip workload schema hack #12095

Merged
merged 3 commits into from
Mar 19, 2025
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const (
TiCDCSystemSchema = "tidb_cdc"
// LightningTaskInfoSchema is the schema only generated by Lightning
LightningTaskInfoSchema = "lightning_task_info"
// TiDBWorkloadSchema is the schema that needs to be skipped by TiCDC.
TiDBWorkloadSchema = "workload_schema"
)

// ddlWhiteListMap is a map of all DDL types that can be applied to cdc's schema storage.
Expand Down
1 change: 1 addition & 0 deletions pkg/filter/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func TestShouldUseDefaultRules(t *testing.T) {
require.True(t, filter.ShouldIgnoreTable("information_schema", ""))
require.True(t, filter.ShouldIgnoreTable("information_schema", "statistics"))
require.True(t, filter.ShouldIgnoreTable("performance_schema", ""))
require.True(t, filter.ShouldIgnoreTable(TiDBWorkloadSchema, "hist_snapshots"))
require.False(t, filter.ShouldIgnoreTable("metric_schema", "query_duration"))
require.False(t, filter.ShouldIgnoreTable("sns", "user"))
require.True(t, filter.ShouldIgnoreTable("tidb_cdc", "repl_mark_a_a"))
Expand Down
3 changes: 3 additions & 0 deletions pkg/filter/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ func isSysSchema(db string) bool {
return true
case LightningTaskInfoSchema:
return true
// TODO: skip workload schema, ref https://github.com/pingcap/tiflow/issues/12084 .
case TiDBWorkloadSchema:
return true
default:
return tifilter.IsSystemSchema(db)
}
Expand Down
Loading