-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Use chunked encoding for RestGetSettingsAction #90326
Use chunked encoding for RestGetSettingsAction #90326
Conversation
This one needs chunked encoding as well, the response easily grows to O(10M) for large deployments with many indices. Especially when settings are numerous or have large values like e.g. settings from the Beats templates.
Pinging @elastic/es-distributed (Team:Distributed) |
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.
I'd sort of prefer that we ensured not to implement ToXContent
now, rather than later. This PR would (I think) need additional changes to accomodate that change. And as such we are building up debt that we'd need to tackle in the future rather than in individual PRs like this one.
@@ -154,38 +144,44 @@ public String toString() { | |||
try { | |||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
XContentBuilder builder = new XContentBuilder(JsonXContent.jsonXContent, baos); | |||
toXContent(builder, ToXContent.EMPTY_PARAMS, false); | |||
var iterator = toXContentChunked(false); |
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.
If we think this can grow to 10M+, should we then not avoid assembling this fully here, i.e., limit the output to say 100 entries?
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.
Fair point, not entirely trivial to do that, would have to add more logic to achieve that. I wonder if it matters all that much, we have the same problem for the other large responses as well.
I'll try to address this in the next PR on this while dropping the toXContent
from these objects also. Incoming :)
Thanks Henning! It's hard to drop |
This one needs chunked encoding as well, the response easily grows to O(10M) for large deployments with many indices. Especially when settings are numerous or have large values like e.g. settings from the Beats templates.
relates #89838