Skip to content

Commit

Permalink
fix(dbm-services): 忽略旧系统库db_infobase #6966
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq authored and iSecloud committed Sep 19, 2024
1 parent 06426cb commit 9a155f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,14 @@ func GetGcsSystemDatabases(version string) []string {
DBs := GetMysqlSystemDatabases(version)
DBs = append(DBs, native.INFODBA_SCHEMA)
DBs = append(DBs, native.TEST_DB)
DBs = append(DBs, native.OLD_INFO_DBA_SCHEMA)
return DBs
}

// GetGcsSystemDatabasesIgnoreTest TODO
func GetGcsSystemDatabasesIgnoreTest(version string) []string {
DBs := GetMysqlSystemDatabases(version)
DBs = append(DBs, native.INFODBA_SCHEMA)
DBs = append(DBs, native.OLD_INFO_DBA_SCHEMA)
return DBs
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ func (c *SemanticDumpSchemaComp) Init() (err error) {
}
finaldbs := []string{}
reg := regexp.MustCompile(`^bak_cbs`)
for _, db := range util.FilterOutStringSlice(alldbs, computil.GetGcsSystemDatabasesIgnoreTest(version)) {
ignoreDBs := computil.GetGcsSystemDatabasesIgnoreTest(version)
if c.isSpider {
ignoreDBs = computil.GetGcsSystemDatabases(version)
}
for _, db := range util.FilterOutStringSlice(alldbs, ignoreDBs) {
if reg.MatchString(db) {
continue
}
finaldbs = append(finaldbs, db)
}

if len(finaldbs) == 0 {
return fmt.Errorf("变更实例排除系统库后,再也没有可以变更的库")
}
Expand Down
2 changes: 2 additions & 0 deletions dbm-services/mysql/db-tools/dbactuator/pkg/native/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const NotRowFound = "not row found"
const (
// INFODBA_SCHEMA TODO
INFODBA_SCHEMA = "infodba_schema"
// old info_dba_schema old platform db
OLD_INFO_DBA_SCHEMA = "db_infobase"
// TEST_DB TODO
TEST_DB = "test"
// INFO_SCHEMA TODO
Expand Down

0 comments on commit 9a155f7

Please sign in to comment.