-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle empty index case in LuceneSyntheticSourceChangesSnapshot (#118996
) In case of synthetic recovery source when the mapping is empty. A test that reproduces failure in #118955 consistently with a potential fix. `MapperService#updateMapping(...)` doesn't set the mapper field if a mapping has no fields, which is what is used in InternalEngine#newChangesSnapshot(...) . This happens when `newMappingMetadata` variable in `MapperService updateMapping(...)` is `null`. Causing an assertion to trip. This change adjusts that assertion to handle an empty index. Closes #118955
- Loading branch information
Showing
5 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ec/src/yamlRestTest/resources/rest-api-spec/test/indices.recovery/20_synthetic_source.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
test recovery empty index with use_synthetic_source: | ||
- requires: | ||
cluster_features: ["mapper.synthetic_recovery_source"] | ||
reason: requires synthetic recovery source | ||
|
||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
settings: | ||
index: | ||
number_of_replicas: 0 | ||
recovery: | ||
use_synthetic_source: true | ||
mapping: | ||
source: | ||
mode: synthetic | ||
|
||
- do: | ||
indices.get_settings: {} | ||
- match: { test.settings.index.mapping.source.mode: synthetic} | ||
- is_true: test.settings.index.recovery.use_synthetic_source | ||
|
||
- do: | ||
indices.put_settings: | ||
index: test | ||
body: | ||
index.number_of_replicas: 1 | ||
|
||
- do: | ||
cluster.health: | ||
wait_for_events: languid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters