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

Prevents single split searches from different leaf_search from interleaving #5509

Merged
merged 2 commits into from
Oct 23, 2024

Commits on Oct 22, 2024

  1. Prevents single split searches from different leaf_search from

    interleaving.
    
    Before this PR, we just used a semaphore to acquire a permit and
    start a new tokio task to run our single split search.
    
    In pseudo code, a leaf_search would look like:
    ```
    for split in splits {
        let permit = semaphore.acquire().await;
        tokio::spawn(async move {
           single_split_search(split);
           drop(permit)
        })
    }
    ```
    
    The problem with this is that it allows interleaving split search from
    one search request with another one.
    
    This interleaving strongly impacts search latency.
    For instance, one can imagine two queries A and B with 3 splits each.
    Executing as follows
    | A | A | A | B | B | B |
    offers a much short latency for A than
    | A | B | B | A | B | A |
    
    This PR also adds two metrics to monitor the number of queue single
    split search.
    fulmicoton committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    61483b9 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2024

  1. CR comments

    fulmicoton committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    e028746 View commit details
    Browse the repository at this point in the history