Skip to content

Commit

Permalink
Add _primary preference only for segment replication enabled indices (#…
Browse files Browse the repository at this point in the history
…2040)

* Add _primary preference only for segment replication enabled indices

Signed-off-by: Suraj Singh <[email protected]>

* Add test for segment replication tests

Signed-off-by: Suraj Singh <[email protected]>

* Remove isSegRepEnabled check and use _primary_first preference

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused ClusterState reference

Signed-off-by: Suraj Singh <[email protected]>

* Self review

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
(cherry picked from commit 9c12628)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Sep 1, 2023
1 parent c3071fd commit 5845e26
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ private List<DataSourceMetadata> searchInDataSourcesIndex(QueryBuilder query) {
searchSourceBuilder.query(query);
searchSourceBuilder.size(DATASOURCE_QUERY_RESULT_SIZE);
searchRequest.source(searchSourceBuilder);
// https://github.com/opensearch-project/sql/issues/1801.
searchRequest.preference("_primary_first");
ActionFuture<SearchResponse> searchResponseActionFuture;
try (ThreadContext.StoredContext ignored =
client.threadPool().getThreadContext().stashContext()) {
Expand Down

0 comments on commit 5845e26

Please sign in to comment.