Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#9456
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
windtalker authored and ti-chi-bot committed Sep 23, 2024
1 parent a64d76b commit 617ecf9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions dbms/src/Flash/Planner/Plans/PhysicalJoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ void PhysicalJoin::probeSideTransform(DAGPipeline & probe_pipeline, Context & co
settings.max_block_size);
stream->setExtraInfo(join_probe_extra_info);
}
join_ptr->setCancellationHook([&] { return context.isCancelled(); });
}

void PhysicalJoin::buildSideTransform(DAGPipeline & build_pipeline, Context & context, size_t max_streams)
Expand Down
8 changes: 8 additions & 0 deletions dbms/src/Flash/Planner/Plans/PhysicalJoinProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ void PhysicalJoinProbe::buildPipelineExecGroupImpl(
max_block_size,
input_header));
});
<<<<<<< HEAD
=======
// The `join_ptr->wait_build_finished_future` does not need to be added to exec_context here;
// it is only necessary to add it during the "restore build stage."
// The order of build/probe here is ensured by the event.
exec_context.addOneTimeFuture(join_ptr->wait_probe_finished_future);
join_ptr->setCancellationHook([&]() { return exec_context.isCancelled(); });
>>>>>>> 78bd3f04dc (fix tiflash assert failure (#9456))
join_ptr.reset();
}
} // namespace DB
7 changes: 7 additions & 0 deletions dbms/src/Interpreters/Join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,10 @@ Block Join::doJoinBlockHash(ProbeProcessInfo & probe_process_info, const JoinBui

Block Join::removeUselessColumn(Block & block) const
{
// cancelled
if (!block)
return block;

Block projected_block;
for (const auto & name_and_type : output_columns_after_finalize)
{
Expand Down Expand Up @@ -2216,6 +2220,9 @@ Block Join::joinBlock(ProbeProcessInfo & probe_process_info, bool dry_run) const
else
block = joinBlockHash(probe_process_info);

// if cancelled, just return empty block
if (!block)
return block;
/// for (cartesian)antiLeftSemi join, the meaning of "match-helper" is `non-matched` instead of `matched`.
if (kind == Cross_LeftOuterAnti)
{
Expand Down

0 comments on commit 617ecf9

Please sign in to comment.