Skip to content

[RW Separation] Restrict Search Replica Allocation to Search-Dedicated Nodes #17422

@vinaykpud

Description

@vinaykpud

Describe the bug

When an index is created or when search replicas are added for an index, search replicas should be allocated only to nodes that have the search role assigned. If there are no such nodes available, the search replicas should remain in an unassigned state. If a node with the search role becomes available later, the search replicas should be assigned accordingly.

Related component

Search:Performance

To Reproduce

  1. Create a cluster with 3 nodes.
  2. Create an index with the following configuration:
    • 1 Primary shard (1P)
    • 1 Replica shard (1R)
    • 1 Search Replica shard (1SR)
  3. Observe how the shards are allocated across the cluster.
  • Currently, search replicas may get assigned to nodes without the search role, leading to incorrect shard placement.

Expected behavior

  • The primary and replica shards should be assigned to available nodes.
  • The search replica should remain in an unassigned state if no node with the search role exists.
  • If a node with the search role is added to the cluster, the search replica should be assigned to it.

Assigning a search node role for a node:
Ref: #15445

curl -X PUT "http://localhost:9200/_cluster/settings" \
-H "Content-Type: application/json" \
-d '{
  "persistent": {
    "cluster.routing.allocation.search.replica.dedicated.include._name": "node-1"
  }
}'

Additional Details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions