Skip to content

Allow bulk shard failures without shard id#2023

Open
smf-h wants to merge 1 commit into
opensearch-project:mainfrom
smf-h:ix-bulk-shard-search-failure-optional-shard
Open

Allow bulk shard failures without shard id#2023
smf-h wants to merge 1 commit into
opensearch-project:mainfrom
smf-h:ix-bulk-shard-search-failure-optional-shard

Conversation

@smf-h

@smf-h smf-h commented Jun 29, 2026

Copy link
Copy Markdown

Fixes #551.

This keeps the change scoped to _common.ShardSearchFailure, which is the failure type used by the bulk response path through BulkResponse._shards.failures. It does not change _common.ShardFailure.

ShardSearchFailure.shard() is now a nullable Integer so bulk shard failures that omit shard deserialize successfully as null, while responses that include shard still preserve the value. This is a source compatibility note for callers that previously treated shard() as a primitive int.

The generated Java mirror is backed by a Java-codegen override marking _common.ShardSearchFailure.shard optional. A follow-up in the API spec may be preferable if the upstream schema should represent this optionality directly.

Validation caveat: cheap local gates passed (git diff --check and marker scan), but local :java-client:test could not execute because this environment fails to load Gradle's JUnit 4 test framework; an existing PercentCodecTest fails with the same local loader error. This should be confirmed with a clean CI/Linux focused test run.

Signed-off-by: smf-h <692979649@qq.com>
@smf-h smf-h force-pushed the ix-bulk-shard-search-failure-optional-shard branch from f2a9ef6 to ef1f0f3 Compare June 29, 2026 07:19

@reta reta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @smf-h . please submit a change to specification [1], this class is generated from it and is not intended to be modified manually.

[1] https://github.com/opensearch-project/opensearch-api-specification/blob/857d43a9209ceed69dd613c72acfd7d1a48cbfa3/spec/schemas/_common.yaml#L322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] org.opensearch.client.util.MissingRequiredPropertyException: Missing required property 'ShardFailure.shard'

2 participants