Skip to content

Commit

Permalink
Revert "Refine cancel for read thread stream (#8511)" (#8541) (#8542)
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 ac988a9 commit 821997b
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(); }

~UnorderedInputStream() override { decreaseRefCount(); }
~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 ori = false;
if (is_stopped.compare_exchange_strong(ori, true))
{
task_pool->decreaseUnorderedInputStreamRefCount();
LOG_DEBUG(log, "Destroy, pool_id={} ref_no={}", 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 821997b

Please sign in to comment.