Unable to create component template updating component template results in invalid composable template after templates are merged

On 8.12.0 I am hitting this again

`
Unable to create component template

updating component template [metrics-mysql.performance@custom] results in invalid composable template [metrics-mysql.performance] after templates are merged
`

Before in Upgrading component template logs-settings failed after update to 8.9 路 Issue #98247 路 elastic/elasticsearch 路 GitHub it was the mapping of @timestamp field

Now there seems to be something else :frowning:

Hi @florinsfetea

Do you think you could share your metrics-mysql.performance@custom template to help investigating this one?

{
  "index_templates": [
    {
      "name": "metrics-mysql.performance",
      "index_template": {
        "index_patterns": [
          "metrics-mysql.performance-*"
        ],
        "template": {
          "settings": {
            "index": {
              "mode": "time_series"
            }
          },
          "mappings": {
            "_meta": {
              "package": {
                "name": "mysql"
              },
              "managed_by": "fleet",
              "managed": true
            }
          }
        },
        "composed_of": [
          "metrics@tsdb-settings",
          "metrics-mysql.performance@package",
          "metrics-mysql.performance@custom",
          ".fleet_globals-1",
          ".fleet_agent_id_verification-1"
        ],
        "priority": 200,
        "_meta": {
          "package": {
            "name": "mysql"
          },
          "managed_by": "fleet",
          "managed": true
        },
        "data_stream": {
          "hidden": false,
          "allow_custom_routing": false
        }
      }
    }
  ]
}




{
  "component_templates": [
    {
      "name": "metrics-mysql.performance@package",
      "component_template": {
        "template": {
          "settings": {
            "index": {
              "lifecycle": {
                "name": "metrics"
              },
              "default_pipeline": "metrics-mysql.performance-1.17.0",
              "mapping": {
                "total_fields": {
                  "limit": "10000"
                }
              },
              "query": {
                "default_field": [
                  "ecs.version",
                  "service.address",
                  "service.type",
                  "agent.id",
                  "cloud.account.id",
                  "cloud.region",
                  "cloud.instance.id",
                  "cloud.provider",
                  "cloud.availability_zone",
                  "container.id",
                  "host.name",
                  "mysql.performance.events_statements.query_id",
                  "mysql.performance.table_io_waits.object.schema",
                  "mysql.performance.table_io_waits.object.name",
                  "mysql.performance.table_io_waits.index.name"
                ]
              }
            }
          },
          "mappings": {
            "_source": {
              "mode": "synthetic"
            },
            "properties": {
              "cloud": {
                "properties": {
                  "availability_zone": {
                    "time_series_dimension": true,
                    "type": "keyword"
                  },
                  "instance": {
                    "properties": {
                      "id": {
                        "time_series_dimension": true,
                        "type": "keyword"
                      }
                    }
                  },
                  "provider": {
                    "time_series_dimension": true,
                    "type": "keyword"
                  },
                  "region": {
                    "time_series_dimension": true,
                    "type": "keyword"
                  },
                  "account": {
                    "properties": {
                      "id": {
                        "time_series_dimension": true,
                        "type": "keyword"
                      }
                    }
                  }
                }
              },
              "container": {
                "properties": {
                  "id": {
                    "time_series_dimension": true,
                    "type": "keyword"
                  }
                }
              },
              "agent": {
                "properties": {
                  "id": {
                    "time_series_dimension": true,
                    "type": "keyword"
                  }
                }
              },
              "@timestamp": {
                "ignore_malformed": false,
                "type": "date"
              },
              "ecs": {
                "properties": {
                  "version": {
                    "ignore_above": 1024,
                    "type": "keyword"
                  }
                }
              },
              "data_stream": {
                "properties": {
                  "namespace": {
                    "type": "constant_keyword"
                  },
                  "type": {
                    "type": "constant_keyword"
                  },
                  "dataset": {
                    "type": "constant_keyword"
                  }
                }
              },
              "service": {
                "properties": {
                  "address": {
                    "time_series_dimension": true,
                    "type": "keyword"
                  },
                  "type": {
                    "ignore_above": 1024,
                    "type": "keyword"
                  }
                }
              },
              "host": {
                "properties": {
                  "name": {
                    "time_series_dimension": true,
                    "type": "keyword"
                  }
                }
              },
              "mysql": {
                "properties": {
                  "performance": {
                    "properties": {
                      "table_io_waits": {
                        "properties": {
                          "count": {
                            "properties": {
                              "fetch": {
                                "time_series_metric": "gauge",
                                "meta": {},
                                "type": "long"
                              }
                            }
                          },
                          "index": {
                            "properties": {
                              "name": {
                                "ignore_above": 1024,
                                "type": "keyword"
                              }
                            }
                          },
                          "object": {
                            "properties": {
                              "schema": {
                                "time_series_dimension": true,
                                "type": "keyword"
                              },
                              "name": {
                                "time_series_dimension": true,
                                "type": "keyword"
                              }
                            }
                          }
                        }
                      },
                      "events_statements": {
                        "properties": {
                          "avg": {
                            "properties": {
                              "timer": {
                                "properties": {
                                  "wait": {
                                    "time_series_metric": "gauge",
                                    "meta": {},
                                    "type": "long"
                                  }
                                }
                              }
                            }
                          },
                          "query_id": {
                            "time_series_dimension": true,
                            "type": "keyword"
                          },
                          "last": {
                            "properties": {
                              "seen": {
                                "type": "date"
                              }
                            }
                          },
                          "max": {
                            "properties": {
                              "timer": {
                                "properties": {
                                  "wait": {
                                    "time_series_metric": "gauge",
                                    "meta": {},
                                    "type": "long"
                                  }
                                }
                              }
                            }
                          },
                          "quantile": {
                            "properties": {
                              "95": {
                                "time_series_metric": "gauge",
                                "meta": {},
                                "type": "long"
                              }
                            }
                          },
                          "digest": {
                            "type": "flattened"
                          },
                          "count": {
                            "properties": {
                              "star": {
                                "time_series_metric": "gauge",
                                "meta": {},
                                "type": "long"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "_meta": {
          "package": {
            "name": "mysql"
          },
          "managed_by": "fleet",
          "managed": true
        }
      }
    }
  ]
}