-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ML] Adds cache for data recognizer module configs to reduce number of privilege checks #126338
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
Merged
jgowdyelastic
merged 4 commits into
elastic:main
from
jgowdyelastic:adding-data-recognizer-config-cache
Mar 7, 2022
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8789b5f
[ML] Adding data recognizer module config cache
jgowdyelastic 0d87ac1
Merge branch 'main' into adding-data-recognizer-config-cache
kibanamachine 561d3ad
adding comment about cache
jgowdyelastic 3d21669
Merge branch 'adding-data-recognizer-config-cache' of github.com:jgow…
jgowdyelastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we invalidate this cache if the saved object configs have been changed?
Uh oh!
There was an error while loading. Please reload this page.
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.
As I mentioned in the description
Each instance of the
DataRecognizerexists for one endpoint call. The modules on disk will not change in that time frame. The modules in the saved object could theoretically change if someone installs a fleet module at the exact same time, but IMO it is very unlikely.The
_has_privilegescalls were all happening from inside the saved object client and so I imagine adding a check to see if the saved objects have changed each loop would reintroduce them.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.
Suggestion: It would be great if we could add some of the PR description and this explanation as comments to the code so the reasoning is also documented there.
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.
Added in 561d3ad