-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Migrations always run if there is an old index template #28174
Comments
Pinging @elastic/kibana-operations |
Seems like Tyler is addressing this specific instance with this PR: #28038 |
We discussed this at length yesterday, and came to a few different conclusions. We should delete the Kibana index template prior to migrating, as we know it contains the old mappings, and that will cause unwanted interference with migrations. But, that's only a partial fix. There still could be other index templates that target the Kibana index, and ES seems to have some magical mapping properites that will just reappear even though they weren't eplicitly stated at creation time: #28038 We need a less fragile way of determining if mapping changes should trigger a migration. @spalger suggested hashing each plugin's mappings, and storing / diffing those hashes. Early on, we abandoned the hashing approach because we thought it'd trigger migrations too often (e.g. in situations where all we really need to do is patch the index mappings (such as adding a new field to a mapping). The hash approach will trigger a full migration on any change, unless we employ some complicated tricks. I think we should move forward with a hash-based mappings diff, though, unless someone can think of a better approach that is robust to mapping properties being inserted by ES internals or broadly scoped index templates. |
Latest master, running against a shared cloud ES instance that has an old index template.
The pattern is adding this mapping:
gis-map.properties.bounds.strategy: 'recursive'
, which no longer exists in the latest version of Kibana. As a result, each time Kibana restarts, it sees that the Kibana index has an old mapping and attempts to migrate.I think the solution is to remove / disable .kibana index templates prior to running migration, but I'm uncertain what potential negative consequences this might have.
Repro steps
yarn start --repl
callCluster('indices.delete', { index: '.kibana_1' })
or whatever)NOTE: if you add
"dynamic": "strict"
to the index template mappings, the migration will fail (because it's adding fields to the mapping).The text was updated successfully, but these errors were encountered: