Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store: fix error when bucket cache not used #176

Merged

Conversation

craigfurman
Copy link
Contributor

@craigfurman craigfurman commented Nov 23, 2020

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

store: fix error when bucket cache not used

The default bucketCache is {}, which caused a runtime error when
trying to access the type field.

I only encountered this error when using thanos.storeShards(), not when using thanos.store(). I am not sure why this is, the code looks as though it should produce this error in store() too, if config.bucketCache is unset (and defaults to {}).

It looks like #171 fixed a similar problem with query-frontend cache config.

Verification

I've tested this locally (in k3d) with no explicit config.bucketCache, and one with type: memcached.

The default bucketCache is `{}`, which caused a runtime error when
trying to access the `type` field.

Signed-off-by: Craig Furman <craig.furman89@gmail.com>
@craigfurman craigfurman force-pushed the fix-store-without-bucket-cache branch from 95ff3f8 to 31e5565 Compare November 23, 2020 14:05
Copy link

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@metalmatze
Copy link
Contributor

I'm wondering if this is something wrong in storeShards then. The idea is, that if an object is passed to bucketCache it has to have a type field.

@metalmatze
Copy link
Contributor

Hm. I cannot see anything particularly wrong in the storeShard. I guess I'll go ahead with this to unblock you.
Thanks!

@metalmatze metalmatze merged commit c584d22 into thanos-io:master Nov 25, 2020
@craigfurman craigfurman deleted the fix-store-without-bucket-cache branch November 25, 2020 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants