Skip to content

Commit

Permalink
refine sys filter rule (pingcap#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu authored Nov 9, 2020
1 parent f6a456f commit bee8494
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
17 changes: 0 additions & 17 deletions dumpling/v4/export/block_allow_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,11 @@ package export

import (
"github.com/pingcap/dumpling/v4/log"
"github.com/pingcap/tidb-tools/pkg/filter"
"go.uber.org/zap"
)

func filterDirtySchemaTables(conf *Config) {
switch conf.ServerInfo.ServerType {
case ServerTypeTiDB:
if conf.Sql == "" {
for dbName := range conf.Tables {
if filter.IsSystemSchema(dbName) {
log.Warn("unsupported dump schema in TiDB now", zap.String("schema", dbName))
delete(conf.Tables, dbName)
}
}
}
}
}

func filterTables(conf *Config) {
log.Debug("filter tables")
// filter dirty schema tables because of non-impedance implementation reasons
filterDirtySchemaTables(conf)
dbTables := DatabaseTables{}
ignoredDBTable := DatabaseTables{}

Expand Down
12 changes: 6 additions & 6 deletions dumpling/v4/export/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (conf *Config) DefineFlags(flags *pflag.FlagSet) {
flags.BoolP(flagNoData, "d", false, "Do not dump table data")
flags.String(flagCsvNullValue, "\\N", "The null value used when export to csv")
flags.StringP(flagSql, "S", "", "Dump data with given sql. This argument doesn't support concurrent dump")
flags.StringSliceP(flagFilter, "f", []string{"*.*"}, "filter to select which tables to dump")
flags.StringSliceP(flagFilter, "f", []string{"*.*", DefaultTableFilter}, "filter to select which tables to dump")
flags.Bool(flagCaseSensitive, false, "whether the filter should be case-sensitive")
flags.Bool(flagDumpEmptyDatabase, true, "whether to dump empty database")
flags.Uint64(flagTidbMemQuotaQuery, DefaultTiDBMemQuotaQuery, "The maximum memory limit for a single SQL statement, in bytes. Default: 32GB")
Expand Down Expand Up @@ -483,11 +483,11 @@ func (config *Config) createExternalStorage(ctx context.Context) (storage.Extern
}

const (
UnspecifiedSize = 0
DefaultStatementSize = 1000000
TiDBMemQuotaQueryName = "tidb_mem_quota_query"

DefaultTiDBMemQuotaQuery uint64 = 32 << 30
UnspecifiedSize = 0
DefaultTiDBMemQuotaQuery = 32 << 30
DefaultStatementSize = 1000000
TiDBMemQuotaQueryName = "tidb_mem_quota_query"
DefaultTableFilter = "!/^(mysql|sys|INFORMATION_SCHEMA|PERFORMANCE_SCHEMA|METRICS_SCHEMA|INSPECTION_SCHEMA)$/.*"

defaultDumpThreads = 128
defaultDumpGCSafePointTTL = 5 * 60
Expand Down

0 comments on commit bee8494

Please sign in to comment.