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 3 commits
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
12 changes: 6 additions & 6 deletions _utils/terror_gen/errors_release.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,14 @@ ErrSyncerUnitOnlineDDLSchemeNotSupport,[code=36040:class=sync-unit:scope=interna
ErrSyncerUnitOnlineDDLOnMultipleTable,[code=36041:class=sync-unit:scope=internal:level=high],"online ddl changes on multiple table: %s not supported"
ErrSyncerUnitGhostApplyEmptyTable,[code=36042:class=sync-unit:scope=internal:level=high],"empty tables not valid"
ErrSyncerUnitGhostRenameTableNotValid,[code=36043:class=sync-unit:scope=internal:level=high],"tables should contain old and new table name"
ErrSyncerUnitGhostRenameToGhostTable,[code=36044:class=sync-unit:scope=internal:level=high],"rename table to ghost table %s not supported"
ErrSyncerUnitGhostRenameGhostTblToOther,[code=36045:class=sync-unit:scope=internal:level=high],"rename ghost table to other ghost table %s not supported"
ErrSyncerUnitGhostOnlineDDLOnGhostTbl,[code=36046:class=sync-unit:scope=internal:level=high],"online ddls on ghost table `%s`.`%s`"
ErrSyncerUnitGhostRenameToGhostTable,[code=36044:class=sync-unit:scope=internal:level=high],"rename table to gh-ost temporary table %s not supported"
ErrSyncerUnitGhostRenameGhostTblToOther,[code=36045:class=sync-unit:scope=internal:level=high],"rename gh-ost temporary table to other temporary table %s not supported"
ErrSyncerUnitGhostOnlineDDLOnGhostTbl,[code=36046:class=sync-unit:scope=internal:level=high],"online ddl metadata for table `%s`.`%s` not found"
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 temporary table %s not supported"
ErrSyncerUnitPTRenamePTTblToOther,[code=36050:class=sync-unit:scope=internal:level=high],"rename pt temporary table to other temporary table %s not supported"
ErrSyncerUnitPTOnlineDDLOnPTTbl,[code=36051:class=sync-unit:scope=internal:level=high],"online ddl metadata for table `%s`.`%s` not found"
WangXiangUSTC marked this conversation as resolved.
Show resolved Hide resolved
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
12 changes: 6 additions & 6 deletions errors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1649,19 +1649,19 @@ workaround = ""
tags = ["internal", "high"]

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

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

[error.DM-sync-unit-36046]
message = "online ddls on ghost table `%s`.`%s`"
message = "online ddl metadata for table `%s`.`%s` not found"
description = ""
workaround = ""
tags = ["internal", "high"]
Expand All @@ -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 temporary 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 temporary table to other temporary table %s not supported"
description = ""
workaround = ""
tags = ["internal", "high"]

[error.DM-sync-unit-36051]
message = "online ddls on ghost table `%s`.`%s`"
message = "online ddl metadata for table `%s`.`%s` not found"
description = ""
workaround = ""
tags = ["internal", "high"]
Expand Down
18 changes: 9 additions & 9 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 @@ -862,14 +862,14 @@ var (
ErrSyncerUnitOnlineDDLOnMultipleTable = New(codeSyncerUnitOnlineDDLOnMultipleTable, ClassSyncUnit, ScopeInternal, LevelHigh, "online ddl changes on multiple table: %s not supported")
ErrSyncerUnitGhostApplyEmptyTable = New(codeSyncerUnitGhostApplyEmptyTable, ClassSyncUnit, ScopeInternal, LevelHigh, "empty tables not valid")
ErrSyncerUnitGhostRenameTableNotValid = New(codeSyncerUnitGhostRenameTableNotValid, ClassSyncUnit, ScopeInternal, LevelHigh, "tables should contain old and new table name")
ErrSyncerUnitGhostRenameToGhostTable = New(codeSyncerUnitGhostRenameToGhostTable, ClassSyncUnit, ScopeInternal, LevelHigh, "rename table to ghost table %s not supported")
ErrSyncerUnitGhostRenameGhostTblToOther = New(codeSyncerUnitGhostRenameGhostTblToOther, ClassSyncUnit, ScopeInternal, LevelHigh, "rename ghost table to other ghost table %s not supported")
ErrSyncerUnitGhostOnlineDDLOnGhostTbl = New(codeSyncerUnitGhostOnlineDDLOnGhostTbl, ClassSyncUnit, ScopeInternal, LevelHigh, "online ddls on ghost table `%s`.`%s`")
ErrSyncerUnitGhostRenameToGhostTable = New(codeSyncerUnitGhostRenameToGhostTable, ClassSyncUnit, ScopeInternal, LevelHigh, "rename table to gh-ost temporary table %s not supported")
ErrSyncerUnitGhostRenameGhostTblToOther = New(codeSyncerUnitGhostRenameGhostTblToOther, ClassSyncUnit, ScopeInternal, LevelHigh, "rename gh-ost temporary table to other temporary table %s not supported")
ErrSyncerUnitGhostOnlineDDLOnGhostTbl = New(codeSyncerUnitGhostOnlineDDLOnGhostTbl, ClassSyncUnit, ScopeInternal, LevelHigh, "online ddl metadata for table `%s`.`%s` not found")
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 temporary table %s not supported")
ErrSyncerUnitPTRenamePTTblToOther = New(codeSyncerUnitPTRenamePTTblToOther, ClassSyncUnit, ScopeInternal, LevelHigh, "rename pt temporary table to other temporary table %s not supported")
ErrSyncerUnitPTOnlineDDLOnPTTbl = New(codeSyncerUnitPTOnlineDDLOnPTTbl, ClassSyncUnit, ScopeInternal, LevelHigh, "online ddl metadata for table `%s`.`%s` not found")
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