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

tsdb query fixes #6142

Merged
merged 3 commits into from
May 12, 2022
Merged

tsdb query fixes #6142

merged 3 commits into from
May 12, 2022

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
Doing some minor fixes for the issues that I found on my local setup:

  1. Uploads manager was never queried when downloads manager was initialized in index shipper.
  2. Files created from nodes having - in their names were failing to be opened.
  3. __name__ matcher was not removed from queries passed to tsdb head.

@sandeepsukhani sandeepsukhani requested a review from a team as a code owner May 11, 2022 10:08
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
-              logql	-0.5%
+               loki	0%

Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -139,11 +139,15 @@ func (s *indexShipper) AddIndex(tableName, userID string, index index.Index) err

func (s *indexShipper) ForEach(ctx context.Context, tableName, userID string, callback func(index index.Index) error) error {
if s.downloadsManager != nil {
return s.downloadsManager.ForEach(ctx, tableName, userID, callback)
if err := s.downloadsManager.ForEach(ctx, tableName, userID, callback); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I thought this was by design: only using either the downloads mgr or the uploads mgr so we didn't query the same indices in R/W mode for the shipper.

@@ -186,7 +186,7 @@ func parseMultitenantTSDBNameFromBase(name string) (res MultitenantTSDBIdentifie
}

xs := strings.Split(trimmed, "-")
if len(xs) != 2 {
if len(xs) < 2 {
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch

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.

3 participants