Skip to content

Conversation

@tlrx
Copy link
Member

@tlrx tlrx commented Jun 26, 2023

ClusterUpdateSettingsTask uses a changed variable to set the value of the acknowledged flag of the ClusterUpdateSettingsResponse that is returned to the client.

The changed variable is computed from the cluster state update but there is no guarantee that the update will be acknowledged. In case the update failed to be acked (onAckFailure) it should return the flag appropriately.

@tlrx tlrx added >bug :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v8.10.0 v8.9.1 labels Jun 26, 2023
@Override
public void onAckFailure(Exception e) {
if (changed) {
reroute(true);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks wrong to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

@elasticsearchmachine
Copy link
Collaborator

Hi @tlrx, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jun 26, 2023
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok but it would be nice to validate this change with a test too.

Moreover this is very much an old-style unbatched cluster state update which passes the execution result via mutable state held by the task. Batchifying it would make it easier to test I think.

@Override
public void onAckFailure(Exception e) {
if (changed) {
reroute(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

@DaveCTurner
Copy link
Contributor

Moreover this is very much an old-style unbatched cluster state update which passes the execution result via mutable state held by the task. Batchifying it would make it easier to test I think.

It's a trap! 😁 Although I would like to see this action batchified, it's actually kinda complex. Let's not let that work stand in the way of this bug fix.

@tlrx
Copy link
Member Author

tlrx commented Jun 27, 2023

@DaveCTurner thanks for your comments. I added a test for the specific bug fix. I'm not super happy with it but I haven't been able to come with something less hacky. Let me know what you think.

@tlrx tlrx requested a review from DaveCTurner June 27, 2023 13:59
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems like a good test to me.

@tlrx tlrx merged commit e4df571 into elastic:main Jun 27, 2023
@tlrx tlrx deleted the do-not-ack-update-settings-if-task-not-acked branch June 27, 2023 14:24
@tlrx
Copy link
Member Author

tlrx commented Jun 27, 2023

Thanks David

tlrx added a commit to tlrx/elasticsearch that referenced this pull request Jun 27, 2023
ClusterUpdateSettingsTask uses a "changed" variable to set the value of the acknowledged flag of the ClusterUpdateSettingsResponse that is returned to the client. The "changed" variable is computed from the cluster state update but there is no guarantee that the update will be acknowledged. In case the update failed to be acked (onAckFailure) it should return the flag appropriately.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.9
elasticsearchmachine pushed a commit that referenced this pull request Jun 27, 2023
ClusterUpdateSettingsTask uses a "changed" variable to set the value of the acknowledged flag of the ClusterUpdateSettingsResponse that is returned to the client. The "changed" variable is computed from the cluster state update but there is no guarantee that the update will be acknowledged. In case the update failed to be acked (onAckFailure) it should return the flag appropriately.
@rjernst rjernst added v8.9.0 and removed v8.9.1 labels Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.9.0 v8.10.0

4 participants