Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
  • Loading branch information
mch2 committed Jan 10, 2025
1 parent 002323e commit 09bd2c8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ private Decision underCapacity(ShardRouting shardRouting, RoutingNode node, Rout
}

IndexMetadata indexMetadata = allocation.metadata().getIndexSafe(shardRouting.index());
int shardCount = indexMetadata.getNumberOfReplicas() + 1; // 1 for primary
// if a search only shard, check if we have dedicated hardware, otherwise all shard types are considered equal.
int shardCount = shardRouting.isSearchOnly() ? indexMetadata.getNumberOfSearchOnlyReplicas() : indexMetadata.getNumberOfReplicas() + 1; // 1 for primary
for (String awarenessAttribute : awarenessAttributes) {
// the node the shard exists on must be associated with an awareness attribute.
if (isAwarenessAttributeAssociatedWithNode(node, awarenessAttribute) == false) {
Expand Down

0 comments on commit 09bd2c8

Please sign in to comment.