Skip to content

Investigate esArchiver flakiness#228556

Closed
pheyos wants to merge 65 commits intoelastic:mainfrom
pheyos:invetigate_es_archiver_flake
Closed

Investigate esArchiver flakiness#228556
pheyos wants to merge 65 commits intoelastic:mainfrom
pheyos:invetigate_es_archiver_flake

Conversation

@pheyos
Copy link
Copy Markdown
Member

@pheyos pheyos commented Jul 18, 2025

DO NOT MERGE

This PR investigates a flaky esArchiver behavior when loading and unloading the same archive.

Related to the investigation done in #223043 (actually taking over that reproduction test case for further investigation)

@pheyos pheyos self-assigned this Jul 18, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@pheyos
Copy link
Copy Markdown
Member Author

pheyos commented Jul 18, 2025

No failure in the first 10k test runs. Increased the test count to 400 and temporarily removed the index exists check (to not modify the timing in case that's related).

@kibanamachine

This comment was marked as outdated.

@pheyos
Copy link
Copy Markdown
Member Author

pheyos commented Jul 18, 2025

No failure in another 10k test runs. Maybe it's related to the test server config.

@pheyos
Copy link
Copy Markdown
Member Author

pheyos commented Jul 18, 2025

Noticed that the Security solution config used for the experiment in #223043 is running with basic license and ssl enabled - trying to reproduce with that setup.

@kibanamachine

This comment was marked as outdated.

@pheyos
Copy link
Copy Markdown
Member Author

pheyos commented Jul 18, 2025

Running with basic license and ssl enabled reproduced the problem. Now running these options individually to see if we can isolate the problem to one of them.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@pheyos
Copy link
Copy Markdown
Member Author

pheyos commented Jul 18, 2025

Summary of the recent experiment with license and ssl settings:

license \ ssl ssl: true ssl: false
license: basic ✔️
license: trial ✔️

So it looks like changing the ES ssl flag to true for the server configuration causes this esArchiver flakiness to happen.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@pheyos
Copy link
Copy Markdown
Member Author

pheyos commented Jul 25, 2025

With setting a fixed doc id in my es bulk helper experiment, the flakiness didn't show up in 20k tests anymore.

Then applied this to esArchiver: generating a uuid if the doc doesn't come with an id from the archive already. And this also didn't reproduce the flakiness in 30k tests anymore.

This behavior is matching what the bulk docs say:

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.

@github-actions

This comment was marked as off-topic.

@kibanamachine

This comment was marked as outdated.

@github-actions

This comment was marked as off-topic.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@kibanamachine

This comment was marked as outdated.

@pheyos
Copy link
Copy Markdown
Member Author

pheyos commented Jul 25, 2025

Update: with maxRetries: 0 on the transport level, the flakiness didn't reproduce.

@github-actions

This comment was marked as off-topic.

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8869

[✅] x-pack/platform/test/api_integration/apis/es_archiver/config.ts: 25/25 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8870

[✅] x-pack/platform/test/api_integration/apis/es_archiver/config.ts: 25/25 tests passed.

see run history

dmlemeshko added a commit 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](#228556) and
[here](#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>
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 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>
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>
@pheyos pheyos closed this Aug 20, 2025
@pheyos pheyos deleted the invetigate_es_archiver_flake branch August 20, 2025 13:08
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.