diff --git a/cdc/model/changefeed_test.go b/cdc/model/changefeed_test.go index 454f95165a5..8fcfcf24bb5 100644 --- a/cdc/model/changefeed_test.go +++ b/cdc/model/changefeed_test.go @@ -71,7 +71,7 @@ func (s *configSuite) TestFillV1(c *check.C) { 1, 2 ], - "ddl-white-list":"AQI=" + "ddl-allow-list":"AQI=" }, "mounter":{ "worker-num":64 @@ -134,7 +134,7 @@ func (s *configSuite) TestFillV1(c *check.C) { IgnoreDBs: []string{"test", "sys"}, }, IgnoreTxnStartTs: []uint64{1, 2}, - DDLWhitelist: []model.ActionType{1, 2}, + DDLAllowlist: []model.ActionType{1, 2}, }, Mounter: &config.MounterConfig{ WorkerNum: 64, diff --git a/cmd/cmd_test.go b/cmd/cmd_test.go index c1de836f041..f107e8c63ee 100644 --- a/cmd/cmd_test.go +++ b/cmd/cmd_test.go @@ -38,7 +38,7 @@ case-sensitive = false [filter] ignore-txn-start-ts = [1, 2] -ddl-white-list = [1, 2] +ddl-allow-list = [1, 2] rules = ['*.*', '!test.*'] [mounter] @@ -72,7 +72,7 @@ polling-time = 5 c.Assert(cfg.CaseSensitive, check.IsFalse) c.Assert(cfg.Filter, check.DeepEquals, &config.FilterConfig{ IgnoreTxnStartTs: []uint64{1, 2}, - DDLWhitelist: []model.ActionType{1, 2}, + DDLAllowlist: []model.ActionType{1, 2}, Rules: []string{"*.*", "!test.*"}, }) c.Assert(cfg.Mounter, check.DeepEquals, &config.MounterConfig{ diff --git a/pkg/config/filter.go b/pkg/config/filter.go index 5c6850de7b0..688eaa46408 100644 --- a/pkg/config/filter.go +++ b/pkg/config/filter.go @@ -23,5 +23,5 @@ type FilterConfig struct { Rules []string `toml:"rules" json:"rules"` *filter.MySQLReplicationRules IgnoreTxnStartTs []uint64 `toml:"ignore-txn-start-ts" json:"ignore-txn-start-ts"` - DDLWhitelist []model.ActionType `toml:"ddl-white-list" json:"ddl-white-list"` + DDLAllowlist []model.ActionType `toml:"ddl-allow-list" json:"ddl-allow-list"` } diff --git a/pkg/filter/filter.go b/pkg/filter/filter.go index e80867f68b8..d10e4eaac71 100644 --- a/pkg/filter/filter.go +++ b/pkg/filter/filter.go @@ -27,7 +27,7 @@ import ( type Filter struct { filter filter.Filter ignoreTxnStartTs []uint64 - ddlWhitelist []model.ActionType + ddlAllowlist []model.ActionType isCyclicEnabled bool } @@ -53,7 +53,7 @@ func NewFilter(cfg *config.ReplicaConfig) (*Filter, error) { return &Filter{ filter: f, ignoreTxnStartTs: cfg.Filter.IgnoreTxnStartTs, - ddlWhitelist: cfg.Filter.DDLWhitelist, + ddlAllowlist: cfg.Filter.DDLAllowlist, isCyclicEnabled: cfg.Cyclic.IsEnabled(), }, nil } @@ -94,18 +94,18 @@ func (f *Filter) ShouldIgnoreDDLEvent(ts uint64, schema, table string) bool { // ShouldDiscardDDL returns true if this DDL should be discarded func (f *Filter) ShouldDiscardDDL(ddlType model.ActionType) bool { - if !f.shouldDiscardByBuiltInDDLWhitelist(ddlType) { + if !f.shouldDiscardByBuiltInDDLAllowlist(ddlType) { return false } - for _, whiteDDLType := range f.ddlWhitelist { - if whiteDDLType == ddlType { + for _, allowDDLType := range f.ddlAllowlist { + if allowDDLType == ddlType { return false } } return true } -func (f *Filter) shouldDiscardByBuiltInDDLWhitelist(ddlType model.ActionType) bool { +func (f *Filter) shouldDiscardByBuiltInDDLAllowlist(ddlType model.ActionType) bool { /* The following DDL will be filter: ActionAddForeignKey ActionType = 9 ActionDropForeignKey ActionType = 10 diff --git a/pkg/filter/filter_test.go b/pkg/filter/filter_test.go index cb4c09827ca..01de50e39f5 100644 --- a/pkg/filter/filter_test.go +++ b/pkg/filter/filter_test.go @@ -94,7 +94,7 @@ func (s *filterSuite) TestShouldIgnoreTxn(c *check.C) { func (s *filterSuite) TestShouldDiscardDDL(c *check.C) { config := &config.ReplicaConfig{ Filter: &config.FilterConfig{ - DDLWhitelist: []model.ActionType{model.ActionAddForeignKey}, + DDLAllowlist: []model.ActionType{model.ActionAddForeignKey}, }, } filter, err := NewFilter(config)