Some queries can hung after cancelling (because enough rows had been
read for Distributed queries) or after KILL. Example of such query is a
Distributed query that uses DelayedSource that uses ExpandPipeline to
add new processors, and in this case it is possible that all already
existing processes was cancelled but new had been added and now
PipelineExecutor will wait for them undefinitelly since nobody will read
from them and nobody will cancel them either.
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
By some reason it appears only after static_cast<> was added [1]:
/build/src/Processors/Formats/Impl/AvroRowInputFormat.cpp
Oct 18 01:03:56 /build/src/Processors/Formats/Impl/AvroRowInputFormat.cpp:351:21: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
Oct 18 01:03:56 symbols.push_back(root_node->nameAt(i));
Oct 18 01:03:56 ^
Oct 18 01:03:56 /build/src/Processors/Formats/Impl/AvroRowInputFormat.cpp:511:17: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
Oct 18 01:03:56 union_skip_fns.push_back(createSkipFn(root_node->leafAt(i)));
Oct 18 01:03:56 ^
Oct 18 01:03:56 /build/src/Processors/Formats/Impl/AvroRowInputFormat.cpp:552:17: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
Oct 18 01:03:56 field_skip_fns.push_back(createSkipFn(root_node->leafAt(i)));
Oct 18 01:03:56 ^
Oct 18 01:03:56 197965 warnings generated.
[1]: https://s3.amazonaws.com/clickhouse-builds/42190/453d91fa3539882dcef1d5ecd5097747499572d8/clickhouse_special_build_check/report.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
- lots of static_cast
- add safe_cast
- types adjustments
- config
- IStorage::read/watch
- ...
- some TODO's (to convert types in future)
P.S. That was quite a journey...
v2: fixes after rebase
v3: fix conflicts after #42308 merged
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>