Skip to content

Commit

Permalink
filter(ticdc): Add lightning_task_info as the system table schema t…
Browse files Browse the repository at this point in the history
…hat should not be replicated by TiCDC (#11359) (#11362)

close #11356
  • Loading branch information
ti-chi-bot authored Jun 28, 2024
1 parent a2e6219 commit 29aac52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const (
SyncPointTable = "syncpoint_v1"
// TiCDCSystemSchema is the schema only use by TiCDC.
TiCDCSystemSchema = "tidb_cdc"
// LightningTaskInfoSchema is the schema only generated by Lightning
LightningTaskInfoSchema = "lightning_task_info"
)

// 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 @@ -34,6 +34,7 @@ func TestShouldUseDefaultRules(t *testing.T) {
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"))
require.True(t, filter.ShouldIgnoreTable("lightning_task_info", "conflict_records"))
}

func TestShouldUseCustomRules(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/filter/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func isSysSchema(db string) bool {
// Tables in TiCDCSystemSchema should not be replicated by cdc.
case TiCDCSystemSchema:
return true
case LightningTaskInfoSchema:
return true
default:
return tifilter.IsSystemSchema(db)
}
Expand Down

0 comments on commit 29aac52

Please sign in to comment.