-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Concurrent Segment Search] Make MultiBucketConsumerService thread safe to use across slices during search #7785
Comments
@sohami we should be very careful to not introduce any contention here, defeating the purpose of searching concurrently. I have not looked into code deeply but have you considered the approach to allow overfetching? We do that for normal search as a limitation (for exactly same reasons) |
@reta With initial look this is what I have found.
With concurrent search the reduce of aggregation will also happen on shards but on single thread during reduce phase. Also this is partial reduce where the bucket consumer is not consulted. So there is no change needed here and will keep the behavior as is. Currently
For Make |
@sohami thanks a lot for the research, My main concern is how much the contention would impact the concurrent search, from this perspective adding more synchronization would definitely have larger (negative) impact. I would suggest to use |
I will be working on this issue |
In order to make MultiBucketConsumer thread safe, these are the following options(neetikasinghal@5153c45): Option 1 Reference to the code pointer: link Average time taken per test for call to the accept function(Total test runs=1000, number of threads per test=6): 1.098ms Pros
Cons
Option 2 Reference to the code pointer: link Average time taken per test for call to the accept function(Total test runs=1000, number of threads per test=6): 1.559ms Pros
Cons
Option 3 Reference to the code pointer: link Average time taken per test for call to the accept function(Total test runs=1000, number of threads per test=6): 1.211ms Pros
Cons
Option 4 Pros
Cons
|
@neetikasinghal Thanks for writing this up! A few questions:
Also a few thoughts that aren't questions:
|
@neetikasinghal I think you could combine the 2 and 3 approach and purely rely on
|
@neetikasinghal @reta: I though about this little more. For |
@jed326 time based check involves some benchmarking which on its on is a bigger design issue, what @sohami suggested above seems to be a better approach on having a range check for CB. |
@sohami what do u think of having Also, taking @reta's suggestion above, accept function would look like as follows:
|
:+1 to try with |
Yes
+1 @neetikasinghal Let's create a PR with the change and we can have more implementation related discussion there. |
Is your feature request related to a problem? Please describe.
With concurrent segment search we will need to make the
MultiBucketConsumer
thread safe as it will be shared across different slices of the shard segments. Ref here.Describe the solution you'd like
Make
MultiBucketConsumer
thread safe. We also need to see if the usage will change with Concurrent flow. For example: currently if both global and non global aggregations are present in a request, it keep tracks of the buckets across both of those and then reset after collection is completed for both aggregations. Given with concurrent segment search reduce is happening separately for both Aggregation types we will need to ensure that reset only happens in postProcess for concurrent model i.e. when both aggregation has completed the reduce phase.The text was updated successfully, but these errors were encountered: