Skip to content
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

Generic cluster state update ack mechanism #3786

Closed
javanna opened this issue Sep 26, 2013 · 0 comments
Closed

Generic cluster state update ack mechanism #3786

javanna opened this issue Sep 26, 2013 · 0 comments

Comments

@javanna
Copy link
Member

javanna commented Sep 26, 2013

Most of the apis that allow to make changes to the cluster state (e.g. delete index, put mapping, open/close index) currently support an acknowledgement mechanism.

When it comes to updating the cluster state, the update request (e.g. open/close index, put mapping etc.) is processed on the master, then the updated cluster state is pushed to all the other nodes. The json response contains a boolean acknowledged flag that tells whether the cluster state change has already been applied by all nodes. The master node waits (maximum 10 seconds, configurable per request) for an ack message from each node. Those ack notifications are api specific, although similar given their same purpose.

The goal of this issue is to add support for a generic ack mechanism that can be reused (and added where missing) in all apis that update the cluster state. Ideally, the new mechanism should work at a lower level and consists of a listener that is called whenever we get a response directly to the publish request, instead of having an additional endpoint per api and waiting for custom notifications asynchronously.

This relates to the work done in #3736, as the master publish request gets now a response from each node when the new cluster state has already been processed (not only when it was received and the update was locally submitted, but not necessarily processed yet).

Note that the ack mechanism needs to be completely detached from the 5 seconds wait introduced with #3736, whose goal was to try and wait for replies before processing another cluster state update on the master. Those same replies would become our generic ack messages, which determine the value of the acknowledged flag in the response: true if all nodes acked the cluster state update, false if the configurable timeout expired.

@ghost ghost assigned javanna Sep 26, 2013
javanna added a commit to javanna/elasticsearch that referenced this issue Oct 15, 2013
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).

Closes elastic#3786
javanna added a commit to javanna/elasticsearch that referenced this issue Oct 15, 2013
Added support for acknowledgements in put warmer api using the generic mechanism introduced in elastic#3786

Closes elastic#3831
javanna added a commit that referenced this issue Oct 15, 2013
Added support for acknowledgements in put warmer api using the generic mechanism introduced in #3786

Closes #3831
javanna added a commit that referenced this issue Oct 15, 2013
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).

Closes #3786
javanna added a commit that referenced this issue Oct 15, 2013
Added support for acknowledgements in put warmer api using the generic mechanism introduced in #3786

Closes #3831
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
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).

Closes elastic#3786
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Added support for acknowledgements in put warmer api using the generic mechanism introduced in elastic#3786

Closes elastic#3831
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant