Skip to content

fix: fix a bug where limits were incorrect after grafana/loki#16937 #17224

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

Merged
merged 2 commits into from
Apr 15, 2025

Conversation

grobinson-grafana
Copy link
Contributor

@grobinson-grafana grobinson-grafana commented Apr 14, 2025

What this PR does / why we need it:

This pull request fixes a bug where limits were incorrect after the change in #16937. This bug occurred because we stopped asking each limit instance if it knew about all stream hashes, and instead starting asking each limit instance if it knew about the stream hashes for its assigned partitions. This broke the logic in the frontend that was taking the intersection of all responses to calculate if a stream was unknown. It should now take the union instead.

This pull request is stacked on top of #17223.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@grobinson-grafana grobinson-grafana requested a review from a team as a code owner April 14, 2025 22:25
}},
// Each instance will respond stating that it doesn't know about the
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is no longer true, since we stopped sending all stream hashes to all instances.

This commit fixes a bug where limits were incorrect after the change
in #16937. This bug occurred because we stopped asking
each limit instance if it knew about all stream hashes, and instead
starting asking each limit instance if it knew about the stream
hashes for its assigned partitions. This broke the logic in the
frontend that was taking the intersection of all responses to
calculate if a stream was unknown. It should now take the union
instead.
@grobinson-grafana grobinson-grafana force-pushed the grobinson/fix-bug-in-checking-limits branch from 72eb61d to d99494d Compare April 15, 2025 10:25
@grobinson-grafana grobinson-grafana merged commit 805125c into main Apr 15, 2025
61 checks passed
@grobinson-grafana grobinson-grafana deleted the grobinson/fix-bug-in-checking-limits branch April 15, 2025 10:36
chaudum pushed a commit that referenced this pull request Apr 15, 2025
Contains backports of these commits:

```
2cde9b1 fix: skip streams over limits in dry-run mode (#17114)
805125c fix: fix a bug where limits were incorrect after #16937 (#17224)
d106042 fix: fix bug where expectedStreamUsageRequest was not used (#17223)
69aeda1 feat: add tests for enforcing limits in distributors (#17124)
```
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.

2 participants