Commit e057f1a
committed
Do not check for object existence when deleting repository index files (#31680)
Before deleting a repository index generation file, BlobStoreRepository
checks for the existence of the file and then deletes it. We can save
a request here by using BlobContainer.deleteBlobIgnoringIfNotExists()
which ignores error when deleting a file that does not exist.
Since there is no way with S3 to know if a non versioned file existed
before being deleted, this pull request also changes S3BlobContainer so
that it now implements deleteBlobIgnoringIfNotExists(). It will now save
one more request (blobExist?) when appropriate. The tests and fixture
have been modified to conform the S3 API that always returns a 204/NO
CONTENT HTTP response on deletions.1 parent 1edc57f commit e057f1a
File tree
5 files changed
+12
-34
lines changed- plugins/repository-s3
- qa/amazon-s3/src/test/java/org/elasticsearch/repositories/s3
- src
- main/java/org/elasticsearch/repositories/s3
- test/java/org/elasticsearch/repositories/s3
- server/src/main/java/org/elasticsearch
- index/snapshots/blobstore
- repositories/blobstore
5 files changed
+12
-34
lines changedLines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 177 | + | |
| 178 | + | |
181 | 179 | | |
182 | 180 | | |
183 | 181 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
| 113 | + | |
| 114 | + | |
111 | 115 | | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 152 | + | |
159 | 153 | | |
160 | | - | |
| 154 | + | |
161 | 155 | | |
162 | 156 | | |
163 | 157 | | |
| |||
Lines changed: 0 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | 392 | | |
406 | 393 | | |
407 | 394 | | |
| |||
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
672 | | - | |
673 | | - | |
| 671 | + | |
674 | 672 | | |
675 | 673 | | |
676 | 674 | | |
| |||
679 | 677 | | |
680 | 678 | | |
681 | 679 | | |
682 | | - | |
683 | | - | |
684 | | - | |
| 680 | + | |
685 | 681 | | |
686 | 682 | | |
687 | 683 | | |
| |||
702 | 698 | | |
703 | 699 | | |
704 | 700 | | |
705 | | - | |
706 | | - | |
707 | | - | |
| 701 | + | |
708 | 702 | | |
709 | 703 | | |
710 | 704 | | |
| |||
0 commit comments