Skip to content

Fix invalid document version events still included in bulk requests #6601#6645

Merged
oeyh merged 1 commit into
opensearch-project:mainfrom
Keyur-S-Patel:fix/6601-invalid-version-still-in-bulk-request
Mar 18, 2026
Merged

Fix invalid document version events still included in bulk requests #6601#6645
oeyh merged 1 commit into
opensearch-project:mainfrom
Keyur-S-Patel:fix/6601-invalid-version-still-in-bulk-request

Conversation

@Keyur-S-Patel

Copy link
Copy Markdown
Contributor

Description

When using external versioning with document_version and document_version_type in the OpenSearch sink, events with invalid version fields were correctly sent to the DLQ but then still included in the bulk request. This change adds continue statements after the NumberFormatException and RuntimeException catch blocks in doOutput() so that events with invalid versions are skipped from the bulk request after being routed to the DLQ. This matches the existing pattern used for invalid index names.

Issues Resolved

Resolves #6601

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
  • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/data-prepper/blob/main/CONTRIBUTING.md).

@graytaylor0 graytaylor0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for making this change!

…pensearch-project#6601)

Events with invalid document_version values are correctly sent to the DLQ
but were still being added to the OpenSearch bulk request. Added continue
statements after the NumberFormatException and RuntimeException catch blocks
in doOutput() to skip the rest of the loop iteration for failed events.

Added unit tests to verify events with invalid versions are not added to
the bulk request.

Signed-off-by: Keyur-S-Patel <keyurpatel.opensource@gmail.com>
@Keyur-S-Patel Keyur-S-Patel force-pushed the fix/6601-invalid-version-still-in-bulk-request branch from 506ee95 to 63d290a Compare March 17, 2026 17:40
@oeyh oeyh merged commit d4bbcd9 into opensearch-project:main Mar 18, 2026
106 of 113 checks passed
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] Invalid document version from events is still included in opensearch bulk requests

3 participants