Commit af7d32c
committed
Fork to WRITE thread when failing shard (#84606)
If a replication operation fails then the primary will try and fail the
replica. If this operation also fails (i.e. another shard copy has been
promoted to primary) then the primary must fail itself. Today it does
this on a transport thread. This is a problem because failing the shard
needs to acquire a lock which may be held by another operation that is
performing some potentially-long-running IO.
With this commit we add an assertion that the engine is never failed on
a transport thread, and adjust `ReplicationOperation` to fork the call
to `failShard` to the `WRITE` threadpool. Without the change to
`ReplicationOperation` the assertion is tripped by `testAckedIndexing`.
Closes #846021 parent 018de1a commit af7d32c
File tree
3 files changed
+52
-15
lines changed- docs/changelog
- server/src/main/java/org/elasticsearch
- action/support/replication
- index/engine
3 files changed
+52
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 44 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | 320 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | 321 | | |
328 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
329 | 334 | | |
330 | | - | |
331 | | - | |
332 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
333 | 347 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
338 | 368 | | |
339 | | - | |
340 | 369 | | |
341 | 370 | | |
342 | 371 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
1099 | 1100 | | |
1100 | 1101 | | |
1101 | 1102 | | |
| 1103 | + | |
1102 | 1104 | | |
1103 | 1105 | | |
1104 | 1106 | | |
| |||
0 commit comments