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

Ensure that ingester returns safe errors #6019

Merged
merged 6 commits into from
Sep 14, 2023
Merged

Ensure that ingester returns safe errors #6019

merged 6 commits into from
Sep 14, 2023

Conversation

duricanikolic
Copy link
Contributor

@duricanikolic duricanikolic commented Sep 13, 2023

What this PR does

In PR #5584 we introduced the safeToWrap interface to annotate error types that can be safely returned by ingester. These errors can be safely wrapped with a userID and returned to the caller. On the other hand, it is not safe to wrap and return unsafe errors, and they are only annotated with a userID. The new function wrapOrAnnotateWithUser() implements this logic, and replaces both wrapWithUser() and annotateWithUser().

Additionally, this PR marks some additional ingester errors as safe.

Which issue(s) this PR fixes or relates to

Relates to #6008

Checklist

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

Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Copy link
Contributor

@56quarters 56quarters 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 some minor comments

pkg/ingester/errors.go Outdated Show resolved Hide resolved
pkg/ingester/errors.go Show resolved Hide resolved
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
pkg/ingester/ingester.go Outdated Show resolved Hide resolved
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Thanks. Left some non-blocking comments.

pkg/ingester/ingester.go Outdated Show resolved Hide resolved
pkg/ingester/ingester.go Outdated Show resolved Hide resolved
pkg/ingester/ingester.go Outdated Show resolved Hide resolved
pkg/ingester/errors.go Outdated Show resolved Hide resolved
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
@56quarters 56quarters enabled auto-merge (squash) September 14, 2023 16:04
@56quarters 56quarters merged commit 2675c66 into main Sep 14, 2023
28 checks passed
@56quarters 56quarters deleted the yuri/safe-to-wrap branch September 14, 2023 16:28
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.

3 participants