mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 09:52:38 +00:00
proper checking of atomic flags
This commit is contained in:
parent
a83832c03e
commit
4ebf61b809
@ -141,18 +141,16 @@ void StorageMergeTree::startup()
|
|||||||
|
|
||||||
void StorageMergeTree::flush()
|
void StorageMergeTree::flush()
|
||||||
{
|
{
|
||||||
if (flush_called)
|
if (flush_called.exchange(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flush_called = true;
|
|
||||||
flushAllInMemoryPartsIfNeeded();
|
flushAllInMemoryPartsIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StorageMergeTree::shutdown()
|
void StorageMergeTree::shutdown()
|
||||||
{
|
{
|
||||||
if (shutdown_called)
|
if (shutdown_called.exchange(true))
|
||||||
return;
|
return;
|
||||||
shutdown_called = true;
|
|
||||||
|
|
||||||
/// Unlock all waiting mutations
|
/// Unlock all waiting mutations
|
||||||
{
|
{
|
||||||
|
@ -4122,20 +4122,17 @@ void StorageReplicatedMergeTree::startup()
|
|||||||
|
|
||||||
void StorageReplicatedMergeTree::flush()
|
void StorageReplicatedMergeTree::flush()
|
||||||
{
|
{
|
||||||
if (flush_called)
|
if (flush_called.exchange(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flush_called = true;
|
|
||||||
flushAllInMemoryPartsIfNeeded();
|
flushAllInMemoryPartsIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StorageReplicatedMergeTree::shutdown()
|
void StorageReplicatedMergeTree::shutdown()
|
||||||
{
|
{
|
||||||
if (shutdown_called)
|
if (shutdown_called.exchange(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
shutdown_called = true;
|
|
||||||
|
|
||||||
/// Cancel fetches, merges and mutations to force the queue_task to finish ASAP.
|
/// Cancel fetches, merges and mutations to force the queue_task to finish ASAP.
|
||||||
fetcher.blocker.cancelForever();
|
fetcher.blocker.cancelForever();
|
||||||
merger_mutator.merges_blocker.cancelForever();
|
merger_mutator.merges_blocker.cancelForever();
|
||||||
|
Loading…
Reference in New Issue
Block a user