Commit c99be63
authored
Avoid serialising state if it was already serialised (#39179)
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).1 parent 98bbb41 commit c99be63
File tree
1 file changed
+6
-2
lines changed- server/src/main/java/org/elasticsearch/cluster/coordination
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| |||
0 commit comments