Replace batch-and-wait DuckDB loading with producer-consumer pattern#18
Open
kevinschaper wants to merge 4 commits into
Open
Replace batch-and-wait DuckDB loading with producer-consumer pattern#18kevinschaper wants to merge 4 commits into
kevinschaper wants to merge 4 commits into
Conversation
Eliminates two performance bottlenecks in bulkload_duckdb(): - Straggler effect from processing chunks in fixed batches of workers - O(n^2) LIMIT/OFFSET pagination that re-scans preceding rows Now uses a single query with fetchmany() (producer) feeding a thread pool (consumer), with inline future draining to bound memory usage. Fixes #17 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Transient connection errors (e.g. Early EOF) during bulk indexing could silently drop entire batches. Add transport-level retry via urllib3 Retry on the HTTP adapter, plus application-level retry loops in both upload_rows_to_solr() and bulkload_file() with exponential backoff. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Large batch uploads to Solr can stall long enough to hit the default 120s Jetty idle timeout, causing IOException during JSON parsing. Bump to 300s to match the client-side request timeout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reserve roughly half of CPU cores for Solr's indexing/merge threads instead of using cpu_count * 1.5. Caps at 8 workers instead of 12. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cmungall
approved these changes
Mar 7, 2026
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.
Summary
LIMIT X OFFSET Yqueries with a single query usingfetchmany(), avoiding repeated table scans for large tablesFixes #17