Commit a5f17fc
authored
Add preflight check to dynamic mapping updates (#48817)
Today if the primary discovers that an indexing request needs a mapping update
then it will send it to the master for validation and processing. If, however,
the put-mapping request is invalid then the master still processes it as a
(no-op) cluster state update. When there are a large number of indexing
operations that result in invalid mapping updates this can overwhelm the
master.
However, the primary already has a reasonably up-to-date mapping against which
it can check the (approximate) validity of the put-mapping request before
sending it to the master. For instance it is not possible to remove fields in a
mapping update, so if the primary detects that a mapping update will exceed the
fields limit then it can reject it itself and avoid bothering the master.
This commit adds a pre-flight check to the mapping update path so that the
primary can discard obviously-invalid put-mapping requests itself.
Fixes #355641 parent dd47cf4 commit a5f17fc
File tree
5 files changed
+95
-12
lines changed- server/src
- main/java/org/elasticsearch
- action/bulk
- index/mapper
- test/java/org/elasticsearch
- action/bulk
- index/mapper
5 files changed
+95
-12
lines changedLines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
266 | 279 | | |
267 | 280 | | |
268 | 281 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
306 | 310 | | |
307 | 311 | | |
308 | 312 | | |
| 313 | + | |
309 | 314 | | |
310 | 315 | | |
311 | 316 | | |
| |||
415 | 420 | | |
416 | 421 | | |
417 | 422 | | |
418 | | - | |
| 423 | + | |
419 | 424 | | |
420 | 425 | | |
421 | 426 | | |
| |||
430 | 435 | | |
431 | 436 | | |
432 | 437 | | |
433 | | - | |
| 438 | + | |
434 | 439 | | |
435 | 440 | | |
436 | 441 | | |
| |||
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
456 | 465 | | |
457 | 466 | | |
458 | 467 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
236 | | - | |
| 238 | + | |
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
| 246 | + | |
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
| |||
761 | 764 | | |
762 | 765 | | |
763 | 766 | | |
764 | | - | |
| 767 | + | |
765 | 768 | | |
766 | 769 | | |
767 | 770 | | |
| |||
778 | 781 | | |
779 | 782 | | |
780 | 783 | | |
| 784 | + | |
781 | 785 | | |
782 | 786 | | |
783 | 787 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
119 | 161 | | |
Lines changed: 23 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
| |||
113 | 124 | | |
114 | 125 | | |
115 | 126 | | |
116 | | - | |
| 127 | + | |
117 | 128 | | |
118 | 129 | | |
119 | 130 | | |
| |||
149 | 160 | | |
150 | 161 | | |
151 | 162 | | |
152 | | - | |
| 163 | + | |
153 | 164 | | |
154 | 165 | | |
155 | 166 | | |
| |||
197 | 208 | | |
198 | 209 | | |
199 | 210 | | |
200 | | - | |
| 211 | + | |
201 | 212 | | |
202 | 213 | | |
203 | 214 | | |
| |||
233 | 244 | | |
234 | 245 | | |
235 | 246 | | |
236 | | - | |
| 247 | + | |
237 | 248 | | |
238 | 249 | | |
239 | 250 | | |
| |||
261 | 272 | | |
262 | 273 | | |
263 | 274 | | |
264 | | - | |
| 275 | + | |
265 | 276 | | |
266 | 277 | | |
267 | 278 | | |
| |||
294 | 305 | | |
295 | 306 | | |
296 | 307 | | |
297 | | - | |
| 308 | + | |
298 | 309 | | |
299 | 310 | | |
300 | 311 | | |
| |||
319 | 330 | | |
320 | 331 | | |
321 | 332 | | |
322 | | - | |
| 333 | + | |
323 | 334 | | |
324 | 335 | | |
325 | 336 | | |
| |||
348 | 359 | | |
349 | 360 | | |
350 | 361 | | |
351 | | - | |
| 362 | + | |
352 | 363 | | |
353 | 364 | | |
354 | 365 | | |
| |||
439 | 450 | | |
440 | 451 | | |
441 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
442 | 457 | | |
443 | 458 | | |
444 | 459 | | |
| |||
0 commit comments