-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(upgrade): ensure query config written by influxd upgrade
is valid
#21321
Conversation
case int32: | ||
concurrency = int64(c) | ||
case int64: | ||
concurrency = c |
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.
All these cases are paranoia on my part; I'm not sure when the config-loader would pick each type of int.
} | ||
|
||
// When query-concurrency is > 0, query-queue-size must also be > 0. | ||
v2Config["query-queue-size"] = concurrency |
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.
There's a risk here that:
- Somebody will pick a huge value for query-concurrency
- We write the same value into query-queue-size
- At startup, the server uses the huge value for query-queue-size as the size of a new
chan
, consuming a lot of memory all at once
I'm assuming the risk is low now that we support 0 for unlimited, so most people who would be writing huge concurrency values can now write 0 instead.
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.
LGTM to me. I hate the type switch, but can't think of any way to improve it....
…id (#21321) * test: refactor upgrade test to cover the config upgrade * fix: ensure upgraded query config is valid
Closes #21315
0
to10
when upgradingquery-concurrency
config, now that 0 is a valid valuequery-concurrency
, ensure we also write a > 0 value forquery-queue-size
I had to refactor a bunch of things to make our upgrade-real-DB regression test actually test loading upgraded config. I confirmed that the 1st commit fails with the error seen in #21315, and the 2nd commit gets things to pass again.