From c90366dbe7fa3862d14760ef25537f8728b66158 Mon Sep 17 00:00:00 2001 From: Sandeep Sukhani Date: Tue, 1 Jun 2021 20:49:32 +0530 Subject: [PATCH] just log a warning when a store type other than boltdb-shipper is detected when custom retention is enabled (#3785) * just log a warning when a store type other than boltdb-shipper is detected when custom retention is enabled * gofmt * Update msg Co-authored-by: Ed Welch Co-authored-by: Ed Welch --- .../stores/shipper/compactor/retention/index.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/storage/stores/shipper/compactor/retention/index.go b/pkg/storage/stores/shipper/compactor/retention/index.go index 9ff9e3cd7175..0c35f651b348 100644 --- a/pkg/storage/stores/shipper/compactor/retention/index.go +++ b/pkg/storage/stores/shipper/compactor/retention/index.go @@ -7,10 +7,14 @@ import ( "strings" "time" - "github.com/cortexproject/cortex/pkg/chunk" "github.com/prometheus/common/model" + "github.com/cortexproject/cortex/pkg/chunk" + util_log "github.com/cortexproject/cortex/pkg/util/log" + "github.com/go-kit/kit/log/level" + "github.com/grafana/loki/pkg/storage" + "github.com/grafana/loki/pkg/storage/stores/shipper" ) const ( @@ -203,6 +207,10 @@ func parseLabelSeriesRangeKey(hashKey, rangeKey []byte) (LabelSeriesRangeKey, bo func validatePeriods(config storage.SchemaConfig) error { for _, schema := range config.Configs { + if schema.IndexType != shipper.BoltDBShipperType { + level.Warn(util_log.Logger).Log("msg", fmt.Sprintf("custom retention is not supported for store %s, no retention will be applied for schema entry with start date %s", schema.IndexType, schema.From)) + continue + } if schema.IndexTables.Period != 24*time.Hour { return fmt.Errorf("schema period must be daily, was: %s", schema.IndexTables.Period) }