Skip to content

parallel_view_processing behavior has changed. #10241

@den-crane

Description

@den-crane

parallel_view_processing=1

drop table if exists testX;
drop table if exists testXA;
drop table if exists testXB;
drop table if exists testXC;
create table testX ( A Int64) engine=MergeTree order by tuple();

create materialized view testXA engine=MergeTree order by tuple() 
as select sleep(1) from testX;

create materialized view testXB engine=MergeTree order by tuple() 
as select sleep(2),throwIf(A=1) from testX;

create materialized view testXC engine=MergeTree order by tuple() 
as select sleep(1) from testX;

insert into testX select number from numbers(10);
select count() from testX;
select count() from testXA;
select count() from testXB;
select count() from testXC; 

18.14.18
10
10
0
10

19.13.7.57
10
0
0
0

18.14.18

26.891574 [ 23 ]  <Debug> executeQuery: (from [::1]:33136) insert into testX select number from numbers(10)
26.891788 [ 23 ]  <Trace> InterpreterSelectQuery: FetchColumns -> Complete
26.891846 [ 23 ]  <Debug> executeQuery: Query pipeline:
26.892203 [ 208 ]  <Trace> dw.testX (Data): Renaming temporary part tmp_insert_all_1_1_0 to all_1_1_0.
26.892487 [ 209 ]  <Trace> InterpreterSelectQuery: FetchColumns -> Complete
26.892528 [ 211 ]  <Trace> InterpreterSelectQuery: FetchColumns -> Complete
26.892531 [ 210 ]  <Trace> InterpreterSelectQuery: FetchColumns -> Complete
27.892829 [ 209 ]  <Trace> dw..inner.testXC (Data): Renaming temporary part tmp_insert_all_1_1_0 to all_1_1_0.
27.892862 [ 211 ]  <Trace> dw..inner.testXA (Data): Renaming temporary part tmp_insert_all_1_1_0 to all_1_1_0.
28.892788 [ 210 ]  <Trace> ThreadStatus: Thread 210 exited
28.892788 [ 209 ]  <Trace> ThreadStatus: Thread 209 exited
28.892829 [ 211 ]  <Trace> ThreadStatus: Thread 211 exited
28.892956 [ 208 ]  <Trace> ThreadStatus: Thread 208 exited
28.893027 [ 23 ]  <Error> executeQuery: Code: 395, e.displayText() = DB::Exception: Value passed to 'throwIf' 
28.893086 [ 23 ]  <Debug> MemoryTracker: Peak memory usage (for query): 4.02 MiB.

Threads 209, 211 did insert before Exception

19.13.7.57

15.756235 [ 8174 ] <Debug> executeQuery: (from [::1]:53622) INSERT INTO testX SELECT number FROM numbers(10)
15.756628 [ 8174 ] <Trace> InterpreterSelectQuery: FetchColumns -> Complete
15.756696 [ 8174 ] <Debug> executeQuery: Query pipeline:
15.757001 [ 30 ] <Trace> dw.testX: Renaming temporary part tmp_insert_all_1_1_0 to all_1_1_0.
15.757196 [ 120 ] <Trace> InterpreterSelectQuery: FetchColumns -> Complete
15.757196 [ 50 ] <Trace> InterpreterSelectQuery: FetchColumns -> Complete
15.757314 [ 81 ] <Trace> InterpreterSelectQuery: FetchColumns -> Complete
17.757825 [ 8174 ] <Error> executeQuery: Code: 395, e.displayText() = DB::Exception: Value passed to 'throwIf' 
17.757901 [ 8174 ] <Debug> MemoryTracker: Peak memory usage (for query): 2.30 KiB.
17.757961 [ 8174 ] <Debug> MemoryTracker: Peak memory usage (total): 2.30 KiB.
17.757976 [ 8174 ] <Information> TCPHandler: Processed in 2.002 sec.

Threads 120, 81 never inserted

We suspect it impacts performance because INSERTS start after all SELECTS (for 1 block ?) finished.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions