Make missing cache-address validation error generic across cache types#7675
Open
anxkhn wants to merge 1 commit into
Open
Make missing cache-address validation error generic across cache types#7675anxkhn wants to merge 1 commit into
anxkhn wants to merge 1 commit into
Conversation
The shared errNoIndexCacheAddresses said "no index cache backend addresses", but the memcached and redis client-config validators that return it are also used by chunks-cache, metadata-cache, and the parquet caches via BucketCacheBackend. Configuring one of those with a memcached or redis backend but no addresses produced a misleading error, e.g. "chunks-cache configuration: no index cache backend addresses". The wrapping prefix in BucketStoreConfig.Validate already names the cache type, so drop the incorrect "index" qualifier from the message. Add regression coverage for the bucket-cache path. Fixes cortexproject#6804 Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Fixes a misleading validation error. The shared error
errNoIndexCacheAddressesreads
no index cache backend addresses, but the memcached and redis client-configvalidators that return it are also used by the bucket caches (chunks-cache,
metadata-cache, and the parquet caches) via
BucketCacheBackend, not just the indexcache. Configuring one of those with a memcached or redis backend but no addresses
therefore reports the wrong cache type, for example:
The wrapping prefix produced by
BucketStoreConfig.Validatealready names the cachetype (
chunks-cache configuration:,metadata-cache configuration:, etc.), so thisdrops the incorrect
indexqualifier from the message. It now reads:The index-cache path keeps a correct message because its own prefix still names it.
A regression test is added for the bucket-cache path asserting the message is generic
and does not contain
index cache.Change is message-only: no control flow or behavior changes. All four references to
errNoIndexCacheAddressesuse it by value, so the variable name is left unchanged toavoid unrelated churn.
Which issue(s) this PR fixes:
Fixes #6804
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]docs/configuration/v1-guarantees.mdupdated if this PR introduces experimental flagsNotes for the maintainer / reviewer (optional, can trim)
"no cache backend addresses" because the same error var is shared by both the
memcached AND redis validators across all cache types, and the prefix from
BucketStoreConfig.Validatealready identifies which cache. This keeps a singlemessage correct for every path.
Store Gateway:component prefix (the store-gateway iswhat consumes these bucket caches); happy to switch to
Storage/Blocks storageif you prefer.
CHANGELOG note (post-open bookkeeping)
The CHANGELOG line ends with the
#PENDINGplaceholder. Per repo convention thetrailing
#NNNNis the PR number, so after the PR is opened, edit that entry to thereal PR number and push the amend. (The issue is linked via
Fixes #6804in the body,not in the CHANGELOG.)