-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Meta] Verify efficient usage of createPointInTimeFinder #203017
Comments
@kc13greiner what's the priority on auditing and mitigating? |
Heya @TinaHeiligers , I would appreciate the audit portion as soon as teams are able! Priority on mitigating/fixes will depend on other factors. |
@kc13greiner what's the alternative? |
Heya @shahzad31 ! Mitigation ideas have been added above (Thanks, @rudolf !). There may be other solutions to fix this bad pattern, but we leave that up to the individual team |
I recall some issues with ZDT and model versions returning fewer fields from ES, but I cannot find a related issue. @rudolf, do you have any ideas, or am I imaging this 🙂 ? |
@cnasikas you're right, if you retrieve a subset of fields then we can't safely migrate the document https://github.com/elastic/kibana/blob/main/packages/core/saved-objects/core-saved-objects-api-server/src/apis/find.ts#L72-L79 I think the impact is limited to if you have a model version with a There is also an edge case with encrypted saved objects where if you include an encrypted field in the |
@kc13greiner I took a look at our use cases and I think we're good.
|
@kc13greiner Core's using aggregations for telemetry collection, so we're good there. The other instances are the base type and implementation of PIT find and our FTR SO client used in testing. |
Summary
Using the
createPointInTimeFinder()
to load an unbounded amount of saved objects and keeping all of these in memory for analysis is not an efficient usage of this function. This inefficient usage can lead to unforeseen issues.Example:
Mitigation
To mitigate this, plugins should consider one of the following approaches (with the top items being more ideal solutions):
filter
or only retrieving an upper bound of documents and usingsort
to retrieve the most relevant docs firstfields
absolutely necessarytitle
field can contain 10mb of text then the above mitigations might not be useful when a page of 1000 documents are retrieved.cases
to count how many of them have adopted a new feature, increment a ui counter or create an EBT event every time a user enables the new feature.Audit your code
Please analyze your team's owned files that contain usages of
createPointInTimeFinder()
as listed in the table below.If you're are loading all results into memory please create a separate issue to remediate and link it in the provided column
If you're not loading all results into memory, please update the
Verified
column toYes
The text was updated successfully, but these errors were encountered: