Skip to content

Conversation

56quarters
Copy link
Contributor

@56quarters 56quarters commented Sep 26, 2025

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

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]. If changelog entry is not needed, please add the changelog-not-needed label to the PR.
  • about-versioning.md updated with experimental features.

@56quarters 56quarters force-pushed the 56quarters/stream-only-2 branch 4 times, most recently from 3fd5299 to f31cf68 Compare September 26, 2025 19:09
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>
@56quarters 56quarters force-pushed the 56quarters/stream-only-2 branch from f31cf68 to 5d5dc90 Compare October 1, 2025 17:31
@56quarters 56quarters marked this pull request as ready for review October 1, 2025 18:24
@56quarters 56quarters requested a review from a team as a code owner October 1, 2025 18:24
}

if req.StreamingChunksBatchSize > 0 && !req.SkipChunks {
if !req.SkipChunks {
Copy link
Contributor

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 })?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in abfbb24

Comment on lines 608 to 609
}()
defer func() {
Copy link
Contributor

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 defers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in abfbb24

// and hit the limit prematurely.
chunksLimiter := s.chunksLimiterFactory(s.metrics.queriesDropped.WithLabelValues("chunks"))
seriesLimiter := s.seriesLimiterFactory(s.metrics.queriesDropped.WithLabelValues("series"))
if !req.SkipChunks {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in abfbb24

Copy link
Contributor

@tacole02 tacole02 left a 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.

56quarters and others added 2 commits October 2, 2025 14:42
Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
@56quarters 56quarters requested a review from charleskorn October 2, 2025 19:26
@56quarters 56quarters merged commit 25f07b7 into main Oct 3, 2025
37 checks passed
@56quarters 56quarters deleted the 56quarters/stream-only-2 branch October 3, 2025 14:57
56quarters added a commit that referenced this pull request Oct 16, 2025
Since #12818, store-gateways no longer send non-streaming series in
any responses. Remove code for handling non-streaming series from the
queryable used with store-gateways.

Part of #12673
56quarters added a commit that referenced this pull request Oct 16, 2025
Since #12818, store-gateways no longer send non-streaming series in
any responses. Remove code for handling non-streaming series from the
queryable used with store-gateways.

Part of #12673
56quarters added a commit that referenced this pull request Oct 20, 2025
Since #12818, store-gateways no longer send non-streaming series in
any responses. Remove code for handling non-streaming series from the
queryable used with store-gateways.

Part of #12673
56quarters added a commit that referenced this pull request Oct 20, 2025
Since #12818, store-gateways no longer send non-streaming series in
any responses. Remove code for handling non-streaming series from the
queryable used with store-gateways.

Part of #12673
56quarters added a commit that referenced this pull request Oct 20, 2025
Since #12818, store-gateways no longer send non-streaming series in
any responses. Remove code for handling non-streaming series from the
queryable used with store-gateways.

Part of #12673

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
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