Describe the bug
As part of #15072, we initialize a new SourceLookup and pass it into each new LeafSearchLookup instance. This is done as the SearchLookup is not thread safe. We noticed performance regression for one of the customer workload with script queries.
Below is the flame graph for same:
Related component
Search
To Reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
SearchLookup should be either:
- Threadsafe, so that all
QueryContext can share the instance
- Shared across slices to not build for every segment
Ideally, I will prefer the first if possible. Since intuitively, it is okay for thread to block on shared resource (assuming only writes are blocking), instead of duplicating the work across separate SourceLookup object
Additional Details
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
- OS: [e.g. iOS]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Describe the bug
As part of #15072, we initialize a new
SourceLookupand pass it into each newLeafSearchLookupinstance. This is done as theSearchLookupis not thread safe. We noticed performance regression for one of the customer workload with script queries.Below is the flame graph for same:
Related component
Search
To Reproduce
Expected behavior
SearchLookupshould be either:QueryContextcan share the instanceIdeally, I will prefer the first if possible. Since intuitively, it is okay for thread to block on shared resource (assuming only writes are blocking), instead of duplicating the work across separate
SourceLookupobjectAdditional Details
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
Add any other context about the problem here.