Skip to content

Conversation

@l-trotta
Copy link
Contributor

Originally reported in elastic/elasticsearch-java#408.
ShardFailure has 3 variants in the server code:

  1. ShardSearchFailure, the one we currently map, commonly used by most Search responses
  2. SearchFailure, which is a bit different (shard is nullable and there's status), and it's used by Scrollable responses
  3. Failure, which uses underscores in most fields and adds primary, and is used by every response that extends ReplicationResponse (mainly Update, Delete and Index, but also some Bulk)

To support all 3 without creating specific classes and introduce breaking changes we have decided to have ShardFailure support all variants by using aliases and making additional fields nullable (with reason being the only non optional field that every variant supports)

@github-actions
Copy link
Contributor

Following you can find the validation changes against the target branch for the APIs.

No changes detected.

You can validate these APIs yourself by using the make validate target.

@l-trotta
Copy link
Contributor Author

@Anaethelion, @flobernd, @miguelgrinberg checking if this breaks any generator before merging

@miguelgrinberg
Copy link
Contributor

@l-trotta the Python DSL generator ignores the aliases, so this change causes no problems for me.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The change itself LGTM. We still need to wait confirmation for .NET and Go.

@Anaethelion
Copy link
Contributor

@l-trotta This will only translates into alternatives field names within deserialization in Go, so you're good. 👍

@flobernd
Copy link
Member

Since I suggested the use of aliases, LGTM from my side as well 😅

I'm handling it the same way as Go.

@l-trotta l-trotta merged commit 168e405 into main Aug 27, 2025
18 checks passed
@l-trotta l-trotta deleted the shard-failure-aliases branch August 27, 2025 08:52
github-actions bot pushed a commit that referenced this pull request Aug 27, 2025
(cherry picked from commit 168e405)
github-actions bot pushed a commit that referenced this pull request Aug 27, 2025
(cherry picked from commit 168e405)
github-actions bot pushed a commit that referenced this pull request Aug 27, 2025
(cherry picked from commit 168e405)
github-actions bot pushed a commit that referenced this pull request Aug 27, 2025
(cherry picked from commit 168e405)
github-actions bot pushed a commit that referenced this pull request Aug 27, 2025
(cherry picked from commit 168e405)
l-trotta added a commit that referenced this pull request Aug 28, 2025
(cherry picked from commit 168e405)

Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
l-trotta added a commit that referenced this pull request Aug 28, 2025
(cherry picked from commit 168e405)

Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
l-trotta added a commit that referenced this pull request Aug 28, 2025
(cherry picked from commit 168e405)

Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
l-trotta added a commit that referenced this pull request Aug 28, 2025
(cherry picked from commit 168e405)

Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
l-trotta added a commit that referenced this pull request Aug 28, 2025
(cherry picked from commit 168e405)

Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants