Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The index mode validation doesn't always kick in when updating settings #110265

Closed
martijnvg opened this issue Jun 28, 2024 · 1 comment · Fixed by #110268
Closed

The index mode validation doesn't always kick in when updating settings #110265

martijnvg opened this issue Jun 28, 2024 · 1 comment · Fixed by #110268

Comments

@martijnvg
Copy link
Member

martijnvg commented Jun 28, 2024

The index.mode setting is an index setting that is somewhat special. Besides that it validates itself, it also validation other index settings. Unfortunately this doesn't always kick in.

When creating a new index it does kick in:

PUT index1
{
  "settings": {
    "index.time_series.start_time": "2000-01-01T00:00Z",
    "index.time_series.end_time": "2000-01-01T00:00Z"
  }
}

However when creating a new index and then updating the index settings the index.mode validation does not kick in:

PUT index1

PUT /_settings
{
  "settings": {
    "index.time_series.end_time": "2000-01-02T00:00Z"
  }
}

GET index1

This leaves the cluster in a bad state, as the validation does kick in later during unrelated operations. Like updating another unrelated index setting or when a new node joins the cluster.

Note that if index.mode index setting is configured to standard, then the index mode validation does kick in

The expect outcome is that when updating index settings that index.mode validation is also performed.

@martijnvg martijnvg added >bug :StorageEngine/TSDB You know, for Metrics labels Jun 28, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@martijnvg martijnvg changed the title The index mode validation doesn't kick in when updating settings The index mode validation doesn't always kick in when updating settings Jun 28, 2024
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Jun 28, 2024
…tting hasn't been defined.

The `index.mode` setting validates other index settings.
When updating the `index.routing_path` or `index.time_series.*` settings and the `index.mode` setting isn't already defined or present in put settings api, then validation is skipped which results into (worse) errors at a later point in  time.

Closes elastic#110265
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Jul 2, 2024
… in normal indices (elastic#110268)

The index.mode setting validates other index settings. When updating the index.time_series.end_time setting and the index.mode setting isn't wasn't defined at index creation time (meaning that default is active), then this validation is skipped which results into (worse) errors at a later point in time.

This problem is fixed by enforced by making index.mode setting a dependency of index.time_series.end_time setting.

Note that this problem doesn't exist for the index.time_series.start_time and index.routing_path index settings, because these index settings are final, which mean these can only be defined when an index is being created.

Closes elastic#110265
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants