Skip to content
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

Correct profiled rewrite time for knn with a pre-filter #104150

Conversation

benwtrent
Copy link
Member

kNN profiling will fire multiple rewrite actions in a row without stopping a previous one. Right now, this means in production, the rewrite times are inaccurate for knn with a prefilter as we inaccurately calculate the total time (prefilter rewrite & knn rewrite).

This adjusts the interface for rewriting timing to allow concurrent rewriters which then each can update the total rewrite time that we return to the user.

Relates to: #104131

@benwtrent benwtrent added >bug :Search/Search Search-related issues that do not fall into other categories v8.13.0 labels Jan 9, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @benwtrent, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Jan 9, 2024
Copy link
Member

@carlosdelest carlosdelest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM.

Should we test the rewrite time in the profile results? Would it make sense to check that stopAndAddRewriteTime has been called N times depending on the query structure?

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat, thanks for fixing

@benwtrent
Copy link
Member Author

@elasticmachine update branch

@benwtrent benwtrent added the auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jan 10, 2024
@benwtrent
Copy link
Member Author

@elasticmachine update branch

@elasticsearchmachine elasticsearchmachine merged commit 5a71fbe into elastic:main Jan 10, 2024
15 checks passed
@benwtrent benwtrent deleted the feature/fix-knn-prefilter-profiling-1 branch January 10, 2024 19:17
jedrazb pushed a commit to jedrazb/elasticsearch that referenced this pull request Jan 17, 2024
kNN profiling will fire multiple rewrite actions in a row without
stopping a previous one. Right now, this means in production, the
rewrite times are inaccurate for knn with a prefilter as we inaccurately
calculate the total time (prefilter rewrite & knn rewrite). 

This adjusts the interface for rewriting timing to allow concurrent
rewriters which then each can update the total rewrite time that we
return to the user. 

Relates to: elastic#104131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants