fix(logsdb): batch bulk indexing to prevent OOM in challenge tests#139770
Merged
salvatore-campagna merged 3 commits intoelastic:mainfrom Dec 19, 2025
Merged
Conversation
Large randomly-generated documents can cause OOM when building a single bulk request string for all documents. This change batches documents (20 per batch) to reduce peak memory usage. Also disables ML in the test cluster since these tests don't require it.
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
martijnvg
approved these changes
Dec 19, 2025
| .setting("xpack.security.autoconfiguration.enabled", "false") | ||
| .setting("xpack.license.self_generated.type", "trial") | ||
| .setting("cluster.logsdb.enabled", "true") | ||
| .setting("xpack.ml.enabled", "false") |
Member
There was a problem hiding this comment.
I don't think this will really affect test coverage. This isn't like disabling security.
Contributor
Author
There was a problem hiding this comment.
Right...I guess it is still useful anyway as it is not really needed and allows to reproduce the test locally. When I tried to run the test locally it was failing with:
[2025-12-18T07:11:59,849][ERROR][o.e.b.Elasticsearch ] [test-cluster-0] fatal exception while booting Elasticsearch org.elasticsearch.ElasticsearchException: Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Dec 19, 2025
* upstream/main: (25 commits) Add spec for project routing CRUD REST API endpoints (elastic#139634) Implement AllSupportedFIeldsTestCase for TDigest (elastic#139744) Mute elastic#139802 (elastic#139803) fix(logsdb): batch bulk indexing to prevent OOM in challenge tests (elastic#139770) Documentation for semantic_text auto pre-filtering (elastic#139749) Always do bulk scoring for rescoring when possible (elastic#139777) Optimize script sorts that do not require query scores (elastic#139748) Bump versions after 9.1.9 release Update branches.json for 9.1.9 release Bump versions after 9.2.3 release Prune changelogs after 8.19.9 release Bump versions after 8.19.9 release Update branches.json for 8.19.9 release Finalize docs for v9.2.3 release (elastic#139795) ESQL: Added timezone support to date_format and date_parse (elastic#138517) Update branches.json for 9.2.3 release Finalize docs for v9.1.9 release (elastic#139796) Switch inline stats to GA in docs (elastic#139753) Validate license in CPS (elastic#139105) FIPS 140-3 support with BC FIPS 2.0.x (elastic#139319) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes flaky OOM test failure in
BulkDynamicMappingChallengeRestIT.testEsqlTermsAggregation.The test was failing intermittently with
java.lang.OutOfMemoryError: Java heap spacewhen building bulk request strings for large randomly-generated documents.When indexing documents, the test built a single bulk request string containing all documents. With complex mappings and several documents, the bulk request string could grow quite large.
Changes include:
Batch bulk indexing (
BulkChallengeRestIT.java):indexDocumentsInBatches()methodStringBuilderwithsetLength(0)instead of creating new instancesDisable ML (
AbstractChallengeRestTest.java):.setting("xpack.ml.enabled", "false")since these tests don't require MLCloses #138717