feat: add multi-process data loader for GIL-bound insert paths#777
Open
wyfanxiao wants to merge 1 commit into
Open
feat: add multi-process data loader for GIL-bound insert paths#777wyfanxiao wants to merge 1 commit into
wyfanxiao wants to merge 1 commit into
Conversation
- Add MultiprocessInsertRunner for parallel data loading across worker processes - Add --load-processes CLI option for explicit multi-process control - Auto-switch to multi-process loader when client declares thread_safe=False - OceanBase: declare thread_safe=False with pickle support for multi-process loading - Improve concurrent_runner log message for thread_safe=False fallback - Fix: verify inserted == produced after shutdown to prevent partial load - Fix: check timeout inside _put_with_interruptible_wait to prevent indefinite blocking - Fix: use PerformanceTimeoutError without message arg to match its __init__ signature
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wyfanxiao The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
Hi, thanks for the detailed review on #769! I've split the PR as suggested and addressed all three bugs you identified (partial load detection, timeout enforcement in queue wait, and PerformanceTimeoutError signature).
Summary
MultiprocessInsertRunnerfor parallel data loading across worker processes--load-processesCLI option for explicit multi-process controlthread_safe=Falseand--load-concurrency > 1thread_safe=Falsewith pickle supportconcurrent_runnerlog message forthread_safe=FalsefallbackOn benchmark fairness
Great point on fairness — I've been thinking about this too. One thing I noticed is that SQL-based clients (OceanBase, PgVector, VectorChord, Doris, SeekDB) currently fall back to
max_workers=1due tothread_safe=False, while thread-safe clients like Milvus and Elasticsearch can take advantage of multi-threaded loading. So it seems like there's already some difference in load parallelism across databases today.The multi-process loader is an attempt to help bridge that gap. It's designed to be opt-in — only activated via explicit
--load-processesor whenthread_safe=Falsecombined with--load-concurrency > 1. Default behavior stays the same for all existing clients.Of course, I totally understand if you'd prefer a more conservative approach — for example, making it strictly explicit with no auto-switch at all. Would love to hear what you think works best for the project!