Skip to content

FTR - fix esArchiver duplicate doc ingestion#229457

Merged
dmlemeshko merged 7 commits intoelastic:mainfrom
pheyos:fix_es_archiver_duplicate_doc
Aug 6, 2025
Merged

FTR - fix esArchiver duplicate doc ingestion#229457
dmlemeshko merged 7 commits intoelastic:mainfrom
pheyos:fix_es_archiver_duplicate_doc

Conversation

@pheyos
Copy link
Copy Markdown
Member

@pheyos pheyos commented Jul 25, 2025

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 and here, also bug report here.
  • With explicitly setting the id, the flakiness didn't show up anymore, which matches the expected behavior as of the bulk docs 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

@pheyos pheyos self-assigned this Jul 25, 2025
@dmlemeshko dmlemeshko self-requested a review July 25, 2025 18:07
@pheyos pheyos added backport:version Backport to applied version labels v9.2.0 v9.0.5 v9.1.1 v8.18.5 v8.19.1 release_note:skip Skip the PR/issue when compiling release notes labels Jul 26, 2025
@pheyos pheyos marked this pull request as ready for review July 26, 2025 11:07
@pheyos pheyos requested review from a team as code owners July 26, 2025 11:07
@dmlemeshko
Copy link
Copy Markdown
Contributor

Will be merged on Monday to avoid blocking serverless release

Copy link
Copy Markdown
Contributor

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

LGTM, let's merge next week to avoid potential issues in MKI testing

@dmlemeshko dmlemeshko changed the title FTR - fix esArchiver duplicate doc ingestion [DO NOT MERGE] FTR - fix esArchiver duplicate doc ingestion Aug 1, 2025
rylnd added a commit to rylnd/kibana that referenced this pull request Aug 1, 2025
I've been unable to reproduce these failures locally, and they fit the
pattern caused by our usage of es_archiver, and fixed in
elastic#229457.

Closes elastic#224780, closes elastic#221659.
@dmlemeshko dmlemeshko changed the title [DO NOT MERGE] FTR - fix esArchiver duplicate doc ingestion FTR - fix esArchiver duplicate doc ingestion Aug 6, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #96 / alerting api integration security and spaces enabled - Group 2 Alerts alert deletion alert deletion - task state space_1_all at space1 should remove active alerts from task state when deleted

Metrics [docs]

✅ unchanged

History

cc @pheyos

@dmlemeshko dmlemeshko merged commit 42377e4 into elastic:main Aug 6, 2025
13 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16781369877

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 6, 2025
## 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 pushed a commit to kibanamachine/kibana that referenced this pull request Aug 6, 2025
## 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 pushed a commit to kibanamachine/kibana that referenced this pull request Aug 6, 2025
## 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 pushed a commit to kibanamachine/kibana that referenced this pull request Aug 6, 2025
## 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
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.19
9.0
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 6, 2025
# Backport

This will backport the following commits from `main` to `9.1`:
- [FTR - fix esArchiver duplicate doc ingestion
(#229457)](#229457)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Robert
Oskamp","email":"robert.oskamp@elastic.co"},"sourceCommit":{"committedDate":"2025-08-06T15:28:34Z","message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"FTR
- fix esArchiver duplicate doc
ingestion","number":229457,"url":"https://github.com/elastic/kibana/pull/229457","mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229457","number":229457,"mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
kibanamachine added a commit that referenced this pull request Aug 6, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [FTR - fix esArchiver duplicate doc ingestion
(#229457)](#229457)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Robert
Oskamp","email":"robert.oskamp@elastic.co"},"sourceCommit":{"committedDate":"2025-08-06T15:28:34Z","message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"FTR
- fix esArchiver duplicate doc
ingestion","number":229457,"url":"https://github.com/elastic/kibana/pull/229457","mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229457","number":229457,"mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
kibanamachine added a commit that referenced this pull request Aug 6, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [FTR - fix esArchiver duplicate doc ingestion
(#229457)](#229457)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Robert
Oskamp","email":"robert.oskamp@elastic.co"},"sourceCommit":{"committedDate":"2025-08-06T15:28:34Z","message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"FTR
- fix esArchiver duplicate doc
ingestion","number":229457,"url":"https://github.com/elastic/kibana/pull/229457","mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229457","number":229457,"mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
kibanamachine added a commit that referenced this pull request Aug 6, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [FTR - fix esArchiver duplicate doc ingestion
(#229457)](#229457)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Robert
Oskamp","email":"robert.oskamp@elastic.co"},"sourceCommit":{"committedDate":"2025-08-06T15:28:34Z","message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"FTR
- fix esArchiver duplicate doc
ingestion","number":229457,"url":"https://github.com/elastic/kibana/pull/229457","mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229457","number":229457,"mergeCommit":{"message":"FTR
- fix esArchiver duplicate doc ingestion (#229457)\n\n## Summary\n\nThis
PR fixes duplicate document creation in esArchiver by generating
an\n`_id` for index (non-data-stream, non-time-series) documents that
don't\nhave an id already.\n\n### Details\n\n- Under some circumstances,
the `es-helper-bulk` that is used by\nesArchiver can ingest a duplicate
document (just with different id), see\ninvestigations
[here](#228556)
and\n[here](#223043), also bug
report\n[here](https://github.com/elastic/elasticsearch-js/issues/2924).\n-
With explicitly setting the id, the flakiness didn't show up
anymore,\nwhich matches the expected behavior as of the
[bulk\ndocs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk)\n`A
create action fails if a document with the same ID already exists
in\nthe target An index action adds or replaces a document as
necessary.`\n- In order to unblock testing, this PR is actually working
around the\nunderlying problem, which should still be investigated
separately\n\n---------\n\nCo-authored-by: Dzmitry Lemechko
<dzmitry.lemechko@elastic.co>","sha":"42377e498dc7a563367cf1e259ea068e117c9ad0"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Oskamp <robert.oskamp@elastic.co>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
gergoabraham pushed a commit to gergoabraham/kibana that referenced this pull request Aug 7, 2025
## 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>
@mistic mistic added v8.19.2 and removed v8.19.1 labels Aug 7, 2025
denar50 pushed a commit to denar50/kibana that referenced this pull request Aug 8, 2025
## 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>
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes v8.18.5 v8.19.2 v9.0.5 v9.1.1 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants