Commit 4356a3e
authored
Ignore abort-on-cleanup failure in S3 repo (#138569)
If a `CompleteMultipartUpload` request fails then we attempt to clean up
by calling the `AbortMultipartUpload` API. This cleanup may also fail,
and a failure here will supersede the original failure. The cleanup is
really a best-effort thing so we should ignore failures. In particular
if the `CompleteMultipartUpload` has an `If-None-Match` precondition
then this may fail with a `409 Conflict` and in that case the upload no
longer exists, so we would expect the `AbortMultipartUpload` call to
fail with a 404.
This commit extends `S3HttpHandler` to respond with both 412 and 409s on
precondition failures, cleaning up the upload on a 409 but not a 412,
triggering the unwanted failure path in some tests, and adds exception
handling to deal with it.1 parent ef8a008 commit 4356a3e
File tree
4 files changed
+54
-33
lines changed- docs/changelog
- modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3
- test/fixtures/s3-fixture/src
- main/java/fixture/s3
- test/java/fixture/s3
4 files changed
+54
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
612 | 629 | | |
613 | 630 | | |
614 | 631 | | |
| |||
Lines changed: 27 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
193 | | - | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | | - | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 214 | + | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
| 233 | + | |
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
| 237 | + | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | | - | |
270 | | - | |
271 | | - | |
| 269 | + | |
272 | 270 | | |
273 | | - | |
274 | 271 | | |
| 272 | + | |
275 | 273 | | |
276 | 274 | | |
277 | 275 | | |
| |||
407 | 405 | | |
408 | 406 | | |
409 | 407 | | |
410 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
411 | 413 | | |
412 | | - | |
| 414 | + | |
413 | 415 | | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
418 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
| |||
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
412 | 411 | | |
413 | 412 | | |
414 | 413 | | |
415 | | - | |
| 414 | + | |
416 | 415 | | |
417 | 416 | | |
418 | 417 | | |
| |||
422 | 421 | | |
423 | 422 | | |
424 | 423 | | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
| 424 | + | |
431 | 425 | | |
432 | 426 | | |
433 | 427 | | |
| |||
436 | 430 | | |
437 | 431 | | |
438 | 432 | | |
| 433 | + | |
439 | 434 | | |
440 | 435 | | |
441 | 436 | | |
| |||
0 commit comments