mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
fix flushing of in-memory parts
This commit is contained in:
parent
454207a9a2
commit
a83832c03e
@ -141,6 +141,10 @@ void StorageMergeTree::startup()
|
||||
|
||||
void StorageMergeTree::flush()
|
||||
{
|
||||
if (flush_called)
|
||||
return;
|
||||
|
||||
flush_called = true;
|
||||
flushAllInMemoryPartsIfNeeded();
|
||||
}
|
||||
|
||||
|
@ -140,6 +140,7 @@ private:
|
||||
std::map<std::pair<Int64, Int64>, UInt64> updated_version_by_block_range;
|
||||
|
||||
std::atomic<bool> shutdown_called {false};
|
||||
std::atomic<bool> flush_called {false};
|
||||
|
||||
private:
|
||||
void loadMutations();
|
||||
|
@ -4120,9 +4120,22 @@ void StorageReplicatedMergeTree::startup()
|
||||
}
|
||||
}
|
||||
|
||||
void StorageReplicatedMergeTree::flush()
|
||||
{
|
||||
if (flush_called)
|
||||
return;
|
||||
|
||||
flush_called = true;
|
||||
flushAllInMemoryPartsIfNeeded();
|
||||
}
|
||||
|
||||
void StorageReplicatedMergeTree::shutdown()
|
||||
{
|
||||
if (shutdown_called)
|
||||
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();
|
||||
|
@ -86,6 +86,7 @@ class StorageReplicatedMergeTree final : public shared_ptr_helper<StorageReplica
|
||||
public:
|
||||
void startup() override;
|
||||
void shutdown() override;
|
||||
void flush() override;
|
||||
~StorageReplicatedMergeTree() override;
|
||||
|
||||
std::string getName() const override { return "Replicated" + merging_params.getModeName() + "MergeTree"; }
|
||||
@ -350,6 +351,9 @@ private:
|
||||
/// Event that is signalled (and is reset) by the restarting_thread when the ZooKeeper session expires.
|
||||
Poco::Event partial_shutdown_event {false}; /// Poco::Event::EVENT_MANUALRESET
|
||||
|
||||
std::atomic<bool> shutdown_called {false};
|
||||
std::atomic<bool> flush_called {false};
|
||||
|
||||
int metadata_version = 0;
|
||||
/// Threads.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user