-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Watcher history created as index with wrong mapping instead of data stream after 8.0 upgrade #85043
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
Comments
Pinging @elastic/es-data-management (Team:Data Management) |
I believe this is caused by #82395 , which is a reaction to #82109. It's hard to follow the history, but there is indeed a race condition in the cluster for when Watcher can start and when all of the needed resources such as index templates are in place. We can't simply revert #82395 since it would re-introduce the worse side of this race condition - silently stopping Watcher until a manual restart or changes to the shard allocation. Attempts to mitigate a related issue was introduced on #69147 and since upgrades now require 7.last I think the requirement to upgrade the template on the master node might be unnecessary and no longer requiring the master node might be the fix here. I assume (not verified) that this can only happen if a Watcher node is upgraded before the master node. Not a great workaround ... but if you delete the index after the cluster is fully upgraded it will be recreated properly as the data stream with the correct mappings. |
The master node was required to install Watcher index templates in earlier versions of 7.x to ensure that the master node was aware of composable index templates. When upgrading to 8.x this is no longer an issue since all upgrade paths require elder version of Elasticsearch to be on a version that is aware of composable index templates. This should fix #85043 by ensuring that the watcher history index template is always in place prior to it's intended usage irregardless of the order of which nodes are upgraded.
…5287) The master node was required to install Watcher index templates in earlier versions of 7.x to ensure that the master node was aware of composable index templates. When upgrading to 8.x this is no longer an issue since all upgrade paths require elder version of Elasticsearch to be on a version that is aware of composable index templates. This should fix elastic#85043 by ensuring that the watcher history index template is always in place prior to it's intended usage irregardless of the order of which nodes are upgraded.
…85294) The master node was required to install Watcher index templates in earlier versions of 7.x to ensure that the master node was aware of composable index templates. When upgrading to 8.x this is no longer an issue since all upgrade paths require elder version of Elasticsearch to be on a version that is aware of composable index templates. This should fix #85043 by ensuring that the watcher history index template is always in place prior to it's intended usage irregardless of the order of which nodes are upgraded.
Uh oh!
There was an error while loading. Please reload this page.
Elasticsearch Version
8.0.1
Installed Plugins
No response
Java Version
bundled
OS Version
Elastic Cloud
Problem Description
After upgrading from 7.17 to 8.0.1 we noticed that some watches would not write their history.
The ES logs has many log lines similar to
[instance-0000000115] watch history could not be written [mywatch_5a0585ef-b8b1-4526-8b24-9fb9bf58981d-2022-03-15T11:29:32.801579308Z], failure [org.elasticsearch.index.mapper.MapperParsingException: failed to parse]
I noticed that
.watcher-history-16
has the wrong mapping as everything just has default.text
+.keyword
, and the index template has a lot more specific fields. But the index template applies to a data stream, but.watcher-history-16
got created as an index, so the template didn't apply. It should have been created as a data stream after #64252, but somehow it didn't.Steps to Reproduce
(unconfirmed)
Create a 7.17 cluster with multiple nodes
Create multiple watches that fire rapidly.
Upgrade ES to 8.x
.watcher-history-16
should be created as data stream, but got created as an index.I tried it with a simple cluster and one watch firing every second and it upgraded to datastream, so it might be a race condition or depend on how many watches/how many nodes (we have ~80 watches/12 nodes)
Logs (if relevant)
No response
This looks a bit similar to #56732 except now that it's a data stream it won't be "fixed" by waiting until roll over.
The text was updated successfully, but these errors were encountered: