elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.94k stars 24.74k forks source link

duplicate name in `_cat/templates` #97309

Open Morriaty-The-Murderer opened 1 year ago

Morriaty-The-Murderer commented 1 year ago

Elasticsearch Version

7.10.0

Installed Plugins

No response

Java Version

bundled

OS Version

it's cloud server, cannot ssh to server. maybe centos

Problem Description

image image

  1. duplicate name in _cat/templates, but _template/web* only shows one template
  2. when a new index web_monitor_new created, it applied the old version template
  3. delete the _template/web_monitor, and re-put _template/web_monitor, all goes fine
  4. I don't know how it happened, cannot reproduce.

Steps to Reproduce

I don't know how it happened, cannot reproduce.

Logs (if relevant)

No response

elasticsearchmachine commented 1 year ago

Pinging @elastic/es-data-management (Team:Data Management)

joegallo commented 1 year ago

I suspect one of these is a legacy index template and one is a composable index template (the composed_of column in your screenshot gives me a big hint on that).

@Morriaty-The-Murderer can you paste me the output of running the following two commands? (Feel free to elide anything you consider sensitive.)

GET _template/web_monitor

GET _index_template/web_monitor

Reading the docs on (composable) index templates, I see the following:

Composable templates take precedence over legacy templates. If no composable template matches a given index, a legacy template may still match and be applied.

If I'm right about the nature of the situation, then I definitely see how it could be confusing. If you're only interested in using one of them, then we just delete the other (and leave it deleted), and I imagine that'll fix things up.