Modified backpressure method for MergeTree [#METR-23488].

This commit is contained in:
Alexey Milovidov 2016-11-14 21:19:08 +03:00
parent 56e7e380ca
commit e7fccc4044
2 changed files with 1 additions and 17 deletions

View File

@ -5,11 +5,6 @@
#include <iomanip>
namespace ProfileEvents
{
extern const Event SynchronousMergeOnInsert;
}
namespace DB
{
@ -21,17 +16,7 @@ public:
void writePrefix() override
{
/// If too much parts, do extra merges synchronously, in current thread.
/// 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, {}, {}, {});
}
storage.data.delayInsertIfNeeded();
}
void write(const Block & block) override

View File

@ -46,7 +46,6 @@
M(DelayedInserts) \
M(RejectedInserts) \
M(DelayedInsertsMilliseconds) \
M(SynchronousMergeOnInsert) \
\
M(ZooKeeperInit) \
M(ZooKeeperTransactions) \