OpenSearch/x-pack/plugin
Alexander Reelsen 139128856a
Watcher: Use Bulkprocessor in HistoryStore/TriggeredWatchStore (#32490)
Currently a watch execution results in one bulk request, when the
triggered watches are written into the that index, that need to be
executed. However the update of the watch status, the creation of the
watch history entry as well as the deletion of the triggered watches
index are all single document operations.

This can have quite a negative impact, once you are executing a lot of
watches, as each execution results in 4 documents writes, three of them
being single document actions.

This commit switches to a bulk processor instead of a single document
action for writing watch history entries and deleting triggered watch
entries. However the defaults are to run synchronous as before because
the number of concurrent requests is set to 0. This also fixes a bug,
where the deletion of the triggered watch entry was done asynchronously.

However if you have a high number of watches being executed, you can
configure watcher to delete the triggered watches entries as well as
writing the watch history entries via bulk requests.

The triggered watches deletions should still happen in a timely manner,
where as the history entries might actually be bound by size as one
entry can easily have 20kb.

The following settings have been added:

- xpack.watcher.bulk.actions (default 1)
- xpack.watcher.bulk.concurrent_requests (default 0)
- xpack.watcher.bulk.flush_interval (default 1s)
- xpack.watcher.bulk.size (default 1mb)

The drawback of this is of course, that on a node outage you might end
up with watch history entries not being written or watches needing to be
executing again because they have not been deleted from the triggered
watches index. The window of these two cases increases configuring the bulk processor to wait to reach certain thresholds.
2018-09-18 10:25:16 +02:00
..
ccr [CCR] Changed AutoFollowCoordinator to keep track of certain statistics (#33684) 2018-09-18 09:43:50 +02:00
core [CCR] Changed AutoFollowCoordinator to keep track of certain statistics (#33684) 2018-09-18 09:43:50 +02:00
deprecation Remove unsupported Version.V_5_* (#32937) 2018-08-24 09:51:21 +02:00
graph Build: Rework shadow plugin configuration (#32409) 2018-08-21 20:03:28 -04:00
logstash Build: Rework shadow plugin configuration (#32409) 2018-08-21 20:03:28 -04:00
ml [ML] Allow overrides for some file structure detection decisions (#33630) 2018-09-14 09:29:11 +01:00
monitoring Implement xpack.monitoring.elasticsearch.collection.enabled setting (#33474) 2018-09-17 18:33:43 -07:00
rollup Add create rollup job api to high level rest client (#33521) 2018-09-17 09:10:23 +02:00
security Docs: Fixed a grammatical mistake: 'a HTTP ...' -> 'an HTTP ...' (#33744) 2018-09-17 15:35:54 -04:00
sql SQL: Return functions in JDBC driver metadata (#33672) 2018-09-14 09:05:34 +03:00
src/test Keep CCR REST API specification with all of X-Pack (#33743) 2018-09-17 09:59:22 -04:00
upgrade HLREST: add reindex API (#32679) 2018-08-28 13:02:23 -04:00
watcher Watcher: Use Bulkprocessor in HistoryStore/TriggeredWatchStore (#32490) 2018-09-18 10:25:16 +02:00
build.gradle Allow Integ Tests to run in a FIPS-140 JVM (#31989) 2018-07-24 12:48:14 +03:00