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 #1106

Merged
merged 2 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 @@ -38,6 +38,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"
)

// Filter are safe for concurrent use.
Expand Down
28 changes: 28 additions & 0 deletions pkg/filter/filter_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2025 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package filter

import (
"testing"

"github.com/pingcap/ticdc/pkg/config"
"github.com/stretchr/testify/require"
)

func TestFilterValue(t *testing.T) {
ft, err := NewFilter(&config.FilterConfig{}, "", false, false)
require.Nil(t, err)
ok := ft.ShouldIgnoreSchema(TiDBWorkloadSchema)
require.True(t, ok)
}
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/ticdc/issues/1105 .
case TiDBWorkloadSchema:
return true
default:
return tifilter.IsSystemSchema(db)
}
Expand Down