Skip to content

querier: option to skip sending queries to long term storage #1893

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

Merged

Conversation

thorfour
Copy link
Contributor

@thorfour thorfour commented Dec 9, 2019

What this PR does: Moves the MinChunkAge option from chunk store into the querier to allow that behaviour regardless of store backend.

Which issue(s) this PR fixes:
N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch 4 times, most recently from a14f12c to c9a6795 Compare December 9, 2019 20:40
jtlisi
jtlisi previously requested changes Dec 10, 2019
Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

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

One nit, otherwise LGTM

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Thanks @thorfour for the PR! I've the feeling this change is unsafe. There's no guarantee that the alive ingesters hold all the timeseries within the -querier.query-ingesters-within period. For example, in case of scale down, ingesters chunks are flushed to the storage: with this new option enabled, you would end up querying a subset of the series.

In the case of TSDB, we're still not handling the scale down (it's TBD) because we're currently loosing the WAL if no joining ingester is found by the leaving one, but once will be fixed we'll have the same issue there as well.

In case we'll have good arguments to have this kind of change merged, I would review the PR (I've seen some inconsistencies here and there, but haven't commented cause I first would like to understand if this kind of change is feasible).

@bboreham
Copy link
Contributor

The chunk store already has this feature here:

if from.After(now.Add(-c.cfg.MinChunkAge)) {
// no data relevant to this query will have arrived at the store yet
return true, nil
}

so you shouldn't need to add it at the querier level.

@thorfour
Copy link
Contributor Author

The chunk store already has this feature here

That's true, but I would then need to add the feature to the block querier, it made sense to have it as a top level feature instead of backend specific.

Is it preferred to be implemented in each backend or on the top level @bboreham?

@bboreham
Copy link
Contributor

I guess you can have a go at moving the feature, but don't add something that duplicates it.

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch 2 times, most recently from 3cc8b08 to edac241 Compare December 11, 2019 14:42
@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch from edac241 to 3c2f1c9 Compare December 11, 2019 15:29
Copy link
Contributor

@gouthamve gouthamve left a comment

Choose a reason for hiding this comment

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

Can we have a more descriptive name for the flag? The old one is not well named either and I think we can do better when changing it :P

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch from 7333c9d to 65ba5ae Compare January 3, 2020 15:12
@thorfour
Copy link
Contributor Author

thorfour commented Jan 3, 2020

@gouthamve Do you have a better name for the flag in mind? min-ingester-lookback-time?
skip-store-before-time ?

@thorfour
Copy link
Contributor Author

thorfour commented Jan 7, 2020

Setting has been renamed to StoreMinQueryLookback

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch from 7e7f847 to 2ad359c Compare January 7, 2020 15:21
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Thanks Thor for addressing my feedback. I just realized a couple of more small things, I would be glad if you could take a look at. A part from this, LGTM.

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Thanks Thor. Changes LGTM.

Copy link
Contributor

@gouthamve gouthamve left a comment

Choose a reason for hiding this comment

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

@bboreham This is a breaking change, how do we want to proceed here? Do you want make this flag a deprecated flag or break deployments that upgrade w/o changing this?

Other than that, LGTM!

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch from 943e5ce to c96f107 Compare January 8, 2020 16:31
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM with few nit to fix, please.

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch 2 times, most recently from 784a3cf to 1156bda Compare January 8, 2020 17:23
@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch 2 times, most recently from 9b9aabd to 0f60bf9 Compare January 17, 2020 15:28
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM (just left few minor comments). @bboreham What's your take about this? Given it introduce a breaking change in the config, if we want it would be great to have it in the 0.6.0.

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch from 0f60bf9 to 2225268 Compare January 17, 2020 16:21
@pracucci pracucci requested review from jtlisi and gouthamve January 27, 2020 07:46
Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

May you also rebase master so that we can move on merging it, please?

@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch from 2225268 to fcc5256 Compare January 28, 2020 14:41
@pracucci
Copy link
Contributor

@thorfour Sorry to bother you. We've merge the release 0.6.0 and you would need to move your CHANGELOG.md entry to the top of the file (remember to keep entries grouped by type).

Signed-off-by: Thor <thansen@digitalocean.com>
@thorfour thorfour force-pushed the feat/tsdb-query-only-ingesters branch from fcc5256 to 93151d7 Compare January 28, 2020 17:30
@thorfour
Copy link
Contributor Author

Yea forgot we had cut 0.6.0 and didn't really look at the merge conflicts when I rebased it.

@pracucci pracucci merged commit b3069aa into cortexproject:master Jan 28, 2020
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.

5 participants