From d091637f218202ce119e98a5fe1aafe3eb55bb61 Mon Sep 17 00:00:00 2001 From: Neeraj Poddar Date: Mon, 22 Apr 2019 16:10:41 -0600 Subject: [PATCH] Updated table deletes to ignore empty prefixes Signed-off-by: Neeraj Poddar --- pkg/chunk/table_manager.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/chunk/table_manager.go b/pkg/chunk/table_manager.go index 4c99a77fc9a..507533bba2e 100644 --- a/pkg/chunk/table_manager.go +++ b/pkg/chunk/table_manager.go @@ -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 {