Commit a0f80bd
authored
Cleanup Concurrent RepositoryData Loading (#48329)
The loading of `RepositoryData` is not an atomic operation.
It uses a list + get combination of calls.
This lead to accidentally returning an empty repository data
for generations >=0 which can never not exist unless the repository
is corrupted.
In the test #48122 (and other SLM tests) there was a low chance of
running into this concurrent modification scenario and the repository
actually moving two index generations between listing out the
index-N and loading the latest version of it. Since we only keep
two index-N around at a time this lead to unexpectedly absent
snapshots in status APIs.
Fixing the behavior to be more resilient is non-trivial but in the works.
For now I think we should simply throw in this scenario. This will also
help prevent corruption in the unlikely event but possible of running into this
issue in a snapshot create or delete operation on master failover on a
repository like S3 which doesn't have the "no overwrites" protection on
writing a new index-N.
Fixes #481221 parent 3c2e27a commit a0f80bd
File tree
2 files changed
+18
-19
lines changed- server/src/main/java/org/elasticsearch/repositories/blobstore
- x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm
2 files changed
+18
-19
lines changedLines changed: 1 addition & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | 905 | | |
909 | 906 | | |
910 | 907 | | |
| |||
917 | 914 | | |
918 | 915 | | |
919 | 916 | | |
920 | | - | |
921 | 917 | | |
922 | 918 | | |
923 | 919 | | |
924 | 920 | | |
925 | | - | |
| 921 | + | |
926 | 922 | | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | 923 | | |
932 | 924 | | |
933 | 925 | | |
| |||
Lines changed: 17 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
355 | 356 | | |
356 | 357 | | |
357 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
358 | 368 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
363 | 376 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| |||
0 commit comments