-
Notifications
You must be signed in to change notification settings - Fork 543
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-gateway: ExpandedPostings shortcut: avoid LabelValues unless necessary #3872
store-gateway: ExpandedPostings shortcut: avoid LabelValues unless necessary #3872
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
cb73e8c
to
90bcc56
Compare
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
some updated benchmarks based on the latest commit here Details
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! I took an initial pass, without reviewing the logic very accurately (yet).
Why some benchmarks allocate more? Have you looked it more in details? In theory we're just delaying some postings "resolution" (lazy postings) but the total allocations shouldn't change.
They increase because now we have an intermediate slice of label values that we create before checking the index header: here instead of checking the header first, we immediately allocate a postingGroup and here a slice for the labels. mimir/pkg/storegateway/bucket_index_postings.go Lines 129 to 134 in 3cb53e8
Those are later filtered here mimir/pkg/storegateway/bucket_index_postings.go Lines 84 to 90 in 3cb53e8
But in the previous implementation the filtering was happening before the posting group and the slice of keys was even created: mimir/pkg/storegateway/bucket_index_postings.go Lines 58 to 67 in d3f323e
This is more evident in benchmark cases where we shortcut and don't fetch posting lists. In cases where there are posting lists, the memory is dominated by them. The aim of this PR is to reduce the calls to |
Co-authored-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
there is a race condition although this code should only be running in one goroutine. I will investigate |
This reverts commit 02a6dc2 Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
data race was because the mimir/pkg/storegateway/bucket_index_postings.go Lines 126 to 131 in 05b7e67
Since we use the raw slices of strings instead of copying them, we effectively modify the set matchers here (done for each block)
To make the CI passing I reverted the commit that uses the raw string slices from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, all my comments are nitpicks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, LGTM! 👍 on Oleg comments. I also left few nits, really minor things.
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Co-authored-by: Marco Pracucci <marco@pracucci.com> Co-authored-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
…ngGroup Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Ship it! 🚀 Thanks for addressing my comments! |
* Update test * Add missing changelog entries for commits since Mimir 2.5 (#4006) All other commits weren't user-facing or were helm-chart specific. See #3979 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com> * Add --concurrency support to 'mimirtool rules sync' command (#3996) * Add --concurrency support to 'mimirtool rules sync' command Signed-off-by: Marco Pracucci <marco@pracucci.com> * Update pkg/mimirtool/commands/rules.go Co-authored-by: Patrick Oyarzun <patrick.oyarzun@grafana.com> Signed-off-by: Marco Pracucci <marco@pracucci.com> Co-authored-by: Patrick Oyarzun <patrick.oyarzun@grafana.com> * store-gateway: ExpandedPostings shortcut: avoid LabelValues unless necessary (#3872) * Return `Canceled` rather than `Aborted` when a `Series` request to a store-gateway is cancelled by the calling querier. (#4007) * Return Canceled rather than Aborted when a Series request to a store-gateway is cancelled. * Add changelog entry. * Update mimir-prometheus, add support for align_evaluation_time_on_interval. (#4013) Signed-off-by: Peter Štibraný <pstibrany@gmail.com> * Fix title of guide in link text; reword phrase. (#4008) * Fix ExampleInitLogger to work in UTC (#4016) The test didn't pass in my time zone (tm). --- FAIL: ExampleInitLogger (0.00s) got: ts=1970-01-01T01:00:00+01:00 caller=log_test.go:31 level=info test=1 ts=1970-01-01T01:00:00+01:00 caller=log_test.go:33 level=info msg="test 3" want: ts=1970-01-01T00:00:00Z caller=log_test.go:31 level=info test=1 ts=1970-01-01T00:00:00Z caller=log_test.go:33 level=info msg="test 3" Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Create outline of Mimir 2.6 release notes (#4002) Includes notable features and bugfixes based on the CHANGELOG. Helm changes to be filled out later by product and engineering. See #3979 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com> * Fix post-merge comments from PR #4013. (#4014) Signed-off-by: Peter Štibraný <pstibrany@gmail.com> * Update CODEOWNERS to include mimir-ruler-and-alertmanager-maintainers (#4019) For those who only want notifications re the ruler or Alertmanager. * Remove internal use of store.max-query-length (#4017) Make deprecation of the option more obvious and attempt to remove any use of store.max-query-length in our documentation, jsonnet, helm, and integration tests. See #2793 See #3825 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com> Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com> * [otlp] Update OTel Collector to latest release (#3852) * [otlp] Update otel collector dependecy to latest * Update code to deal with deprecated functions Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> * [otlp] Docs: Highlight common issues with OTLP --> Prometheus (#3629) Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> Co-authored-by: Ursula Kallio <ursula.kallio@grafana.com> * make it possible to inject memberlist kv codecs (#4018) * make it possible to inject memberlist kv codecs Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com> * add comment Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com> * improve comment wording Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com> Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com> * Limits and errors for ephemeral storage (#4004) * Add limits for ephemeral storage. * Add new reason when ingestion of ephemeral metrics fails. * Add tests for max ephemeral series limit. * Introduce new discard reasons when ingesting ephemeral series. Signed-off-by: Peter Štibraný <pstibrany@gmail.com> * Reduce maintainership and step down as team member. (#4023) * Reduce maintainership and step down as team member. My future priorities will be on the alerting aspects of Mimir, so I think it is right to reduce my maintainership accordingly and allow others to take my place. Similarly, remove myself as a team member. * Sort previous team members. Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com> Signed-off-by: Marco Pracucci <marco@pracucci.com> Signed-off-by: Peter Štibraný <pstibrany@gmail.com> Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com> Co-authored-by: Nick Pillitteri <56quarters@users.noreply.github.com> Co-authored-by: Marco Pracucci <marco@pracucci.com> Co-authored-by: Patrick Oyarzun <patrick.oyarzun@grafana.com> Co-authored-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com> Co-authored-by: Charles Korn <charleskorn@users.noreply.github.com> Co-authored-by: Peter Štibraný <pstibrany@gmail.com> Co-authored-by: Ursula Kallio <ursula.kallio@grafana.com> Co-authored-by: Oleg Zaytsev <mail@olegzaytsev.com> Co-authored-by: gotjosh <josue.abreu@gmail.com> Co-authored-by: Goutham Veeramachaneni <gouthamve@gmail.com> Co-authored-by: Mauro Stettler <mauro.stettler@gmail.com> Co-authored-by: Steve Simpson <steve.simpson@grafana.com>
This is a proposed implementation of this comment from #3848