Skip to content

Conversation

medcl
Copy link
Member

@medcl medcl commented Oct 20, 2025

What does this PR do

This pull request introduces improved error handling and stricter validation for bulk request submissions in the Elasticsearch bulk indexing logic. The main focus is to ensure that bulk requests are only submitted when the offsets are valid and to provide clearer logging and error reporting when unexpected conditions occur.

Key changes include:

Bulk Request Submission Validation:

  • Added checks to ensure that bulk requests are only submitted if both offset and committedOffset are non-nil and not equal, preventing unnecessary or duplicate submissions. If this condition is not met, an error is logged indicating that the request should not have been submitted. [1] [2] [3] [4]

Error Handling and Logging Enhancements:

  • Improved error handling in the bulk request submission process. Now, if a bulk request is not supposed to continue but no error is present, a panic is triggered to catch unknown error states. Additionally, clear error logs are produced in unexpected scenarios for easier debugging. [1] [2]

Response Handling in Core Bulk Processor:

  • Refactored the response handling in core/elastic/bulk_processor.go to return a more descriptive error if the server response is empty, and removed redundant code that previously handled this case. [1] [2]

Rationale for this change

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@medcl medcl mentioned this pull request Oct 20, 2025
6 tasks
@medcl medcl merged commit 4ab73b5 into main Oct 21, 2025
4 checks passed
@medcl medcl deleted the fix_bulk_indexing branch October 21, 2025 02:12
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.

3 participants