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

Fix segmentation fault in Ingester.LabelValues response marshaling #8003

Merged
merged 6 commits into from
Apr 30, 2024

Conversation

seizethedave
Copy link
Contributor

What this PR does

This PR fixes a segmentation fault (see #7897) that happens when ongoing compaction in the ingester unmaps an index file that an in-flight Ingester.LabelValues response hasn't yet marshaled.

I am doing the simplest thing here which is to make a copy of all of the label value strings.

I did some analysis on the Ingester.LabelValues usage we see. Some ingester pods do see ~200 RPS of LabelValues invocations. The vast majority of calls are in the smaller response sizes. But, we do some some regular periodic LabelValues calls where the response is >25mb. (And sometimes >250mb.) These larger ones are just a few times per minute when they do happen, so I suspect it won't be problematic. But I welcome additional points of view.

Which issue(s) this PR fixes or relates to

Fixes #7897

Checklist

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

@seizethedave seizethedave requested a review from a team as a code owner April 29, 2024 18:05
@aknuds1
Copy link
Contributor

aknuds1 commented Apr 29, 2024

Did you conclude against a custom gRPC codec, then?

@seizethedave
Copy link
Contributor Author

Yeah, if it is unlikely to degrade things, then the decreased fiddly-ness and complexity of this fix seems preferable to me.

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

Looks good, except the changelog entry needs to point to the PR.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@pstibrany pstibrany merged commit 2455c30 into main Apr 30, 2024
29 checks passed
@pstibrany pstibrany deleted the davidgrant/ingester-segfault branch April 30, 2024 15:45
@pstibrany pstibrany mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ingester segfault marshaling a LabelValuesResponse
3 participants