Optionally use parallel consumers for bulk import indexing#1048
Closed
henrik242 wants to merge 3 commits intokomoot:masterfrom
Closed
Optionally use parallel consumers for bulk import indexing#1048henrik242 wants to merge 3 commits intokomoot:masterfrom
henrik242 wants to merge 3 commits intokomoot:masterfrom
Conversation
1f20ac0 to
f976ba2
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Reviewed by Cursor Bugbot for commit f976ba2. Configure here.
This was referenced Apr 10, 2026
ad012d6 to
26a9ac8
Compare
Use a specified number of parallel consumer threads for OpenSearch bulk indexing, optimally one per shard (=5). Each thread has its own Importer instance with an independent BulkRequest buffer, sharing the thread-safe OpenSearchClient. Replaces the sentinel-based single-thread shutdown with a volatile flag + poll timeout for clean multi-thread termination. Benchmark (Belgium 11GB, 4.9M docs): 221s -> 166s (25% faster).
Move the OpenSearch index refresh out of per-consumer Importer.finish() and into a single call in App after all threads complete. Also guard ObjectMapper serializer registration to run only once.
26a9ac8 to
1be62d5
Compare
Contributor
Author
Belgium Import Benchmark ResultsDataset: belgium (4,954,824 documents, 12 GB uncompressed ndjson)
EDIT: Tested with the rescore branch (#1051) on top too |
Collaborator
|
Now there is a new error when running a planet import with I'll defer this PR until after the 1.1. release. It might be that the processing chain needs am overhaul before multi-threaded processing can work. |
Contributor
Author
|
Closing this in favour of #1055 (which should address this problem using backpressure and retries) |
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.

Use a specified number of parallel consumer threads for OpenSearch bulk indexing, optimally one per shard (=5). Each thread has its own Importer instance with an independent BulkRequest buffer, sharing the thread-safe OpenSearchClient.
Replaces the sentinel-based single-thread shutdown with a volatile flag + poll timeout for clean multi-thread termination.
Benchmark (Belgium 11GB, 4.9M docs): 221s -> 166s (25% faster).