Skip to content

Commit

Permalink
validate table name in addPurgingTable
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Nov 27, 2023
1 parent b55ca8c commit 068433a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions go/vt/vttablet/tabletserver/gc/tablegc.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,16 @@ func (collector *TableGC) addPurgingTable(tableName string) (added bool) {
// so we don't populate the purgingTables map.
return false
}
isGCTable, state, _, _, err := schema.AnalyzeGCTableName(tableName)
if err != nil {
return false
}
if !isGCTable {
return false
}
if state != schema.PurgeTableGCState {
return false
}

collector.purgeMutex.Lock()
defer collector.purgeMutex.Unlock()
Expand Down

0 comments on commit 068433a

Please sign in to comment.