Skip to content

Commit

Permalink
Merge pull request grafana#1341 from nrjpoddar/fixTableDeletes
Browse files Browse the repository at this point in the history
Updated table deletes to ignore empty prefixes
  • Loading branch information
gouthamve authored Apr 29, 2019
2 parents dca32de + bbc7ce3 commit ad04709
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions table_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,12 @@ func (m *TableManager) partitionTables(ctx context.Context, descriptions []Table
// Ensure we only delete tables which have a prefix managed by Cortex.
tablePrefixes := map[string]struct{}{}
for _, cfg := range m.schemaCfg.Configs {
tablePrefixes[cfg.IndexTables.Prefix] = struct{}{}
tablePrefixes[cfg.ChunkTables.Prefix] = struct{}{}
if cfg.IndexTables.Prefix != "" {
tablePrefixes[cfg.IndexTables.Prefix] = struct{}{}
}
if cfg.ChunkTables.Prefix != "" {
tablePrefixes[cfg.ChunkTables.Prefix] = struct{}{}
}
}

for existingTable := range existingTables {
Expand Down

0 comments on commit ad04709

Please sign in to comment.