Commit d159e5d
authored
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 #48122
1 parent 7c2b737 commit d159e5d
File tree
2 files changed
+17
-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
+17
-19
lines changedLines changed: 1 addition & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | 852 | | |
856 | 853 | | |
857 | 854 | | |
| |||
864 | 861 | | |
865 | 862 | | |
866 | 863 | | |
867 | | - | |
868 | 864 | | |
869 | 865 | | |
870 | 866 | | |
871 | 867 | | |
872 | | - | |
| 868 | + | |
873 | 869 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | 870 | | |
879 | 871 | | |
880 | 872 | | |
| |||
Lines changed: 16 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
413 | 422 | | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
418 | 430 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
| |||
0 commit comments