Skip to content

Some Elasticearch settings are mutually exclusive when specified as YAML #122269

@pebrc

Description

@pebrc

Elasticsearch Version

8.17.1

Installed Plugins

No response

Java Version

bundled

OS Version

Linux

Problem Description

cluster.max_shards_per_node: 1000
cluster.max_shards_per_node.frozen: 1000 

in flat notation expands to the following (invalid) YAML

cluster:
  max_shards_per_node: 1000
  max_shards_per_node:
    frozen: 1000 

^ max_shards_per_node cannot be both a scalar value and an object

According to the official Elasticsearch documentation both formats can be used interchangeably: https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#_config_file_format

This becomes a problem for example for the ECK operator that normalizes user submitted configuration in order to merge ECK operator specific configuration into it, making it impossible to use both settings from elasticsearch.yml

See elastic/cloud-on-k8s#8470

Steps to Reproduce

Configure Elasticsearch with the configuration snippet from the problem description:

cluster:
  max_shards_per_node: 1000
  max_shards_per_node:
    frozen: 1000 

or via ECK

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: es 
spec:
  version: 8.17.0
  nodeSets:
  - name: default
    config:
      cluster.max_shards_per_node: 2000
      cluster.max_shards_per_node.frozen: 4000

Logs (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions