Skip to content

Commit

Permalink
simplify code; adding comments
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Jan 7, 2024
1 parent 2c1d073 commit b9cf862
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions go/vt/schema/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
)

var (
// internalTableNameRegexp parses new intrnal table name format, e.g. _vt_hld_6ace8bcef73211ea87e9f875a4d24e90_20200915120410_
internalTableNameRegexp = regexp.MustCompile(InternalTableNameExpression)
)

Expand Down
4 changes: 2 additions & 2 deletions go/vt/schema/online_ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,10 @@ func OnlineDDLToGCUUID(uuid string) string {
// by pt-online-schema-change.
// There is no guarantee that the tables _was indeed_ generated by an online DDL flow.
func IsOnlineDDLTableName(tableName string) bool {
// Try new naming format (e.g. `_vt_hld_6ace8bcef73211ea87e9f875a4d24e90_20200915120410_`):
// Try new naming format (e.g. `_vt_vrp_6ace8bcef73211ea87e9f875a4d24e90_20200915120410_`):
// The new naming format is accepted in v19, and actually _used_ in v20
if isInternal, hint, _, _, _ := AnalyzeInternalTableName(tableName); isInternal {
return isInternal && onlineDDLInternalTableHintsMap[hint]
return onlineDDLInternalTableHintsMap[hint]
}

if onlineDDLGeneratedTableNameRegexp.MatchString(tableName) {
Expand Down
3 changes: 2 additions & 1 deletion go/vt/schema/tablegc.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const (
)

const (
GCTableNameExpression string = `^_vt_(HOLD|PURGE|EVAC|DROP)_([0-f]{32})_([0-9]{14})$`
GCTableNameExpression string = `^_vt_(HOLD|PURGE|EVAC|DROP)_([0-f]{32})_([0-9]{14})$`
// NewGCTableNameExpression parses new intrnal table name format, e.g. _vt_hld_6ace8bcef73211ea87e9f875a4d24e90_20200915120410_
NewGCTableNameExpression string = `^_vt_(hld|prg|evc|drp)_([0-f]{32})_([0-9]{14})_$`
)

Expand Down

0 comments on commit b9cf862

Please sign in to comment.