elasticsearch/elasticsearch — pull request #3800 by javanna (2013-09-28 20:43:02+00:00)
Title: Added generic cluster state update ack mechanism

Added new AckedClusterStateUpdateTask interface that can be used to submit cluster state update tasks and allows actions to be notified back when a set of (configurable) nodes have acknowledged the cluster state update. Supports a configurable timeout, so that we wait for acknowledgement for a limited amount of time (will be provided in the request as it curently happens, default 10s).

Internally, a low level AckListener is created (InternalClusterService) and passed to the publish method, so that it can be notified whenever each node responds to the publish request. Once all the expected nodes have responded or the timeoeout has expired, the AckListener notifies the action which will return adding the proper acknowledged flag to the response.

Ideally, this new mechanism will gradually replace the existing ones based on custom endpoints and notifications (per api).

Once we get this in I'll start adding this new mechanism to the apis that don't currently support acknowledgements when changing the cluster state (e.g. put and delete warmer etc.).

Closes #3786