Skip to content

Commit

Permalink
just log a warning when a store type other than boltdb-shipper is det…
Browse files Browse the repository at this point in the history
…ected 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 <ed@oqqer.com>

Co-authored-by: Ed Welch <ed@oqqer.com>
  • Loading branch information
sandeepsukhani and slim-bean authored Jun 1, 2021
1 parent faeccdc commit c90366d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/storage/stores/shipper/compactor/retention/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit c90366d

Please sign in to comment.