Skip to content
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

Merged

Conversation

original-brownbear
Copy link
Member

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

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.
@original-brownbear original-brownbear added >non-issue :Distributed Coordination/Network Http and internode communication implementations v8.6.0 labels Sep 24, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Sep 24, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Copy link
Contributor

@henningandersen henningandersen left a 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);
Copy link
Contributor

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?

Copy link
Member Author

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 :)

@original-brownbear
Copy link
Member Author

Thanks Henning! It's hard to drop toXContent from this one in isolation, it'll be easiest to fix this one off now across all implementations.
It's the next PR on the chunked response front promise :)

@original-brownbear original-brownbear merged commit 2a66741 into elastic:main Sep 27, 2022
@original-brownbear original-brownbear deleted the chunked-get-settings branch September 27, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Network Http and internode communication implementations >non-issue Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants