Skip to content

Commit

Permalink
Revert "Refine cancel for read thread stream (#8511)" (#8541)
Browse files Browse the repository at this point in the history
close #8539
  • Loading branch information
gengliqi authored Dec 18, 2023
1 parent 1a67f37 commit 72db405
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions dbms/src/Storages/DeltaMerge/ReadThread/UnorderedInputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ class UnorderedInputStream : public IProfilingBlockInputStream
LOG_DEBUG(log, "Created, pool_id={} ref_no={}", task_pool->pool_id, ref_no);
}

void cancel(bool /*kill*/) override { decreaseRefCount(true); }

~UnorderedInputStream() override { decreaseRefCount(false); }
~UnorderedInputStream() override
{
task_pool->decreaseUnorderedInputStreamRefCount();
LOG_DEBUG(log, "Destroy, pool_id={} ref_no={}", task_pool->pool_id, ref_no);
}

String getName() const override { return NAME; }

Expand All @@ -65,16 +67,6 @@ class UnorderedInputStream : public IProfilingBlockInputStream
}

protected:
void decreaseRefCount(bool is_cancel)
{
bool ori = false;
if (is_stopped.compare_exchange_strong(ori, true))
{
task_pool->decreaseUnorderedInputStreamRefCount();
LOG_DEBUG(log, "{}, pool_id={} ref_no={}", is_cancel ? "Cancel" : "Destroy", task_pool->pool_id, ref_no);
}
}

Block readImpl() override
{
FilterPtr filter_ignored;
Expand Down Expand Up @@ -154,7 +146,5 @@ class UnorderedInputStream : public IProfilingBlockInputStream
// runtime filter
std::vector<RuntimeFilterPtr> runtime_filter_list;
int max_wait_time_ms;

std::atomic_bool is_stopped = false;
};
} // namespace DB::DM

0 comments on commit 72db405

Please sign in to comment.