Commit 4a537ef
authored
Bulk operation fail to replicate operations when a mapping update times out (#30244)
Starting with the refactoring in #22778 (released in 5.3) we may fail to properly replicate operation when a mapping update on master fails. If a bulk
operations needs a mapping update half way, it will send a request to the master before continuing
to index the operations. If that request times out or isn't acked (i.e., even one node in the cluster
didn't process it within 30s), we end up throwing the exception and aborting the entire bulk. This is
a problem because all operations that were processed so far are not replicated any more to the
replicas. Although these operations were never "acked" to the user (we threw an error) it cause the
local checkpoint on the replicas to lag (on 6.x) and the primary and replica to diverge.
This PR does a couple of things:
1) Most importantly, treat *any* mapping update failure as a document level failure, meaning only
the relevant indexing operation will fail.
2) Removes the mapping update callbacks from `IndexShard.applyIndexOperationOnPrimary` and
similar methods for simpler execution. We don't use exceptions any more when a mapping
update was successful.
I think we need to do more work here (the fact that a single slow node can prevent those mappings
updates from being acked and thus fail operations is bad), but I want to keep this as small as I can
(it is already too big).1 parent 65e5868 commit 4a537ef
File tree
28 files changed
+662
-469
lines changed- server/src
- main/java/org/elasticsearch
- action
- bulk
- resync
- support/replication
- index
- engine
- shard
- indices
- recovery
- test/java/org/elasticsearch
- action/bulk
- discovery
- index
- engine
- mapper
- replication
- shard
- indices/recovery
- repositories/blobstore
- test/framework/src/main/java/org/elasticsearch
- index/shard
- test
- disruption
- x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher
28 files changed
+662
-469
lines changedLines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 32 | | |
Lines changed: 88 additions & 61 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
46 | | - | |
47 | 43 | | |
48 | | - | |
49 | 44 | | |
50 | 45 | | |
51 | 46 | | |
52 | | - | |
53 | 47 | | |
54 | 48 | | |
55 | 49 | | |
| |||
78 | 72 | | |
79 | 73 | | |
80 | 74 | | |
81 | | - | |
| 75 | + | |
82 | 76 | | |
83 | 77 | | |
84 | 78 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
Lines changed: 56 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
| 299 | + | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
| 304 | + | |
302 | 305 | | |
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
306 | 309 | | |
307 | | - | |
| 310 | + | |
308 | 311 | | |
309 | 312 | | |
| 313 | + | |
| 314 | + | |
310 | 315 | | |
311 | 316 | | |
312 | 317 | | |
313 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
314 | 333 | | |
315 | 334 | | |
316 | | - | |
317 | | - | |
318 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
319 | 338 | | |
320 | 339 | | |
321 | 340 | | |
| |||
332 | 351 | | |
333 | 352 | | |
334 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
335 | 362 | | |
336 | 363 | | |
337 | 364 | | |
| |||
371 | 398 | | |
372 | 399 | | |
373 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
374 | 406 | | |
375 | 407 | | |
376 | 408 | | |
| |||
383 | 415 | | |
384 | 416 | | |
385 | 417 | | |
386 | | - | |
387 | | - | |
388 | | - | |
| 418 | + | |
| 419 | + | |
389 | 420 | | |
390 | 421 | | |
391 | 422 | | |
| |||
395 | 426 | | |
396 | 427 | | |
397 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
398 | 434 | | |
399 | 435 | | |
400 | 436 | | |
| |||
410 | 446 | | |
411 | 447 | | |
412 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
413 | 456 | | |
414 | 457 | | |
415 | 458 | | |
416 | 459 | | |
417 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
418 | 466 | | |
419 | 467 | | |
420 | 468 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
| 768 | + | |
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
777 | | - | |
| 777 | + | |
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| |||
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
787 | | - | |
| 787 | + | |
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
| |||
1087 | 1087 | | |
1088 | 1088 | | |
1089 | 1089 | | |
1090 | | - | |
| 1090 | + | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | 1093 | | |
| |||
0 commit comments