Commit 3c20541
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 a22f6fb commit 3c20541
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 | |
|---|---|---|---|
| |||
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | 910 | | |
914 | 911 | | |
915 | 912 | | |
| |||
922 | 919 | | |
923 | 920 | | |
924 | 921 | | |
925 | | - | |
926 | 922 | | |
927 | 923 | | |
928 | 924 | | |
929 | 925 | | |
930 | | - | |
| 926 | + | |
931 | 927 | | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | 928 | | |
937 | 929 | | |
938 | 930 | | |
| |||
Lines changed: 16 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
393 | 402 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
398 | 410 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | 411 | | |
406 | 412 | | |
407 | 413 | | |
| |||
0 commit comments