mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 02:12:21 +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()
|
||||
{
|
||||
if (flush_called)
|
||||
if (flush_called.exchange(true))
|
||||
return;
|
||||
|
||||
flush_called = true;
|
||||
flushAllInMemoryPartsIfNeeded();
|
||||
}
|
||||
|
||||
void StorageMergeTree::shutdown()
|
||||
{
|
||||
if (shutdown_called)
|
||||
if (shutdown_called.exchange(true))
|
||||
return;
|
||||
shutdown_called = true;
|
||||
|
||||
/// Unlock all waiting mutations
|
||||
{
|
||||
|
@ -4122,20 +4122,17 @@ void StorageReplicatedMergeTree::startup()
|
||||
|
||||
void StorageReplicatedMergeTree::flush()
|
||||
{
|
||||
if (flush_called)
|
||||
if (flush_called.exchange(true))
|
||||
return;
|
||||
|
||||
flush_called = true;
|
||||
flushAllInMemoryPartsIfNeeded();
|
||||
}
|
||||
|
||||
void StorageReplicatedMergeTree::shutdown()
|
||||
{
|
||||
if (shutdown_called)
|
||||
if (shutdown_called.exchange(true))
|
||||
return;
|
||||
|
||||
shutdown_called = true;
|
||||
|
||||
/// Cancel fetches, merges and mutations to force the queue_task to finish ASAP.
|
||||
fetcher.blocker.cancelForever();
|
||||
merger_mutator.merges_blocker.cancelForever();
|
||||
|
Loading…
Reference in New Issue
Block a user