opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.67k stars 1.79k forks source link

Configuring default replica count for new indices #5457

Open gbbafna opened 1 year ago

gbbafna commented 1 year ago

Is your feature request related to a problem? Please describe.

In OpenSearch default replica count is always 1. There is no mechanism to configure the default value.

In absence of same, user will need to provide replica count while creating index / index template .

Describe the solution you'd like

In scenarios where cluster.routing.allocation.awareness.force is present , we can use the total awareness attribute value count as an indicator for total copies.

The downside of this solution is it can cause a change in behavior for existing customers using cluster.routing.allocation.awareness.force and having indices with lower replica count. To prevent this , we will need to introduce another cluster level setting use_force_zone_for_replica which can be false by default.

Describe alternatives you've considered

We can create a cluster level setting default_replica_count which can be used to tweak the default value of 1. The default value of this setting will be 1 .

Additional context Add any other context or screenshots about the feature request here.

anasalkouz commented 1 year ago

@gbbafna I see your PR already merged, any remaining effort? otherwise, feel free to close it.