mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-23 10:10:50 +00:00
Modified backpressure method for MergeTree [#METR-23488].
This commit is contained in:
parent
56e7e380ca
commit
e7fccc4044
@ -5,11 +5,6 @@
|
|||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
|
||||||
namespace ProfileEvents
|
|
||||||
{
|
|
||||||
extern const Event SynchronousMergeOnInsert;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -21,17 +16,7 @@ public:
|
|||||||
|
|
||||||
void writePrefix() override
|
void writePrefix() override
|
||||||
{
|
{
|
||||||
/// If too much parts, do extra merges synchronously, in current thread.
|
storage.data.delayInsertIfNeeded();
|
||||||
/// Why 10? - just in case, it is better than possibly infinite loop.
|
|
||||||
for (size_t i = 0; i < 10; ++i)
|
|
||||||
{
|
|
||||||
size_t parts_count = storage.data.getMaxPartsCountForMonth();
|
|
||||||
if (parts_count <= storage.data.settings.parts_to_delay_insert)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ProfileEvents::increment(ProfileEvents::SynchronousMergeOnInsert);
|
|
||||||
storage.merge(0, {}, {}, {});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(const Block & block) override
|
void write(const Block & block) override
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
M(DelayedInserts) \
|
M(DelayedInserts) \
|
||||||
M(RejectedInserts) \
|
M(RejectedInserts) \
|
||||||
M(DelayedInsertsMilliseconds) \
|
M(DelayedInsertsMilliseconds) \
|
||||||
M(SynchronousMergeOnInsert) \
|
|
||||||
\
|
\
|
||||||
M(ZooKeeperInit) \
|
M(ZooKeeperInit) \
|
||||||
M(ZooKeeperTransactions) \
|
M(ZooKeeperTransactions) \
|
||||||
|
Loading…
Reference in New Issue
Block a user