Skip to content

Commit

Permalink
chore: remove experimental flags for l2 cache and memcached "addresse…
Browse files Browse the repository at this point in the history
…s" config (#12410)
  • Loading branch information
slim-bean authored Apr 1, 2024
1 parent 7480468 commit a509871
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
15 changes: 12 additions & 3 deletions docs/sources/configure/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2404,13 +2404,22 @@ The `chunk_store_config` block configures how chunks will be cached and how long
# The CLI flags prefix for this block configuration is: store.chunks-cache
[chunk_cache_config: <cache_config>]
# The cache block configures the cache backend.
# The CLI flags prefix for this block configuration is: store.chunks-cache-l2
[chunk_cache_config_l2: <cache_config>]
# Write dedupe cache is deprecated along with legacy index types (aws,
# aws-dynamo, bigtable, bigtable-hashed, cassandra, gcp, gcp-columnkey,
# grpc-store).
# Consider using TSDB index which does not require a write dedupe cache.
# The CLI flags prefix for this block configuration is: store.index-cache-write
[write_dedupe_cache_config: <cache_config>]
# Chunks will be handed off to the L2 cache after this duration. 0 to disable L2
# cache.
# CLI flag: -store.chunks-cache-l2.handoff
[l2_chunk_cache_handoff: <duration> | default = 0s]
# Cache index entries older than this period. 0 to disable.
# CLI flag: -store.cache-lookups-older-than
[cache_lookups_older_than: <duration> | default = 0s]
Expand Down Expand Up @@ -4488,6 +4497,7 @@ The cache block configures the cache backend. The supported CLI flags `<prefix>`
- `frontend.series-results-cache`
- `frontend.volume-results-cache`
- `store.chunks-cache`
- `store.chunks-cache-l2`
- `store.index-cache-read`
- `store.index-cache-write`

Expand Down Expand Up @@ -4534,9 +4544,8 @@ memcached_client:
# CLI flag: -<prefix>.memcached.service
[service: <string> | default = "memcached"]
# EXPERIMENTAL: Comma separated addresses list in DNS Service Discovery
# format:
# https://cortexmetrics.io/docs/configuration/arguments/#dns-service-discovery
# Comma separated addresses list in DNS Service Discovery format:
# https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes
# CLI flag: -<prefix>.memcached.addresses
[addresses: <string> | default = ""]
Expand Down
6 changes: 2 additions & 4 deletions pkg/storage/chunk/cache/memcached_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/sony/gobreaker"

"github.com/grafana/loki/pkg/util/constants"
util_log "github.com/grafana/loki/pkg/util/log"
)

// MemcachedClient interface exists for mocking memcacheClient.
Expand Down Expand Up @@ -75,7 +74,7 @@ type memcachedClient struct {
type MemcachedClientConfig struct {
Host string `yaml:"host"`
Service string `yaml:"service"`
Addresses string `yaml:"addresses"` // EXPERIMENTAL.
Addresses string `yaml:"addresses"`
Timeout time.Duration `yaml:"timeout"`
MaxIdleConns int `yaml:"max_idle_conns"`
MaxItemSize int `yaml:"max_item_size"`
Expand All @@ -96,7 +95,7 @@ type MemcachedClientConfig struct {
func (cfg *MemcachedClientConfig) RegisterFlagsWithPrefix(prefix, description string, f *flag.FlagSet) {
f.StringVar(&cfg.Host, prefix+"memcached.hostname", "", description+"Hostname for memcached service to use. If empty and if addresses is unset, no memcached will be used.")
f.StringVar(&cfg.Service, prefix+"memcached.service", "memcached", description+"SRV service used to discover memcache servers.")
f.StringVar(&cfg.Addresses, prefix+"memcached.addresses", "", description+"EXPERIMENTAL: Comma separated addresses list in DNS Service Discovery format: https://cortexmetrics.io/docs/configuration/arguments/#dns-service-discovery")
f.StringVar(&cfg.Addresses, prefix+"memcached.addresses", "", description+"Comma separated addresses list in DNS Service Discovery format: https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes")
f.IntVar(&cfg.MaxIdleConns, prefix+"memcached.max-idle-conns", 16, description+"Maximum number of idle connections in pool.")
f.DurationVar(&cfg.Timeout, prefix+"memcached.timeout", 100*time.Millisecond, description+"Maximum time to wait before giving up on memcached requests.")
f.DurationVar(&cfg.UpdateInterval, prefix+"memcached.update-interval", 1*time.Minute, description+"Period with which to poll DNS for memcache servers.")
Expand Down Expand Up @@ -180,7 +179,6 @@ func NewMemcachedClient(cfg MemcachedClientConfig, name string, r prometheus.Reg
}

if len(cfg.Addresses) > 0 {
util_log.WarnExperimentalUse("DNS-based memcached service discovery", logger)
newClient.addresses = strings.Split(cfg.Addresses, ",")
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/config/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (

type ChunkStoreConfig struct {
ChunkCacheConfig cache.Config `yaml:"chunk_cache_config"`
ChunkCacheConfigL2 cache.Config `yaml:"chunk_cache_config_l2" doc:"hidden"`
ChunkCacheConfigL2 cache.Config `yaml:"chunk_cache_config_l2"`
WriteDedupeCacheConfig cache.Config `yaml:"write_dedupe_cache_config" doc:"description=Write dedupe cache is deprecated along with legacy index types (aws, aws-dynamo, bigtable, bigtable-hashed, cassandra, gcp, gcp-columnkey, grpc-store).\nConsider using TSDB index which does not require a write dedupe cache."`

L2ChunkCacheHandoff time.Duration `yaml:"l2_chunk_cache_handoff" doc:"hidden"`
L2ChunkCacheHandoff time.Duration `yaml:"l2_chunk_cache_handoff"`
CacheLookupsOlderThan model.Duration `yaml:"cache_lookups_older_than"`

// Not visible in yaml because the setting shouldn't be common between ingesters and queriers.
Expand All @@ -34,8 +34,8 @@ func (cfg *ChunkStoreConfig) ChunkCacheStubs() bool {
// RegisterFlags adds the flags required to configure this flag set.
func (cfg *ChunkStoreConfig) RegisterFlags(f *flag.FlagSet) {
cfg.ChunkCacheConfig.RegisterFlagsWithPrefix("store.chunks-cache.", "", f)
cfg.ChunkCacheConfigL2.RegisterFlagsWithPrefix("experimental.store.chunks-cache-l2.", "", f)
f.DurationVar(&cfg.L2ChunkCacheHandoff, "experimental.store.chunks-cache-l2.handoff", 0, "Experimental, subject to change or removal. Chunks will be handed off to the L2 cache after this duration. 0 to disable L2 cache.")
cfg.ChunkCacheConfigL2.RegisterFlagsWithPrefix("store.chunks-cache-l2.", "", f)
f.DurationVar(&cfg.L2ChunkCacheHandoff, "store.chunks-cache-l2.handoff", 0, "Chunks will be handed off to the L2 cache after this duration. 0 to disable L2 cache.")
f.BoolVar(&cfg.chunkCacheStubs, "store.chunks-cache.cache-stubs", false, "If true, don't write the full chunk to cache, just a stub entry.")
cfg.WriteDedupeCacheConfig.RegisterFlagsWithPrefix("store.index-cache-write.", "", f)

Expand Down

0 comments on commit a509871

Please sign in to comment.