Skip to content

Conversation

andrershov
Copy link
Contributor

When preparing the state to send to other nodes, we're serializing it for each node, despite using putIfAbsent.
This commit checks if the state was already serialized for this node version before performing the potentially expensive computation.
The map is not used by multiple threads, so computeIfAbsent is not needed (and could not be used here easily, because IOException could be thrown).

@andrershov andrershov added >bug v7.0.0 :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v8.0.0 v7.2.0 labels Feb 20, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

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

@andrershov
Copy link
Contributor Author

run elasticsearch-ci/default-distro

@andrershov andrershov merged commit c99be63 into elastic:master Mar 6, 2019
andrershov pushed a commit that referenced this pull request Mar 6, 2019
When preparing the state to send to other nodes, we're serializing it
for each node, despite using putIfAbsent.
This commit checks if the state was already serialized for this node
version before performing the potentially expensive computation.
The map is not used by multiple threads, so computeIfAbsent is not
needed (and could not be used here easily, because IOException could
be thrown).

(cherry picked from commit c99be63)
andrershov pushed a commit that referenced this pull request Mar 6, 2019
When preparing the state to send to other nodes, we're serializing it
for each node, despite using putIfAbsent.
This commit checks if the state was already serialized for this node
version before performing the potentially expensive computation.
The map is not used by multiple threads, so computeIfAbsent is not
needed (and could not be used here easily, because IOException could
be thrown).

(cherry picked from commit c99be63)
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. v7.0.0-rc1 v7.2.0 v8.0.0-alpha1
5 participants