Skip to content

[9.0] FTR - fix esArchiver duplicate doc ingestion (#229457)#230832

Merged
kibanamachine merged 1 commit intoelastic:9.0from
kibanamachine:backport/9.0/pr-229457
Aug 6, 2025
Merged

[9.0] FTR - fix esArchiver duplicate doc ingestion (#229457)#230832
kibanamachine merged 1 commit intoelastic:9.0from
kibanamachine:backport/9.0/pr-229457

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

## Summary

This PR fixes duplicate document creation in esArchiver by generating an
`_id` for index (non-data-stream, non-time-series) documents that don't
have an id already.

### Details

- Under some circumstances, the `es-helper-bulk` that is used by
esArchiver can ingest a duplicate document (just with different id), see
investigations [here](elastic#228556) and
[here](elastic#223043), also bug report
[here](elastic/elasticsearch-js#2924).
- With explicitly setting the id, the flakiness didn't show up anymore,
which matches the expected behavior as of the [bulk
docs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)
`A create action fails if a document with the same ID already exists in
the target An index action adds or replaces a document as necessary.`
- In order to unblock testing, this PR is actually working around the
underlying problem, which should still be investigated separately

---------

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
(cherry picked from commit 42377e4)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Aug 6, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) August 6, 2025 15:36
@kibanamachine kibanamachine merged commit 8d4856c into elastic:9.0 Aug 6, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants