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: honor stacktrace partitions at downsampling #3408

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Jul 8, 2024

Fixes #3406.

Currently, during compaction, when the downsampler aggregates profiles, the stack trace partition is ignored. The initial assumption was that profiles of the same series (label set) would always have the same stack trace partition. This is almost always the case; however, this is not guaranteed as the partitioning heuristic also depends on the main mapping name (see #3262).

We've recently discovered a few cases where this led to data inconsistencies. Specifically, profiles that refer to the wrong partition, and therefore can't be read: their samples refer to stack traces that can't be found in the partition. Another issue is that such occurrences are not handled properly: a wrong stack trace may be resolved to wrong locations (the stack trace buffer is not cleared if the stack trace is not found), which will likely cause a panic when attempting to resolve it.

I also increased the symbol rewriter LRU cache size from 2 to 8, as I've seen that the interlacing of partitions might be quite heavy.

@kolesnikovae kolesnikovae marked this pull request as ready for review July 8, 2024 03:00
@kolesnikovae kolesnikovae requested a review from a team as a code owner July 8, 2024 03:00
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

LGTM.

Wdyt should be cherry pick this into the weekly?

pkg/phlaredb/symdb/stacktrace_tree.go Show resolved Hide resolved
@kolesnikovae
Copy link
Collaborator Author

Wdyt should be cherry pick this into the weekly?

Yeah, I'll cherry pick it

@kolesnikovae kolesnikovae merged commit 0481b28 into main Jul 8, 2024
18 checks passed
@kolesnikovae kolesnikovae deleted the fix/downsample-by-partition branch July 8, 2024 08:00
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.

symdb: Panic during ResolveStacktraceLocations
2 participants