-
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
[Search Sessions] Optimize search session so updates #142850
[Search Sessions] Optimize search session so updates #142850
Conversation
Documentation preview: |
Pinging @elastic/kibana-app-services (Team:AppServicesSv) |
@elasticmachine merge upstream |
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.
LGTM!
const batchedIdMapping = queue.reduce((res, next) => { | ||
res[next.requestHash] = next.searchInfo; | ||
return res; | ||
}, {} as SearchSessionSavedObjectAttributes['idMapping']); |
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.
Nit: Instead of casting, use queue.reduce<SearchSessionSavedObjectAttributes['idMapping']>
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.
Always forget about this! thanks
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
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.
Import reformatting in x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx
LGTM
Summary
close #141765
This is a follow-up to #139349 that improves search-session saved object update code. This is what was done and why:
updateOrCreate
method)retryOnConflict
.sessionConfig.maxUpdateRetries
from3
to10
. This is done because the old "retry" default was actually 3 on Kibana side (maxUpdateRetries
) * 3 on es side (default in so client) = 9. Since we removed the custom retry code on the Kibana side, to stick to older behavior it makes sense to make it 9 on es side. Rounding to 10 for a nicer number.4.1. Group batching/debounce per
sessionId
4.2. Make batching explicit for
trackId
call only because this is where we actually need this optimization. (After the user saves the session all search requests are immediately polled to be saved into the just created search-session saved object)