-
Notifications
You must be signed in to change notification settings - Fork 3.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
[fix](pipeline) Make all upstream tasks runnable if all tasks finishe… #41292
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1e70c93
[fix](pipeline) Make all upstream tasks runnable if all tasks finishe…
Gabriel39 4d25810
update
Gabriel39 a14051a
update
Gabriel39 cad94b5
update
Gabriel39 f28c263
update
Gabriel39 79d9f1c
udpate
Gabriel39 377b8ed
udpate
Gabriel39 47fb5cc
update
Gabriel39 d216478
update
Gabriel39 3804ee2
update
Gabriel39 e35dc83
update
Gabriel39 71361c6
update
Gabriel39 9d24406
udpate
Gabriel39 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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)); | ||
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. | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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; | ||
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 |
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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 来传递。