-
Notifications
You must be signed in to change notification settings - Fork 654
store-gateway: use streaming for skipchunks requests #12818
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
Conversation
3fd5299
to
f31cf68
Compare
This changes store-gateways to use the streaming code path for requests where chunks are not sent. This provides the same results to queriers since they already know how to parse the streaming response and allows us to remove the non-streaming code path in the store-gateway. Notably however, this change does not remove any of the non-streaming code from queriers. This is required to avoid failing requests during a rollout. When queriers make requests without chunks to new store- gateways, the streaming code path will be used and queriers will be able to parse the result. When requests without chunks are made to older store-gateways the non-streaming code path will be used which queriers are still able to parse the result of. Part of #12673 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
f31cf68
to
5d5dc90
Compare
} | ||
|
||
if req.StreamingChunksBatchSize > 0 && !req.SkipChunks { | ||
if !req.SkipChunks { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Rather than having if !req.SkipChunks { A } else { B }
, what if we flipped this around to avoid the negation (ie. if req.SkipChunks { B } else { A }
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in abfbb24
pkg/storegateway/bucket.go
Outdated
}() | ||
defer func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Any reason to have these as separate defer
s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in abfbb24
pkg/storegateway/bucket.go
Outdated
// and hit the limit prematurely. | ||
chunksLimiter := s.chunksLimiterFactory(s.metrics.queriesDropped.WithLabelValues("chunks")) | ||
seriesLimiter := s.seriesLimiterFactory(s.metrics.queriesDropped.WithLabelValues("series")) | ||
if !req.SkipChunks { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we don't do anything other than return after this if
block, what if we invert the condition and return early if req.SkipChunks
is true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in abfbb24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog looks good! I made a small suggestion.
Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
What this PR does
This changes store-gateways to use the streaming code path for requests where chunks are not sent. This provides the same results to queriers since they already know how to parse the streaming response and allows us to remove the non-streaming code path in the store-gateway.
Notably however, this change does not remove any of the non-streaming code from queriers. This is required to avoid failing requests during a rollout. When queriers make requests without chunks to new store-gateways, the streaming code path will be used and queriers will be able to parse the result. When requests without chunks are made to older store-gateways the non-streaming code path will be used which queriers are still able to parse the result of.
Which issue(s) this PR fixes or relates to
Part of #12673
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
. If changelog entry is not needed, please add thechangelog-not-needed
label to the PR.about-versioning.md
updated with experimental features.