Open original-brownbear opened 2 years ago
Pinging @elastic/es-distributed (Team:Distributed)
I took a look at adding chunking to the cluster state API and it is not a small task. Yet I think it's important, we still have clients that monitor things by requesting the whole routing table sometimes and they're not going away any time soon. I don't think we can just add chunking to the routing table part, making everything else a single chunk, since you pointed out elsewhere that this moves all the serialization work back onto the transport threads. So we have to do it properly. I think we can do it in stages tho, starting at the bottom and using wrapAsXContentObject
as needed to keep the work off of transport threads until we get to the top:
Metadata.Custom
implement ChunkedToXContent
instead of ToXContentFragment
. (25 implementations of toXContent
as I write this, some of them pretty large). Metadata
implement ChunkedToXContent
(likely impacts PersistedClusterStateService
).ClusterState.Custom
implement ChunkedToXContent
instead of ToXContentFragment
. (https://github.com/elastic/elasticsearch/pull/91963)ClusterState
fully chunked.I think that's everything but the various search APIs, for which I think we should ask for help from the search team. Should we open a separate issue for the search team about that, and then close this one?
Pinging @elastic/es-search (Team:Search)
Heya, I added the Search label so that this is on our radar, given that the only remaining task is ours.
We now have a Search meta issue (#95661), so I am removing the search area label from this one.
Now that #88311 has landed and we have the infrastructure for serializing chunked REST responses, we should make use of it to fix the massive memory usage of APIs that are known to return large responses:
POST _cluster/reroute
(includes the cluster state) (https://github.com/elastic/elasticsearch/pull/92615)