Skip to content

Commit e7356cf

Browse files
Update ActiveShardCount search_only mode condition
Signed-off-by: Prudhvi Godithi <[email protected]>
1 parent a61160c commit e7356cf

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2626
- Add GRPC DocumentService and Bulk endpoint ([#17727](https://github.com/opensearch-project/OpenSearch/pull/17727))
2727
- Added scale to zero (`search_only` mode) support for OpenSearch reader writer separation ([#17299](https://github.com/opensearch-project/OpenSearch/pull/17299)
2828
- [Star Tree] [Search] Resolving numeric range aggregation with metric aggregation using star-tree ([#17273](https://github.com/opensearch-project/OpenSearch/pull/17273))
29+
- Support `_close` and `_open` APIs for indices in `search_only` mode ([#17844](https://github.com/opensearch-project/OpenSearch/pull/17844))
2930

3031
### Changed
3132
- Migrate BC libs to their FIPS counterparts ([#14912](https://github.com/opensearch-project/OpenSearch/pull/14912))

server/src/main/java/org/opensearch/action/support/ActiveShardCount.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ public boolean enoughShardsActive(final ClusterState clusterState, final String.
179179
}
180180
assert indexRoutingTable != null;
181181

182-
boolean isSearchOnlyClusterBlockEnabled = indexMetadata.getSettings()
183-
.getAsBoolean(IndexMetadata.INDEX_BLOCKS_SEARCH_ONLY_SETTING.getKey(), false);
184-
185-
if (isSearchOnlyClusterBlockEnabled == false && indexRoutingTable.allPrimaryShardsActive() == false) {
186-
// all primary shards aren't active yet
187-
return false;
182+
if (indexRoutingTable.allPrimaryShardsActive() == false) {
183+
if (indexMetadata.getSettings()
184+
.getAsBoolean(IndexMetadata.INDEX_BLOCKS_SEARCH_ONLY_SETTING.getKey(), false) == false) {
185+
// all primary shards aren't active yet
186+
return false;
187+
}
188188
}
189189
ActiveShardCount waitForActiveShards = this;
190190
if (waitForActiveShards == ActiveShardCount.DEFAULT) {

0 commit comments

Comments
 (0)