mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Merge pull request #22947 from azat/inactive_parts_to_throw_insert-fix
Fix inactive_parts_to_throw_insert=0 with inactive_parts_to_delay_insert>0
This commit is contained in:
commit
e9b39c40f8
@ -2538,7 +2538,7 @@ void MergeTreeData::delayInsertOrThrowIfNeeded(Poco::Event * until) const
|
||||
if (settings->inactive_parts_to_throw_insert > 0 || settings->inactive_parts_to_delay_insert > 0)
|
||||
{
|
||||
size_t inactive_parts_count_in_partition = getMaxInactivePartsCountForPartition();
|
||||
if (inactive_parts_count_in_partition >= settings->inactive_parts_to_throw_insert)
|
||||
if (settings->inactive_parts_to_throw_insert > 0 && inactive_parts_count_in_partition >= settings->inactive_parts_to_throw_insert)
|
||||
{
|
||||
ProfileEvents::increment(ProfileEvents::RejectedInserts);
|
||||
throw Exception(
|
||||
|
@ -1,12 +0,0 @@
|
||||
drop table if exists x;
|
||||
|
||||
create table x (i int) engine MergeTree order by i settings old_parts_lifetime = 10000000000, min_bytes_for_wide_part = 0, inactive_parts_to_throw_insert = 1;
|
||||
|
||||
insert into x values (1);
|
||||
insert into x values (2);
|
||||
|
||||
optimize table x final;
|
||||
|
||||
insert into x values (3); -- { serverError 252; }
|
||||
|
||||
drop table if exists x;
|
@ -0,0 +1,12 @@
|
||||
drop table if exists data_01709;
|
||||
|
||||
create table data_01709 (i int) engine MergeTree order by i settings old_parts_lifetime = 10000000000, min_bytes_for_wide_part = 0, inactive_parts_to_throw_insert = 1;
|
||||
|
||||
insert into data_01709 values (1);
|
||||
insert into data_01709 values (2);
|
||||
|
||||
optimize table data_01709 final;
|
||||
|
||||
insert into data_01709 values (3); -- { serverError 252; }
|
||||
|
||||
drop table data_01709;
|
@ -0,0 +1,12 @@
|
||||
drop table if exists data_01809;
|
||||
|
||||
create table data_01809 (i int) engine MergeTree order by i settings old_parts_lifetime = 10000000000, min_bytes_for_wide_part = 0, inactive_parts_to_throw_insert = 0, inactive_parts_to_delay_insert = 1;
|
||||
|
||||
insert into data_01809 values (1);
|
||||
insert into data_01809 values (2);
|
||||
|
||||
optimize table data_01809 final;
|
||||
|
||||
insert into data_01809 values (3);
|
||||
|
||||
drop table data_01809;
|
Loading…
Reference in New Issue
Block a user