Skip to content

Commit 696c99d

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

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CHANGELOG.md

+1
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

+5-6
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,11 @@ 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().getAsBoolean(IndexMetadata.INDEX_BLOCKS_SEARCH_ONLY_SETTING.getKey(), false) == false) {
184+
// all primary shards aren't active yet
185+
return false;
186+
}
188187
}
189188
ActiveShardCount waitForActiveShards = this;
190189
if (waitForActiveShards == ActiveShardCount.DEFAULT) {

0 commit comments

Comments
 (0)