-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Closed
Copy link
Description
Many watches check the hit count in their condition (either a script condition or a compare condition) in order to determine if any documents have been returned.
As Elasticsearch 7.0 will not return hit counts by default, those watches would break silently on upgrade. We need to come up with a strategy to keep those watches running and/or properly notify the user that a new parameter is required.
A couple of common strategies:
- Always add the correct header to the search to return hit counts. Then no watch ever will profit from the speed up we have gained by disabling hit counts. This is fully BWC compatible
- Use the Upgrade API to check the conditions (the main condition plus all the action conditions) if there is a mention of
hits.total, and if that is the case, change the search inputs to include that parameter. Then we can run the upgrade API before upgrading and thus change each watch accordingly. Note that this means, checking all the nested actions in chained actions as well.
Also, it might make sense to spill a useful error message, if a user is missing this parameter but specifies hits.total in a watch, to ease the switch from 6.0 to 7.0 - otherwise the user will only notice this new behaviour when checking the watch history or running the execute watch API.
/cc @jakelandis