-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support non-blocking MailboxReceivedOperator #9615
Comments
I think we should consider our thread utilization end-to-end. Specifically, in our multistage engine if we consider all the operators between a While investigating #9563 I discovered that in order to really get non-blocking behavior we need the entire stage to be non-blocking (e.g. the entire stage should be deferred while there's no work to do, so that the thread pool running it can be freed up to schedule another task) Ideally, I'd suggest something like: This gives us a few improvements over the existing architecture.
We could certainly do this in stages - commenting on your specific considerations:
I think this is exactly right - I'd suggest we even consolidate it across queries (and then use a simple in-memory scheduler to forward the right data to the right tasks) but that's probably a bigger change.
also +1, but the subtle difference with what I suggest here is that it doesn't signal to the mailbox receive operator specifically, but rather the executor that schedules the receiver operator in first place. basically, there would be no mailbox receive operator thread allocated unless there's work to be done. Happy to start prototyping some of this stuff up :) |
May be this is also a good time / opportunity to rethink from the operator level. Here are some thoughts...
Operators have a state machine something along the lines .....
Operator abstraction with sub-interfaces
Pipe:
During execution planning when physical operators are created is when we setup the Pipeline.
+1
|
I like the idea to make operator a state machine. It is more extensible. If an operator needs to be retried, timed out or checkpoint in the future, we can easily extend that. Since we are thinking about the architecture point of view, we should consider isolation/priority in the thread pool. Otherwise, it will easily exhaust the server resources. This sounds like a fit for actor model? :) |
Had some a quick discussion with @walterddr and wanted to jot down those thoughts here so I don't forget:
Some thoughts on @siddharthteotia's comments specifically:
I'm a bit confused about the terminology here. Perhaps we can standardize on "operator" as a single unit of work, "operator chain" as the smallest schedule-able set of operators and "stage" as a complete remote-receive-to-remote-send set of pipelines. Today "operator chain" is always equivalent to a stage. I think that was how you were using that terminology. With these definitions, I think we want executors to be independent of the number of stages/chains that are currently running on a multistage intermediate server. That might make QoS (quality of service) and thread pool management a little difficult - IMO one fixed thread pool and a priority-aware scheduler can get us pretty far so long as each pipeline can be scheduled independently and we have (see below) a mechanism to split chains.
I really like this idea, this will also help us in the case where we want to split stages into additional local stages - and we can leverage the work @ankitsultana was working on in #9484 to increase parallelism without needing to introduce a parallel processing framework within a single stage/task. |
Adding notes from offline discussion with @walterddr @61yao @siddharthteotia. Feel free to add additional details if I missed anything. Design notes:
Discussion around out-of-scope considerations:
Next steps, @agavra to come up with a PEP document with more implementation and design details after some prototyping. |
Putting a link to a design doc here: https://docs.google.com/document/d/1XAMHAlhFbINvX-kK1ANlzbRz4_RkS0map4qhqs1yDtE I'll schedule a design review, if anyone following this ticket would like to be a part of it just ping me on the OSS Slack with your email and I can add you. |
Currently MailboxReceivedOperator
propose to create a non-blocking mailbox receive operator
several thoughts:
also the same mechanism should also work for the local passthrough mailbox design see #9484
The text was updated successfully, but these errors were encountered: