-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add support to SavedObjects.find for fetching more than 10k objects #77961
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Thanks for filing this issue, @joshdover. I've just encountered this limitation in the scope of #72420 as well. In a nutshell, when admin wants to bulk rotate SO encryption key we should fetch and process all SO (ideally in batches with a configurable size to balance the load), from all spaces, for all SO types that may have encrypted attributes. And these days we may have quite a lot of them (alerts, actions, fleet related SOs). The fact that we also update some of the fetched results makes paging with only Do you happen to have any recommended workarounds for SO use cases like this? If not, is there anything we can help with to boost priority for this enhancement? cc @elastic/kibana-security |
This is obviously a very stupid option in term of memory usage, but still asking: could using the
This is a configurable via the |
Hi Josh, as we discussed last week, the current limitation impacts the scalability of the Fleet effort. Every agent that connects to Fleet is stored as a saved object that can be managed in the UI. The limitation is currently not too bad for us as we are actively working on improving performance to handle a large number of agents, so the number of users who will reach this limit is small. But we will soon want to get to a point where we can handle >10k agents smoothly so the number of large-scale users will increase. #78520 for describes how the current SO client limits us and our current UI workaround. cc @ph for awareness & prioritization |
In the 7.12 release, the team is going to investigate the basic architecture. |
@pgayvallet, so we did try to use the I am sharing that because using |
I've been looking at For scenarios where we are doing bulk processing of a very large number of object on the server-side, all these solutions would work, as they all would allow to 'scroll' all the results for a query that would exceed the However, as @XavierM mentioned in his comment, one of the most common scenario where we face this limitation is when displaying the saved objects in a paginated table in the UI. To demonstrate, using as example the saved object management table, where we are displaying all the visible saved objects: In this table, we are paginating the results per pages of, say, 100 items. The pagination buttons allow the user to navigate forward, back, to the first or to the last page. Currently, when accessing the page PAGE that displays PER_PAGE results, we are calling As the user is able to navigate from any page to any other page, backward or forward, none of the suggested solutions would work to address this
Which is why I'm wondering: As our indices are now system indices, could we just ask the ES team to change the default value of |
I don't think we'd need to wait for system indices for this? We should be able to set this setting directly on the index during the migration process.
This is my primary question. I'm curious if the Elasticsearch performance issues scale with the number of documents or the size (as in bytes) of the results. Since we're primarily paginating large numbers of really small documents, I'm hoping it's the latter. Would anyone from @elastic/es-perf be able to shed light on this? Specifically, what is the reason for the |
I think changing I think we'll have to do something similar to what @XavierM mentioned where the UI works around the problem. I'm not sure what page size we currently use, but more than 100 results probably don't fit on a screen which means 10k results is at least 100 pages. I don't think users will ever need more pages than that, they should rather narrow down their search. So then the UI could use We would have to add a tiebreaker field to all saved objects to allow the find API to support > 10k search results using |
I overall agree that implementing
The good old Note that one notable constraint/limitation of such approach is that we would only be allowed to sort by this Also, this would require to migrate all SO objects during a migration to populate this field, which is kinda unsupported at the moment (even if adding 'internal' migrations to core to impact all types should be doable) |
As mentioned during the breakout session, we should probably split that into two distinct tasks:
The main goal of this issue is to address the problems related to SO import/export and our consumers that needs to 'scroll' over more than 10k objects. The 'paginated tables' issue when there is more than 10k objects should be addressed at a later time (and probably just by informing the user than only the 10k first objects can be displayed, as suggested in #77961 (comment)) |
I've opened #86300 to discuss how we might add a tie_breaker, but as a first iteration we could use |
Closing as we should now have the ability to page through >10k objects as of #89915 (We still have a separate issue open regarding adding a tiebreaker, but that did not end up blocking this effort after all) [edit] Feel free to re-open if there's something I've missed here! |
The current
find
API on the SavedObjectRepository cannot page through large data sets due to theindex.max_result_window
setting in Elasticsearch which defaults to 10,000 objects. This is starting to limit what plugins can build and we have several types of SOs that may have large numbers of objects now (SIEM's exception lists come to mind).To alleviate this, we could add scrolling support to SavedObjects, however, there is one significant caveat: scrolls have a TTL in Elasticsearch, meaning that cursors are invalidated after a fairly short time period by default. Clients would need to be aware of this and handle it properly and it may not be easy to realize this in development.
Another option could be
_async_search
APIs, but those are not available in OSS distributions.This issue definitely needs further investigation, but I wanted to open it to start collecting usecases where it would be useful.
related: #22636
#64715
The text was updated successfully, but these errors were encountered: