Skip to content

fix: better fix integer overrun when calculating parallelism for very long time range queries - #17430

Merged
slim-bean merged 1 commit into
mainfrom
fix-overflow-take-2
Apr 24, 2025
Merged

fix: better fix integer overrun when calculating parallelism for very long time range queries#17430
slim-bean merged 1 commit into
mainfrom
fix-overflow-take-2

Conversation

@slim-bean

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

#17428 didn't actually fix the issue, I had modified the test parallelism to 2048 when debugging but reverted it to the previous value in the test when cleaning up my PR.

Thanks to @rfratto for being curious here and digging a bit deeper.

The overflow was actually happening in the multiplication of the nanosecond duration of the query length and the query parallelism value.

This PR hopefully really fixes the issue by reducing the precision we use in this calculation, we don't need nanosecond precision for determining an approx weighed parallelism 👍

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
@slim-bean
slim-bean requested a review from a team as a code owner April 24, 2025 00:42
@slim-bean
slim-bean merged commit d660af3 into main Apr 24, 2025
@slim-bean
slim-bean deleted the fix-overflow-take-2 branch April 24, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants