Report: https://s3.amazonaws.com/clickhouse-test-reports/36070/4a03402da59463140e0a193f0745ab81646dbc81/stateless_tests__debug__actions__[2/3].html

```
2022.04.08 20:52:53.653453 [ 478 ] {} <Fatal> : Logical error: 'Unexpected merged part 3_0_10_2 intersecting drop range 3_0_5_1'.
2022.04.08 20:52:53.654752 [ 37793 ] {} <Fatal> BaseDaemon: ########################################
2022.04.08 20:52:53.654969 [ 37793 ] {} <Fatal> BaseDaemon: (version 22.4.1.1630, build id: A257C11352B2E437) (from thread 478) (no query) Received signal Aborted (6)
2022.04.08 20:52:53.655135 [ 37793 ] {} <Fatal> BaseDaemon: 
2022.04.08 20:52:53.655338 [ 37793 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f0bd352303b 0x7f0bd3502859 0x17ad87f4 0x17ad8902 0x1a6688aa 0x27aaf3b5 0x276b9184 0x276b60ab 0x2773e5c5 0x2773e53d 0x2773e512 0x2773e4cd 0x2773e495 0x27d9ce1b 0x27d84a8d 0x27d75af9 0x276e62c3 0x27740535 0x277404d5 0x2774049d 0x27740475 0x27740440 0x25c02726 0x25bfaaf5 0x2776cafd 0x27a83eef 0x27a85762 0x27a8b9b8 0x27a8b975 0x27a8b93d 0x27a8b915 0x27a8b8dd 0x17b3ace6 0x17b371d5 0x17be806f 0x17bf1f44 0x17bf1f15 0x17bf1ea1 0x17bf19f2 0x17bf1796 0x17bf1675
2022.04.08 20:52:53.655498 [ 37793 ] {} <Fatal> BaseDaemon: 4. raise @ 0x7f0bd352303b in ?
2022.04.08 20:52:53.655586 [ 37793 ] {} <Fatal> BaseDaemon: 5. abort @ 0x7f0bd3502859 in ?
2022.04.08 20:52:53.810525 [ 37793 ] {} <Fatal> BaseDaemon: 6. /build/build_docker/../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&) @ 0x17ad87f4 in /usr/bin/clickhouse
2022.04.08 20:52:53.937632 [ 37793 ] {} <Fatal> BaseDaemon: 7. /build/build_docker/../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) @ 0x17ad8902 in /usr/bin/clickhouse
2022.04.08 20:52:54.610560 [ 37793 ] {} <Fatal> BaseDaemon: 8. /build/build_docker/../src/Common/Exception.h:39: DB::Exception::Exception<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(int, fmt::v8::basic_format_string<char, fmt::v8::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>::type, fmt::v8::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::type>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) @ 0x1a6688aa in /usr/bin/clickhouse
2022.04.08 20:52:55.641121 [ 37793 ] {} <Fatal> BaseDaemon: 9. /build/build_docker/../src/Storages/MergeTree/MergeTreeData.cpp:2814: DB::MergeTreeData::removePartsInRangeFromWorkingSet(DB::MergeTreePartInfo const&, bool, std::__1::unique_lock<std::__1::mutex>&) @ 0x27aaf3b5 in /usr/bin/clickhouse
2022.04.08 20:52:56.540700 [ 37793 ] {} <Fatal> BaseDaemon: 10. /build/build_docker/../src/Storages/StorageReplicatedMergeTree.cpp:1888: DB::StorageReplicatedMergeTree::executeDropRange(DB::ReplicatedMergeTreeLogEntry const&) @ 0x276b9184 in /usr/bin/clickhouse
2022.04.08 20:52:57.679107 [ 37793 ] {} <Fatal> BaseDaemon: 11. /build/build_docker/../src/Storages/StorageReplicatedMergeTree.cpp:1554: DB::StorageReplicatedMergeTree::executeLogEntry(DB::ReplicatedMergeTreeLogEntry&) @ 0x276b60ab in /usr/bin/clickhouse
2022.04.08 20:52:58.776418 [ 37793 ] {} <Fatal> BaseDaemon: 12. /build/build_docker/../src/Storages/StorageReplicatedMergeTree.cpp:2958: DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13::operator()(std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&) const @ 0x2773e5c5 in /usr/bin/clickhouse
2022.04.08 20:53:00.233489 [ 37793 ] {} <Fatal> BaseDaemon: 13. /build/build_docker/../contrib/libcxx/include/type_traits:3640: decltype(static_cast<DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13&>(fp)(static_cast<std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&>(fp0))) std::__1::__invoke<DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13&, std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&>(DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13&, std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&) @ 0x2773e53d in /usr/bin/clickhouse
2022.04.08 20:53:01.347974 [ 37793 ] {} <Fatal> BaseDaemon: 14. /build/build_docker/../contrib/libcxx/include/__functional/invoke.h:30: bool std::__1::__invoke_void_return_wrapper<bool, false>::__call<DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13&, std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&>(DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13&, std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&) @ 0x2773e512 in /usr/bin/clickhouse
2022.04.08 20:53:02.351779 [ 37793 ] {} <Fatal> BaseDaemon: 15. /build/build_docker/../contrib/libcxx/include/__functional/function.h:230: std::__1::__function::__default_alloc_func<DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13, bool (std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&)>::operator()(std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&) @ 0x2773e4cd in /usr/bin/clickhouse
2022.04.08 20:53:03.380420 [ 37793 ] {} <Fatal> BaseDaemon: 16. /build/build_docker/../contrib/libcxx/include/__functional/function.h:711: bool std::__1::__function::__policy_invoker<bool (std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&)>::__call_impl<std::__1::__function::__default_alloc_func<DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>)::$_13, bool (std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&)> >(std::__1::__function::__policy_storage const*, std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&) @ 0x2773e495 in /usr/bin/clickhouse
2022.04.08 20:53:03.911395 [ 37793 ] {} <Fatal> BaseDaemon: 17. /build/build_docker/../contrib/libcxx/include/__functional/function.h:843: std::__1::__function::__policy_func<bool (std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&)>::operator()(std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&) const @ 0x27d9ce1b in /usr/bin/clickhouse
2022.04.08 20:53:04.384889 [ 37793 ] {} <Fatal> BaseDaemon: 18. /build/build_docker/../contrib/libcxx/include/__functional/function.h:1184: std::__1::function<bool (std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&)>::operator()(std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&) const @ 0x27d84a8d in /usr/bin/clickhouse
2022.04.08 20:53:04.847992 [ 37793 ] {} <Fatal> BaseDaemon: 19. /build/build_docker/../src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp:1526: DB::ReplicatedMergeTreeQueue::processEntry(std::__1::function<std::__1::shared_ptr<zkutil::ZooKeeper> ()>, std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&, std::__1::function<bool (std::__1::shared_ptr<DB::ReplicatedMergeTreeLogEntry>&)>) @ 0x27d75af9 in /usr/bin/clickhouse
2022.04.08 20:53:05.827678 [ 37793 ] {} <Fatal> BaseDaemon: 20. /build/build_docker/../src/Storages/StorageReplicatedMergeTree.cpp:2954: DB::StorageReplicatedMergeTree::processQueueEntry(std::__1::shared_ptr<DB::ReplicatedMergeTreeQueue::SelectedEntry>) @ 0x276e62c3 in /usr/bin/clickhouse
2022.04.08 20:53:06.856271 [ 37793 ] {} <Fatal> BaseDaemon: 21. /build/build_docker/../src/Storages/StorageReplicatedMergeTree.cpp:3036: DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15::operator()() @ 0x27740535 in /usr/bin/clickhouse
2022.04.08 20:53:07.909479 [ 37793 ] {} <Fatal> BaseDaemon: 22. /build/build_docker/../contrib/libcxx/include/type_traits:3640: decltype(static_cast<DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15&>(fp)()) std::__1::__invoke<DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15&>(DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15&) @ 0x277404d5 in /usr/bin/clickhouse
2022.04.08 20:53:08.895293 [ 37793 ] {} <Fatal> BaseDaemon: 23. /build/build_docker/../contrib/libcxx/include/__functional/invoke.h:30: bool std::__1::__invoke_void_return_wrapper<bool, false>::__call<DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15&>(DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15&) @ 0x2774049d in /usr/bin/clickhouse
2022.04.08 20:53:09.880951 [ 37793 ] {} <Fatal> BaseDaemon: 24. /build/build_docker/../contrib/libcxx/include/__functional/function.h:230: std::__1::__function::__default_alloc_func<DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15, bool ()>::operator()() @ 0x27740475 in /usr/bin/clickhouse
2022.04.08 20:53:10.868055 [ 37793 ] {} <Fatal> BaseDaemon: 25. /build/build_docker/../contrib/libcxx/include/__functional/function.h:711: bool std::__1::__function::__policy_invoker<bool ()>::__call_impl<std::__1::__function::__default_alloc_func<DB::StorageReplicatedMergeTree::scheduleDataProcessingJob(DB::BackgroundJobsAssignee&)::$_15, bool ()> >(std::__1::__function::__policy_storage const*) @ 0x27740440 in /usr/bin/clickhouse
2022.04.08 20:53:11.186878 [ 37793 ] {} <Fatal> BaseDaemon: 26. /build/build_docker/../contrib/libcxx/include/__functional/function.h:843: std::__1::__function::__policy_func<bool ()>::operator()() const @ 0x25c02726 in /usr/bin/clickhouse
2022.04.08 20:53:11.463030 [ 37793 ] {} <Fatal> BaseDaemon: 27. /build/build_docker/../contrib/libcxx/include/__functional/function.h:1184: std::__1::function<bool ()>::operator()() const @ 0x25bfaaf5 in /usr/bin/clickhouse
2022.04.08 20:53:12.474636 [ 37793 ] {} <Fatal> BaseDaemon: 28. /build/build_docker/../src/Storages/MergeTree/IExecutableTask.h:60: DB::ExecutableLambdaAdapter::executeStep() @ 0x2776cafd in /usr/bin/clickhouse
2022.04.08 20:53:12.577190 [ 37793 ] {} <Fatal> BaseDaemon: 29. /build/build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:95: DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::routine(std::__1::shared_ptr<DB::TaskRuntimeData>) @ 0x27a83eef in /usr/bin/clickhouse
2022.04.08 20:53:12.681420 [ 37793 ] {} <Fatal> BaseDaemon: 30. /build/build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:195: DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::threadFunction() @ 0x27a85762 in /usr/bin/clickhouse
2022.04.08 20:53:12.800337 [ 37793 ] {} <Fatal> BaseDaemon: 31. /build/build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.h:183: DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'()::operator()() const @ 0x27a8b9b8 in /usr/bin/clickhouse
2022.04.08 20:53:12.921308 [ 37793 ] {} <Fatal> BaseDaemon: 32. /build/build_docker/../contrib/libcxx/include/type_traits:3640: decltype(static_cast<DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'()&>(fp)()) std::__1::__invoke<DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'()&>(DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'()&) @ 0x27a8b975 in /usr/bin/clickhouse
2022.04.08 20:53:13.040452 [ 37793 ] {} <Fatal> BaseDaemon: 33. /build/build_docker/../contrib/libcxx/include/__functional/invoke.h:62: void std::__1::__invoke_void_return_wrapper<void, true>::__call<DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'()&>(DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'()&) @ 0x27a8b93d in /usr/bin/clickhouse
2022.04.08 20:53:13.160871 [ 37793 ] {} <Fatal> BaseDaemon: 34. /build/build_docker/../contrib/libcxx/include/__functional/function.h:230: std::__1::__function::__default_alloc_func<DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'(), void ()>::operator()() @ 0x27a8b915 in /usr/bin/clickhouse
2022.04.08 20:53:13.279714 [ 37793 ] {} <Fatal> BaseDaemon: 35. /build/build_docker/../contrib/libcxx/include/__functional/function.h:711: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<DB::MergeTreeBackgroundExecutor<DB::OrdinaryRuntimeQueue>::MergeTreeBackgroundExecutor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, unsigned long, unsigned long)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x27a8b8dd in /usr/bin/clickhouse
2022.04.08 20:53:13.347697 [ 37793 ] {} <Fatal> BaseDaemon: 36. /build/build_docker/../contrib/libcxx/include/__functional/function.h:843: std::__1::__function::__policy_func<void ()>::operator()() const @ 0x17b3ace6 in /usr/bin/clickhouse
2022.04.08 20:53:13.408786 [ 37793 ] {} <Fatal> BaseDaemon: 37. /build/build_docker/../contrib/libcxx/include/__functional/function.h:1184: std::__1::function<void ()>::operator()() const @ 0x17b371d5 in /usr/bin/clickhouse
2022.04.08 20:53:13.481506 [ 37793 ] {} <Fatal> BaseDaemon: 38. /build/build_docker/../src/Common/ThreadPool.cpp:277: ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) @ 0x17be806f in /usr/bin/clickhouse
2022.04.08 20:53:13.576277 [ 37793 ] {} <Fatal> BaseDaemon: 39. /build/build_docker/../src/Common/ThreadPool.cpp:142: void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()::operator()() const @ 0x17bf1f44 in /usr/bin/clickhouse
2022.04.08 20:53:13.910446 [ 385 ] {} <Fatal> Application: Child process was terminated by signal 6.
```
{
    if (!getSettings()->replicated_can_become_leader)
    {
        LOG_INFO(log, "Will not enter leader election because replicated_can_become_leader=0");
        return;
    }
    zkutil::checkNoOldLeaders(log, *current_zookeeper, fs::path(zookeeper_path) / "leader_election");
    LOG_INFO(log, "Became leader");
    is_leader = true;
}
void StorageReplicatedMergeTree::stopBeingLeader()
{
    if (!is_leader)
        return;
    LOG_INFO(log, "Stopped being leader");
    is_leader = false;
}
ConnectionTimeouts StorageReplicatedMergeTree::getFetchPartHTTPTimeouts(ContextPtr local_context)
{
    auto timeouts = ConnectionTimeouts::getHTTPTimeouts(local_context);
    auto settings = getSettings();
    if (settings->replicated_fetches_http_connection_timeout.changed)
        timeouts.connection_timeout = settings->replicated_fetches_http_connection_timeout;
    if (settings->replicated_fetches_http_send_timeout.changed)
        timeouts.send_timeout = settings->replicated_fetches_http_send_timeout;
    if (settings->replicated_fetches_http_receive_timeout.changed)
        timeouts.receive_timeout = settings->replicated_fetches_http_receive_timeout;
    return timeouts;
}
bool StorageReplicatedMergeTree::checkReplicaHavePart(const String & replica, const String & part_name)