Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

error_message: fix misleading error message for pt online-ddl-scheme #711

Merged
merged 5 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions _utils/terror_gen/errors_release.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ ErrSyncerUnitGhostRenameGhostTblToOther,[code=36045:class=sync-unit:scope=intern
ErrSyncerUnitGhostOnlineDDLOnGhostTbl,[code=36046:class=sync-unit:scope=internal:level=high],"online ddls on ghost table `%s`.`%s`"
ErrSyncerUnitPTApplyEmptyTable,[code=36047:class=sync-unit:scope=internal:level=high],"empty tables not valid"
ErrSyncerUnitPTRenameTableNotValid,[code=36048:class=sync-unit:scope=internal:level=high],"tables should contain old and new table name"
ErrSyncerUnitPTRenameToGhostTable,[code=36049:class=sync-unit:scope=internal:level=high],"rename table to ghost table %s not supported"
ErrSyncerUnitPTRenameGhostTblToOther,[code=36050:class=sync-unit:scope=internal:level=high],"rename ghost table to other ghost table %s not supported"
ErrSyncerUnitPTOnlineDDLOnGhostTbl,[code=36051:class=sync-unit:scope=internal:level=high],"online ddls on ghost table `%s`.`%s`"
ErrSyncerUnitPTRenameToPTTable,[code=36049:class=sync-unit:scope=internal:level=high],"rename table to pt table %s not supported"
ErrSyncerUnitPTRenamePTTblToOther,[code=36050:class=sync-unit:scope=internal:level=high],"rename pt table to other pt table %s not supported"
ErrSyncerUnitPTOnlineDDLOnPTTbl,[code=36051:class=sync-unit:scope=internal:level=high],"online ddls on pt table `%s`.`%s`"
ErrSyncerUnitRemoteSteamerWithGTID,[code=36052:class=sync-unit:scope=internal:level=high],"open remote streamer with GTID mode not supported"
ErrSyncerUnitRemoteSteamerStartSync,[code=36053:class=sync-unit:scope=internal:level=high],"start syncing binlog from remote streamer"
ErrSyncerUnitGetTableFromDB,[code=36054:class=sync-unit:scope=internal:level=high],"invalid table `%s`.`%s`"
Expand Down
6 changes: 3 additions & 3 deletions errors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1679,19 +1679,19 @@ workaround = ""
tags = ["internal", "high"]

[error.DM-sync-unit-36049]
message = "rename table to ghost table %s not supported"
message = "rename table to pt table %s not supported"
description = ""
workaround = ""
tags = ["internal", "high"]

[error.DM-sync-unit-36050]
message = "rename ghost table to other ghost table %s not supported"
message = "rename pt table to other pt table %s not supported"
description = ""
workaround = ""
tags = ["internal", "high"]

[error.DM-sync-unit-36051]
message = "online ddls on ghost table `%s`.`%s`"
message = "online ddls on pt table `%s`.`%s`"
description = ""
workaround = ""
tags = ["internal", "high"]
Expand Down
12 changes: 6 additions & 6 deletions pkg/terror/error_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ const (
codeSyncerUnitGhostOnlineDDLOnGhostTbl
codeSyncerUnitPTApplyEmptyTable
codeSyncerUnitPTRenameTableNotValid
codeSyncerUnitPTRenameToGhostTable
codeSyncerUnitPTRenameGhostTblToOther
codeSyncerUnitPTOnlineDDLOnGhostTbl
codeSyncerUnitPTRenameToPTTable
codeSyncerUnitPTRenamePTTblToOther
codeSyncerUnitPTOnlineDDLOnPTTbl
codeSyncerUnitRemoteSteamerWithGTID
codeSyncerUnitRemoteSteamerStartSync
codeSyncerUnitGetTableFromDB
Expand Down Expand Up @@ -867,9 +867,9 @@ var (
ErrSyncerUnitGhostOnlineDDLOnGhostTbl = New(codeSyncerUnitGhostOnlineDDLOnGhostTbl, ClassSyncUnit, ScopeInternal, LevelHigh, "online ddls on ghost table `%s`.`%s`")
ErrSyncerUnitPTApplyEmptyTable = New(codeSyncerUnitPTApplyEmptyTable, ClassSyncUnit, ScopeInternal, LevelHigh, "empty tables not valid")
ErrSyncerUnitPTRenameTableNotValid = New(codeSyncerUnitPTRenameTableNotValid, ClassSyncUnit, ScopeInternal, LevelHigh, "tables should contain old and new table name")
ErrSyncerUnitPTRenameToGhostTable = New(codeSyncerUnitPTRenameToGhostTable, ClassSyncUnit, ScopeInternal, LevelHigh, "rename table to ghost table %s not supported")
ErrSyncerUnitPTRenameGhostTblToOther = New(codeSyncerUnitPTRenameGhostTblToOther, ClassSyncUnit, ScopeInternal, LevelHigh, "rename ghost table to other ghost table %s not supported")
ErrSyncerUnitPTOnlineDDLOnGhostTbl = New(codeSyncerUnitPTOnlineDDLOnGhostTbl, ClassSyncUnit, ScopeInternal, LevelHigh, "online ddls on ghost table `%s`.`%s`")
ErrSyncerUnitPTRenameToPTTable = New(codeSyncerUnitPTRenameToPTTable, ClassSyncUnit, ScopeInternal, LevelHigh, "rename table to pt table %s not supported")
csuzhangxc marked this conversation as resolved.
Show resolved Hide resolved
ErrSyncerUnitPTRenamePTTblToOther = New(codeSyncerUnitPTRenamePTTblToOther, ClassSyncUnit, ScopeInternal, LevelHigh, "rename pt table to other pt table %s not supported")
ErrSyncerUnitPTOnlineDDLOnPTTbl = New(codeSyncerUnitPTOnlineDDLOnPTTbl, ClassSyncUnit, ScopeInternal, LevelHigh, "online ddls on pt table `%s`.`%s`")
ErrSyncerUnitRemoteSteamerWithGTID = New(codeSyncerUnitRemoteSteamerWithGTID, ClassSyncUnit, ScopeInternal, LevelHigh, "open remote streamer with GTID mode not supported")
ErrSyncerUnitRemoteSteamerStartSync = New(codeSyncerUnitRemoteSteamerStartSync, ClassSyncUnit, ScopeInternal, LevelHigh, "start syncing binlog from remote streamer")
ErrSyncerUnitGetTableFromDB = New(codeSyncerUnitGetTableFromDB, ClassSyncUnit, ScopeInternal, LevelHigh, "invalid table `%s`.`%s`")
Expand Down
8 changes: 4 additions & 4 deletions syncer/pt_osc.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (p *PT) Apply(tctx *tcontext.Context, tables []*filter.Table, statement str
if tp1 == trashTable {
return nil, "", "", nil
} else if tp1 == ghostTable {
return nil, "", "", terror.ErrSyncerUnitPTRenameToGhostTable.Generate(statement)
return nil, "", "", terror.ErrSyncerUnitPTRenameToPTTable.Generate(statement)
}
}
return []string{statement}, schema, table, nil
Expand All @@ -79,7 +79,7 @@ func (p *PT) Apply(tctx *tcontext.Context, tables []*filter.Table, statement str

tp1 := p.TableType(tables[1].Name)
if tp1 == ghostTable {
return nil, "", "", terror.ErrSyncerUnitPTRenameGhostTblToOther.Generate(statement)
return nil, "", "", terror.ErrSyncerUnitPTRenamePTTblToOther.Generate(statement)
}
}
case ghostTable:
Expand All @@ -106,9 +106,9 @@ func (p *PT) Apply(tctx *tcontext.Context, tables []*filter.Table, statement str
if ghostInfo != nil {
return ghostInfo.DDLs, tables[1].Schema, tables[1].Name, nil
}
return nil, "", "", terror.ErrSyncerUnitPTOnlineDDLOnGhostTbl.Generate(schema, table)
return nil, "", "", terror.ErrSyncerUnitPTOnlineDDLOnPTTbl.Generate(schema, table)
} else if tp1 == ghostTable {
return nil, "", "", terror.ErrSyncerUnitPTRenameGhostTblToOther.Generate(statement)
return nil, "", "", terror.ErrSyncerUnitPTRenamePTTblToOther.Generate(statement)
}

// rename ghost table to trash table
Expand Down