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

Prepare for context argument changes in Prometheus #6097

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Sep 21, 2023

What this PR does

Prepare for context argument changes (some functions gain a context argument, while others lose it) in Prometheus, by adding a context argument to functions that will need it.

This PR should cause no behavioral changes, it is only supposed to reduce the number of changes required for updating our Prometheus dependency.

Which issue(s) this PR fixes or relates to

Checklist

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

@aknuds1 aknuds1 added the chore label Sep 21, 2023
@aknuds1 aknuds1 marked this pull request as ready for review September 21, 2023 16:48
@aknuds1 aknuds1 requested a review from a team as a code owner September 21, 2023 16:48
Prepare for context argument changes (some functions gain a context
argument, while others lose it) in Prometheus, by adding a context
argument to functions that will need it.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
pkg/ingester/ingester_test.go Show resolved Hide resolved
pkg/ingester/ingester_test.go Show resolved Hide resolved
pkg/querier/blocks_store_queryable.go Show resolved Hide resolved
pkg/querier/tenantfederation/merge_queryable.go Outdated Show resolved Hide resolved
pkg/storage/tsdb/block/index.go Show resolved Hide resolved
pkg/storegateway/series_refs.go Outdated Show resolved Hide resolved
Copy link
Contributor

@krajorama krajorama left a comment

Choose a reason for hiding this comment

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

LGTM

@aknuds1
Copy link
Contributor Author

aknuds1 commented Sep 22, 2023

Thanks for the careful reviews @krajorama and @dimitarvdimitrov!

Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for addressing my comments

@aknuds1 aknuds1 merged commit fce0b89 into main Sep 22, 2023
28 checks passed
@aknuds1 aknuds1 deleted the arve/prepare-for-context branch September 22, 2023 14:13
@@ -830,7 +830,7 @@ func (i *Ingester) PushWithCleanup(ctx context.Context, pushReq *push.Request) (
return &mimirpb.WriteResponse{}, nil
}

db, err := i.getOrCreateTSDB(userID, false)
db, err := i.getOrCreateTSDB(ctx, userID, false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're passing the request context to getOrCreateTSDB(). I don't know what it will be used for, but if the context will be retained by TSDB then I think this is a mistake. We shouldn't pass any request-specific context to any place where the context will be retained.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback @pracucci. The context shouldn't be retained, but I'm looking into whether it's a bad idea to pass it down into TSDB.

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.

4 participants