Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[fix](pipeline) Make all upstream tasks runnable if all tasks finishe…#41292
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
1e70c934d25810a14051acad94b5f28c26379d9f1c377b8ed47fb5ccd2164783804ee2e35dc8371361c69d24406File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -111,15 +111,18 @@ Status HashJoinBuildSinkLocalState::open(RuntimeState* state) { | ||
| } | ||
| Status HashJoinBuildSinkLocalState::close(RuntimeState* state, Status exec_status) { | ||
| if (_closed) { | ||
| return Status::OK(); | ||
| } | ||
| auto p = _parent->cast<HashJoinBuildSinkOperatorX>(); | ||
| Defer defer {[&]() { | ||
| if (_should_build_hash_table && p._shared_hashtable_controller) { | ||
| p._shared_hashtable_controller->signal_finish(p.node_id()); | ||
| } | ||
| }}; | ||
| if (!_runtime_filter_slots || _runtime_filters.empty() || state->is_cancelled()) { | ||
| return Status::OK(); | ||
| if (!_runtime_filter_slots || _runtime_filters.empty() || state->is_cancelled() || !_eos) { | ||
| return Base::close(state, exec_status); | ||
| } | ||
| auto* block = _shared_state->build_block.get(); | ||
| uint64_t hash_table_size = block ? block->rows() : 0; | ||
| @@ -137,7 +140,7 @@ Status HashJoinBuildSinkLocalState::close(RuntimeState* state, Status exec_statu | ||
| SCOPED_TIMER(_publish_runtime_filter_timer); | ||
| RETURN_IF_ERROR(_runtime_filter_slots->publish(!_should_build_hash_table)); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我有一个问题,为啥我们要再close 里去publish rf,而不是在sink 里,判断eos 然后publish? | ||
| return Status::OK(); | ||
| return Base::close(state, exec_status); | ||
| } | ||
| bool HashJoinBuildSinkLocalState::build_unique() const { | ||
| @@ -504,6 +507,7 @@ Status HashJoinBuildSinkOperatorX::sink(RuntimeState* state, vectorized::Block* | ||
| SCOPED_TIMER(local_state.exec_time_counter()); | ||
| COUNTER_UPDATE(local_state.rows_input_counter(), (int64_t)in_block->rows()); | ||
| local_state._eos = eos; | ||
| if (local_state._should_build_hash_table) { | ||
| // If eos or have already met a null value using short-circuit strategy, we do not need to pull | ||
| // data from probe side. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -135,7 +135,8 @@ class PipelineTask { | ||
| int task_id() const { return _index; }; | ||
| bool is_finalized() const { return _finalized; } | ||
| void clear_blocking_state() { | ||
| void clear_blocking_state(bool wake_up_by_downstream = false) { | ||
| _wake_up_by_downstream = _wake_up_by_downstream || wake_up_by_downstream; | ||
| _state->get_query_ctx()->get_execution_dependency()->set_always_ready(); | ||
| // We use a lock to assure all dependencies are not deconstructed here. | ||
| std::unique_lock<std::mutex> lc(_dependency_lock); | ||
| @@ -231,6 +232,8 @@ class PipelineTask { | ||
| } | ||
| } | ||
| PipelineId pipeline_id() const { return _pipeline->id(); } | ||
| private: | ||
| friend class RuntimeFilterDependency; | ||
| bool _is_blocked(); | ||
| @@ -306,11 +309,12 @@ class PipelineTask { | ||
| Dependency* _execution_dep = nullptr; | ||
| std::atomic<bool> _finalized {false}; | ||
| std::atomic<bool> _finalized = false; | ||
| std::mutex _dependency_lock; | ||
| std::atomic<bool> _running {false}; | ||
| std::atomic<bool> _eos {false}; | ||
| std::atomic<bool> _running = false; | ||
| std::atomic<bool> _eos = false; | ||
| std::atomic<bool> _wake_up_by_downstream = false; | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add comment to this field | ||
| }; | ||
| } // namespace doris::pipeline | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这么写可能有问题。
比如join build 和 join probe,假如说有一个优化,join probe 先读一个block,如果读取出来的为空,直接放弃join build,此时join build的close 怎么处理?
我感觉我们得依靠close的status 来处理一些事情,或者pipeline task 里保存一下down stream eos,然后把这个down stream eos 传递给pipeline task的close 函数,可能是通过exec status 来传递。