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 store debug matchers panic on regex matcher #7903

Merged

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Nov 13, 2024

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

Changes

Fixes #7676

ParseMetricSelector tries to copy label matchers but there is a new field re for the underlying regex and it is not copied, causing panic when calling Matches.

	for i, lm := range vs.LabelMatchers {
		matchers[i] = &labels.Matcher{
			Type:  lm.Type,
			Name:  lm.Name,
			Value: lm.Value,
		}
	}

Verification

Added a simple unit test. Without the change in this PR the test will panic when calling Matches.

Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
@GiedriusS GiedriusS merged commit f9da21e into thanos-io:main Nov 13, 2024
22 checks passed
@yeya24 yeya24 deleted the fix-parse-metric-selector-regex-match branch November 13, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

thanos-query segv panic on labels regexp
3 participants