How to reproduce: run test 01099_parallel_distributed_insert_select.sql with enabled setting `allow_experimental_parallel_reading_from_replicas`:
```
ch-client --allow_experimental_parallel_reading_from_replicas=1 -nmT < 01099_parallel_distributed_insert_select.sql > /dev/null
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:56.946377 [ 29654 ] {26b68ad3-0afc-46c7-9344-f1c4ec98223a} <Fatal> : Logical error: 'Coordinator for parallel reading from replicas is not initialized'.
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:56.948188 [ 29739 ] <Fatal> BaseDaemon: ########################################
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:56.948595 [ 29739 ] <Fatal> BaseDaemon: (version 22.2.1.1, build id: 3214146F63D9D503) (from thread 29654) (query_id: 26b68ad3-0afc-46c7-9344-f1c4ec98223a) (query: INSERT INTO distributed_01099_b SELECT * from distributed_01099_a;) Received signal Aborted (6)
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:56.949127 [ 29739 ] <Fatal> BaseDaemon: 
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:56.949662 [ 29739 ] <Fatal> BaseDaemon: Stack trace: 0x7f92be05f18b 0x7f92be03e859 0x7f92c07be1f9 0x7f92c07be309 0x7f92a062d164 0x7f92a062bcb9 0x7f92a062cdd8 0x7f9295e8b1f9 0x7f92972b5a44 0x7f9295eac8c2 0x7f9297066ed9 0x7f9297066dd5 0x7f929706dfc1 0x7f929706e297 0x7f929706fa5f 0x7f929706f9dd 0x7f929706f981 0x7f929706f892 0x7f929706f75b 0x7f929706f61d 0x7f929706f5dd 0x7f929706f5b5 0x7f929706f580 0x7f92c08b4f66 0x7f92c08abd55 0x7f92c08ab715 0x7f92c08b2064 0x7f92c08b1fdd 0x7f92c08b1f05 0x7f92c08b1862 0x7f92be3c1609 0x7f92be13b293
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:57.445361 [ 29739 ] <Fatal> BaseDaemon: 4. raise @ 0x8ef218b in /home/avogar/ClickHouse/build/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:57.933354 [ 29739 ] <Fatal> BaseDaemon: 5. abort @ 0x8ed1859 in /home/avogar/ClickHouse/build/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.030223 [ 29739 ] <Fatal> BaseDaemon: 6. ./build/../src/Common/Exception.cpp:52: DB::handle_error_code(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool, std::__1::vector<void*, std::__1::allocator<void*> > const&) @ 0x3391f9 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.113560 [ 29739 ] <Fatal> BaseDaemon: 7. ./build/../src/Common/Exception.cpp:59: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x339309 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.322790 [ 29739 ] <Fatal> BaseDaemon: 8. ./build/../src/QueryPipeline/RemoteQueryExecutor.cpp:474: DB::RemoteQueryExecutor::processMergeTreeReadTaskRequest(DB::PartitionReadRequest) @ 0x16e164 in /home/avogar/ClickHouse/build/src/libclickhouse_querypipelined.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.528226 [ 29739 ] <Fatal> BaseDaemon: 9. ./build/../src/QueryPipeline/RemoteQueryExecutor.cpp:373: DB::RemoteQueryExecutor::processPacket(DB::Packet) @ 0x16ccb9 in /home/avogar/ClickHouse/build/src/libclickhouse_querypipelined.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.739597 [ 29739 ] <Fatal> BaseDaemon: 10. ./build/../src/QueryPipeline/RemoteQueryExecutor.cpp:331: DB::RemoteQueryExecutor::read(std::__1::unique_ptr<DB::RemoteQueryExecutorReadContext, std::__1::default_delete<DB::RemoteQueryExecutorReadContext> >&) @ 0x16ddd8 in /home/avogar/ClickHouse/build/src/libclickhouse_querypipelined.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.815154 [ 29739 ] <Fatal> BaseDaemon: 11. ./build/../src/Processors/Sources/RemoteSource.cpp:74: DB::RemoteSource::tryGenerate() @ 0xd71f9 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_sourcesd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.881761 [ 29739 ] <Fatal> BaseDaemon: 12. ./build/../src/Processors/ISource.cpp:53: DB::ISource::work() @ 0xa0a44 in /home/avogar/ClickHouse/build/src/libclickhouse_processorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.941635 [ 29739 ] <Fatal> BaseDaemon: 13. ./build/../src/Processors/Sources/SourceWithProgress.cpp:67: DB::SourceWithProgress::work() @ 0xf88c2 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_sourcesd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.970316 [ 29739 ] <Fatal> BaseDaemon: 14. ./build/../src/Processors/Executors/ExecutionThreadContext.cpp:45: DB::executeJob(DB::IProcessor*) @ 0xa3ed9 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:58.995165 [ 29739 ] <Fatal> BaseDaemon: 15. ./build/../src/Processors/Executors/ExecutionThreadContext.cpp:63: DB::ExecutionThreadContext::executeTask() @ 0xa3dd5 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.093561 [ 29739 ] <Fatal> BaseDaemon: 16. ./build/../src/Processors/Executors/PipelineExecutor.cpp:213: DB::PipelineExecutor::executeStepImpl(unsigned long, std::__1::atomic<bool>*) @ 0xaafc1 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.190767 [ 29739 ] <Fatal> BaseDaemon: 17. ./build/../src/Processors/Executors/PipelineExecutor.cpp:178: DB::PipelineExecutor::executeSingleThread(unsigned long) @ 0xab297 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.302820 [ 29739 ] <Fatal> BaseDaemon: 18. ./build/../src/Processors/Executors/PipelineExecutor.cpp:306: DB::PipelineExecutor::executeImpl(unsigned long)::$_1::operator()() const @ 0xaca5f in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.417138 [ 29739 ] <Fatal> BaseDaemon: 19. ./build/../contrib/libcxx/include/type_traits:3682: decltype(std::__1::forward<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&>(fp)()) std::__1::__invoke_constexpr<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&) @ 0xac9dd in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.532980 [ 29739 ] <Fatal> BaseDaemon: 20. ./build/../contrib/libcxx/include/tuple:1415: decltype(auto) std::__1::__apply_tuple_impl<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&, std::__1::__tuple_indices<>) @ 0xac981 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.650354 [ 29739 ] <Fatal> BaseDaemon: 21. ./build/../contrib/libcxx/include/tuple:1424: decltype(auto) std::__1::apply<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&) @ 0xac892 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.744769 [ 29739 ] <Fatal> BaseDaemon: 22. ./build/../src/Common/ThreadPool.h:188: ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()::operator()() @ 0xac75b in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.860269 [ 29739 ] <Fatal> BaseDaemon: 23. ./build/../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) @ 0xac61d in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:13:59.976063 [ 29739 ] <Fatal> BaseDaemon: 24. ./build/../contrib/libcxx/include/__functional_base:349: void std::__1::__invoke_void_return_wrapper<void>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&...) @ 0xac5dd in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.092291 [ 29739 ] <Fatal> BaseDaemon: 25. ./build/../contrib/libcxx/include/functional:1608: std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'(), void ()>::operator()() @ 0xac5b5 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.208096 [ 29739 ] <Fatal> BaseDaemon: 26. ./build/../contrib/libcxx/include/functional:2089: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0xac580 in /home/avogar/ClickHouse/build/src/libclickhouse_processors_executorsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.296988 [ 29739 ] <Fatal> BaseDaemon: 27. ./build/../contrib/libcxx/include/functional:2221: std::__1::__function::__policy_func<void ()>::operator()() const @ 0x42ff66 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.373285 [ 29739 ] <Fatal> BaseDaemon: 28. ./build/../contrib/libcxx/include/functional:2560: std::__1::function<void ()>::operator()() const @ 0x426d55 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.441348 [ 29739 ] <Fatal> BaseDaemon: 29. ./build/../src/Common/ThreadPool.cpp:277: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x426715 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.522380 [ 29739 ] <Fatal> BaseDaemon: 30. ./build/../src/Common/ThreadPool.cpp:142: void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()::operator()() const @ 0x42d064 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.611021 [ 29739 ] <Fatal> BaseDaemon: 31. ./build/../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<void>(fp)(std::__1::forward<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(fp0)...)) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()&&...) @ 0x42cfdd in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.698479 [ 29739 ] <Fatal> BaseDaemon: 32. ./build/../contrib/libcxx/include/thread:281: void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>&, std::__1::__tuple_indices<>) @ 0x42cf05 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.785466 [ 29739 ] <Fatal> BaseDaemon: 33. ./build/../contrib/libcxx/include/thread:291: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) @ 0x42c862 in /home/avogar/ClickHouse/build/src/libclickhouse_common_iod.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:00.793666 [ 29739 ] <Fatal> BaseDaemon: 34. ? @ 0x141609 in /home/avogar/ClickHouse/build/contrib/libcxx-cmake/libcxxd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:01.285265 [ 29739 ] <Fatal> BaseDaemon: 35. clone @ 0x8fce293 in /home/avogar/ClickHouse/build/src/AggregateFunctions/libclickhouse_aggregate_functionsd.so
[avogar-dev.vla.yp-c.yandex.net] 2022.02.11 16:14:01.285636 [ 29739 ] <Fatal> BaseDaemon: Calculated checksum of the binary: 3D3723E8BAB43521A090B28438FFD59E. There is no information about the reference checksum.
Error on processing query: Code: 32. DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000. (ATTEMPT_TO_READ_AFTER_EOF) (version 22.2.1.1)
(query: INSERT INTO distributed_01099_b SELECT * from distributed_01099_a;)
```
read_list.push_back(*connection->socket);
    }
    
    if (read_list.empty())
    {
        Poco::Net::Socket::SocketList write_list;
        Poco::Net::Socket::SocketList except_list;
        for (const ReplicaState & state : replica_states)
        {
            Connection * connection = state.connection;
            if (connection != nullptr)
                read_list.push_back(*connection->socket);
        }
        auto timeout = is_draining ? drain_timeout : receive_timeout;
        int n = Poco::Net::Socket::select(
            read_list,
            write_list,
            except_list,
            timeout);
        
        
        if (n <= 0 || read_list.empty())
        {
            for (ReplicaState & state : replica_states)
            {
                Connection * connection = state.connection;
                if (connection != nullptr)
                {
                    connection->disconnect();
                    invalidateReplica(state);