-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix - Requesting _inference_fields when using legacy format causes shard failure #121720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix - Requesting _inference_fields when using legacy format causes shard failure #121720
Conversation
|
Hi @Samiul-TheSoccerFan, I've created a changelog YAML for you. |
|
Pinging @elastic/search-eng (Team:SearchOrg) |
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
...inference/src/yamlRestTest/resources/rest-api-spec/test/inference/40_semantic_text_query.yml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start @Samiul-TheSoccerFan !
@Mikep86 has already given all of the feedback I would have, once you address those comments I think this will be in a good place.
|
Sorry, I misread the change, it is related to the inference fields. The inference fields must be detected as a non-metadata field since the legacy format is used, meaning that we should never reach the |
|
Ok I think I understand now. We should do something like: The _inference_fields is a metadata field only on indices where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better 🙌 ! I left one comment that we should address as I think not_exists will return true if any component of the queried path does not exist, meaning that the test could pass if no hits are returned.
...e/src/yamlRestTest/resources/rest-api-spec/test/inference/30_semantic_text_inference_bwc.yml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks for making all of the iterations!
|
@Samiul-TheSoccerFan Looks like these changes broke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix the broken test before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good approach to fix the failing test. I added some comments about how we can clean it up.
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the iterations!
|
@jimczi Can you please take a look at this PR again and let us know if you have any concerns or suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ard failure (elastic#121720) * Adding condition to verify if the field belongs to an index * Update docs/changelog/121720.yaml * Remove unnecessary comma from yaml file * remove duplicate inference endpoint creation * updating isMetadata to return true if mapper has the correct type * remove unnecessary index creation in yaml tests * Adding check if the document has returned in the yaml test * Updating test to skip time series check if index mode is standard * Refactor tests to consider verifying every metafields with all index modes * refactoring test to verify for all cases * Adding assetFalse if not time_series and fields are from time_series * updating test texts to have better description
…ard failure (#121720) (#122177) * Adding condition to verify if the field belongs to an index * Update docs/changelog/121720.yaml * Remove unnecessary comma from yaml file * remove duplicate inference endpoint creation * updating isMetadata to return true if mapper has the correct type * remove unnecessary index creation in yaml tests * Adding check if the document has returned in the yaml test * Updating test to skip time series check if index mode is standard * Refactor tests to consider verifying every metafields with all index modes * refactoring test to verify for all cases * Adding assetFalse if not time_series and fields are from time_series * updating test texts to have better description
…ard failure (#121720) (#122178) * Adding condition to verify if the field belongs to an index * Update docs/changelog/121720.yaml * Remove unnecessary comma from yaml file * remove duplicate inference endpoint creation * updating isMetadata to return true if mapper has the correct type * remove unnecessary index creation in yaml tests * Adding check if the document has returned in the yaml test * Updating test to skip time series check if index mode is standard * Refactor tests to consider verifying every metafields with all index modes * refactoring test to verify for all cases * Adding assetFalse if not time_series and fields are from time_series * updating test texts to have better description
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
This PR fixes the shard failure error we get when we request the
_inference_fieldswith legacy semantic_text.Steps to reproduce:
And then when we
searchwith_inference_fields: