Skip to content

Commit

Permalink
Revert "Refine cancel for read thread stream (#8511)" (#8541) (#8544)
Browse files Browse the repository at this point in the history
close #8539
  • Loading branch information
ti-chi-bot authored Dec 18, 2023
1 parent 3d5c741 commit 632eb5b
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 @@ -56,25 +56,17 @@ class UnorderedInputStream : public IProfilingBlockInputStream
LOG_DEBUG(log, "Created, pool_id={} ref_no={}", task_pool->poolId(), 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->poolId(), ref_no);
}

String getName() const override { return NAME; }

Block getHeader() const override { return header; }

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->poolId(), ref_no);
}
}

Block readImpl() override
{
FilterPtr filter_ignored;
Expand Down Expand Up @@ -137,7 +129,5 @@ class UnorderedInputStream : public IProfilingBlockInputStream
LoggerPtr log;
int64_t ref_no;
bool task_pool_added;

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

0 comments on commit 632eb5b

Please sign in to comment.