-
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
[BUG] [Segment Replication] Handle percolate queries #9669
Comments
@dreamer-89 , Not sure how percolate queries will be impacted by replication method. could you elaborate more? |
For percolate queries, we must initially index a document of the queries that we would want to execute on an index/indices. So the behavior here is we initially index a document of queries and then immediately run percolate query using the index storing the queries, which was just written to for adding the queries to run, against the data that we would want to query. In the Alerting plugin this is impactful because when we run Document level monitors, we are updating an alerting index (we have a refresh immediate policy) that stores the queries we want to run and then immediately run the percolate query to query the data. This means we are immediately reading after writing for the alerting index. With the seg rep changes, the core needs to makes changes in the percolate query logic so it searches the primary shards of the index that stores the queries, so the most up to date queries are retrieved and the query would output the correct results. |
and what is the concern with the proposed solution by routing queries to the primary shard? |
Just want to call out for Segment Replication to be enabled by default, this issue would need to be fixed. |
For 2.10 SegRep is not enabled by default, and we will document this percolate query gap on SegRep documentation. We will track adding the ability to route percolate queries to primary separately and it should't be a blocker for 2.10. |
The problem is caused by the current limitation which described in issue #8700 Specifically, the solution here is to identify percolate query from the search request that comes into OpenSearch/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java Line 464 in 1164221
|
I don't think we should route it to primary by default. We should keep this to user if they want to route to primary, we only need to give them the ability to choose per query. |
There is a When running the search request with To clarify the parameters, there are 2 |
Proposing #10150 as an alternative here to updating the clients with prefer primary. |
Alerting has updated to prefer primary opensearch-project/alerting#1205 - we don't have any special handling of percolate queries required. |
Coming from discussion in opensearch-project/alerting#974 (comment), core needs to handle percolate queries for SEGMENT replication enabled indices.
CC @mch2 @anasalkouz
The text was updated successfully, but these errors were encountered: