Open chishui opened 2 months ago
@mgodwan this bug is different from #14783. #14783 is about create index API with replica parameter set to null and caused NPE, this is about update setting API with null and it doesn't honor the cluster replica configuration
Fixed in #14948
@chishui Thanks for reporting and raising a fix for this.
I have my concern on what should be the number of replicas when null
is supplied. Should null
translate to default count of 3 or it should translate to no replica at all, that is 0.
I suggest that null
should translate to 0 - implying that the user does not actually wants to set any replicas. User not supplying anything should only translate to default replica count.
What are your thoughts @mgodwan?
@sandeshkr419 thanks for the comment. If cluster setting is not configured, then 1 is the default replica number. The default number of 1 has been there and acknowledged by users for really long time. Setting it to 0 means user has no backup for their data and can potentially lose data if they don't explicitly configure the replica number.
Describe the bug
I tried to set
index.number_of_replicas
to null so that it will pick up default replica number configured for cluster.It always sets
index.number_of_replicas
to 1. However, I configuredcluster.default_number_of_replicas
to 3, and when I create the index and not specifyindex.number_of_replicas
, it will use 3 as default replica number.Related component
Indexing
To Reproduce
it returns: { ... "number_of_replicas": 3 }
PUT index/_settings { "index": { "number_of_replicas": null } }
GET index/_settings
it returns: { ... "number_of_replicas": 1 }