-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Watcher: 5.x/6x Upgrade breaks with watches with stored scripts and lang field #33058
Comments
Pinging @elastic/es-core-infra |
we talked about this and this is our way forward: We will fix the upgrade helper to also take care of this. Currently the upgrade helper just removes the This script needs to be extended to do the following
This also requires a 5.x backport. The only possibility left over is a |
Took a look at this one, and it is more complex than I originally thought. First, the current check, if a reindex is required, is simply checking for the internal index format being on version The next problem is that it is not sufficient to run the upgrade API once. Imagine this setup
I do not think that it makes a lot of sense for the user to rerun the upgrade API all the time before reindexing. So here comes another proposal to use some form of read-repair in 6.x and not touch 5.x at all. When a watch is parsed, when can manually parse script sections and omit the the scripting language if a script with an id reference is parsed. This way parsing will succeed. As we create a The remaining problem with this approach is the fact, that you may still end up with a stored invalid watch, which needs to be fixed via the upgrade API before the next major release. For the record the following reindex script could be used
|
This has been open for quite a while, and hasn't had a lot of interest. For now I'm going to close this as something we aren't planning on implementing. We can re-open it later if needed. |
Elasticsearch version (
bin/elasticsearch --version
): 6.xWhen a user adds a watch in 5.x, that contains a script and the script section contains a
lang
field, the watch will be broken after upgrading to 6.x. The original PR adding this check was done in #25610Reproduction
Have a 5.x node where you add this script and this watch (or just index via bulk under 6.x as shown as well).
with the following exception
If you store the above watch in 5.x you will get a depreciation message though.
Discuss: Would it make sense to check for the
lang
field in the condition, the transform and the conditions and transforms in the action, and optionally remove thelang
field as part of the reindex that is done when running the upgrade API?This will not catch all the possible cases, but I think 99%.
The text was updated successfully, but these errors were encountered: