Skip to content

Commit

Permalink
add warning for the MaxItemSize
Browse files Browse the repository at this point in the history
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
  • Loading branch information
krasi-georgiev committed Sep 14, 2020
1 parent 026794d commit 83bdf2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/queryfrontend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"time"

cortexcache "github.com/cortexproject/cortex/pkg/chunk/cache"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/thanos-io/thanos/pkg/cacheutil"
"github.com/thanos-io/thanos/pkg/extflag"
"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -50,7 +52,7 @@ type CacheProviderConfig struct {
}

// NewCacheConfig is a parser that converts a Thanos cache config yaml into a cortex cache config struct.
func NewCacheConfig(confContentYaml []byte) (*queryrange.ResultsCacheConfig, error) {
func NewCacheConfig(logger log.Logger, confContentYaml []byte) (*queryrange.ResultsCacheConfig, error) {
cacheConfig := &CacheProviderConfig{}
if err := yaml.UnmarshalStrict(confContentYaml, cacheConfig); err != nil {
return nil, errors.Wrap(err, "parsing config YAML file")
Expand Down Expand Up @@ -83,6 +85,10 @@ func NewCacheConfig(confContentYaml []byte) (*queryrange.ResultsCacheConfig, err
if err := yaml.UnmarshalStrict(backendConfig, &config); err != nil {
return nil, err
}
// TODO(krasi) Add support for it in the cortex module.
if config.Memcached.MaxItemSize > 0 {
level.Warn(logger).Log("message", "MaxItemSize is not yet supported by the memcached client")
}

return &queryrange.ResultsCacheConfig{
CacheConfig: cortexcache.Config{
Expand Down

0 comments on commit 83bdf2c

Please sign in to comment.