```
2022.05.28 00:45:30.578616 [ 461 ] {} <Fatal> : Logical error: 'Part 3_21_106_1 intersects next part 3_60_60_1 (state Active). It is a bug.'.
2022.05.28 00:45:30.582971 [ 120575 ] {} <Fatal> BaseDaemon: ########################################
2022.05.28 00:45:30.583044 [ 120575 ] {} <Fatal> BaseDaemon: (version 22.6.1.1, build id: AD0D6014D157883B) (from thread 461) (no query) Received signal Aborted (6)
2022.05.28 00:45:30.583160 [ 120575 ] {} <Fatal> BaseDaemon: 
2022.05.28 00:45:30.583249 [ 120575 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f1aa6daa03b 0x7f1aa6d89859 0xd4656a2 0xd465ba5 0x12e0ef5f 0x2eae9c51 0x2eaebf60 0x2eaf3825 0x2e2eed04 0x2e2cd888 0x2efa8b9d 0x2efa58c4 0x2ea71ccb 0x2ea74fd8 0xd5bb707 0xd5c1d73 0xd5b5e67 0xd5be1f7 0x7f1aa6f61609 0x7f1aa6e86163
2022.05.28 00:45:30.583460 [ 120575 ] {} <Fatal> BaseDaemon: 3. raise @ 0x7f1aa6daa03b in ?
2022.05.28 00:45:30.583533 [ 120575 ] {} <Fatal> BaseDaemon: 4. abort @ 0x7f1aa6d89859 in ?
2022.05.28 00:45:30.670464 [ 120575 ] {} <Fatal> BaseDaemon: 5. ./build_docker/../src/Common/Exception.cpp:40: DB::abortOnFailedAssertion(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xd4656a2 in /usr/bin/clickhouse
2022.05.28 00:45:30.742006 [ 120575 ] {} <Fatal> BaseDaemon: 6.1. inlined from ./build_docker/../src/Common/Exception.cpp:63: 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&)
2022.05.28 00:45:30.742079 [ 120575 ] {} <Fatal> BaseDaemon: 6. ../src/Common/Exception.cpp:70: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xd465ba5 in /usr/bin/clickhouse
2022.05.28 00:45:31.050454 [ 120575 ] {} <Fatal> BaseDaemon: 7.1. inlined from ./build_docker/../contrib/libcxx/include/string:1445: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__is_long() const
2022.05.28 00:45:31.050508 [ 120575 ] {} <Fatal> BaseDaemon: 7.2. inlined from ../contrib/libcxx/include/string:2231: ~basic_string
2022.05.28 00:45:31.050569 [ 120575 ] {} <Fatal> BaseDaemon: 7. ../src/Common/Exception.h:37: 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> >&&) @ 0x12e0ef5f in /usr/bin/clickhouse
2022.05.28 00:45:31.784159 [ 120575 ] {} <Fatal> BaseDaemon: 8. ./build_docker/../src/Storages/MergeTree/MergeTreeData.cpp:2684: DB::MergeTreeData::getActivePartsToReplace(DB::MergeTreePartInfo const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IMergeTreeDataPart const>&, std::__1::unique_lock<std::__1::mutex>&) const @ 0x2eae9c51 in /usr/bin/clickhouse
2022.05.28 00:45:32.428284 [ 120575 ] {} <Fatal> BaseDaemon: 9.1. inlined from ./build_docker/../contrib/libcxx/include/__memory/shared_ptr.h:802: std::__1::shared_ptr<DB::IMergeTreeDataPart const>::get() const
2022.05.28 00:45:32.428350 [ 120575 ] {} <Fatal> BaseDaemon: 9.2. inlined from ../contrib/libcxx/include/__memory/shared_ptr.h:834: std::__1::shared_ptr<DB::IMergeTreeDataPart const>::operator bool() const
2022.05.28 00:45:32.428394 [ 120575 ] {} <Fatal> BaseDaemon: 9. ../src/Storages/MergeTree/MergeTreeData.cpp:2781: DB::MergeTreeData::renameTempPartAndReplace(std::__1::shared_ptr<DB::IMergeTreeDataPart>&, DB::MergeTreeTransaction*, SimpleIncrement*, DB::MergeTreeData::Transaction*, std::__1::unique_lock<std::__1::mutex>&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >*, DB::MergeTreeDeduplicationLog*, std::__1::basic_string_view<char, std::__1::char_traits<char> >) @ 0x2eaebf60 in /usr/bin/clickhouse
2022.05.28 00:45:33.040783 [ 120575 ] {} <Fatal> BaseDaemon: 10. ./build_docker/../src/Storages/MergeTree/MergeTreeData.cpp:2880: DB::MergeTreeData::renameTempPartAndReplace(std::__1::shared_ptr<DB::IMergeTreeDataPart>&, DB::MergeTreeTransaction*, SimpleIncrement*, DB::MergeTreeData::Transaction*, DB::MergeTreeDeduplicationLog*) @ 0x2eaf3825 in /usr/bin/clickhouse
2022.05.28 00:45:33.585251 [ 120575 ] {} <Fatal> BaseDaemon: 11. ./build_docker/../src/Storages/StorageReplicatedMergeTree.cpp:4035: DB::StorageReplicatedMergeTree::fetchPart(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, unsigned long, std::__1::shared_ptr<zkutil::ZooKeeper>, bool) @ 0x2e2eed04 in /usr/bin/clickhouse
2022.05.28 00:45:34.309453 [ 120575 ] {} <Fatal> BaseDaemon: 12. ./build_docker/../src/Storages/StorageReplicatedMergeTree.cpp:1802: DB::StorageReplicatedMergeTree::executeFetch(DB::ReplicatedMergeTreeLogEntry&, bool) @ 0x2e2cd888 in /usr/bin/clickhouse
2022.05.28 00:45:34.339396 [ 120575 ] {} <Fatal> BaseDaemon: 13.1. inlined from ./build_docker/../src/Storages/MergeTree/ReplicatedMergeMutateTaskBase.cpp:149: operator()
2022.05.28 00:45:34.339452 [ 120575 ] {} <Fatal> BaseDaemon: 13. ../src/Storages/MergeTree/ReplicatedMergeMutateTaskBase.cpp:173: DB::ReplicatedMergeMutateTaskBase::executeImpl() @ 0x2efa8b9d in /usr/bin/clickhouse
2022.05.28 00:45:34.364537 [ 120575 ] {} <Fatal> BaseDaemon: 14. ./build_docker/../src/Storages/MergeTree/ReplicatedMergeMutateTaskBase.cpp:0: DB::ReplicatedMergeMutateTaskBase::executeStep() @ 0x2efa58c4 in /usr/bin/clickhouse
2022.05.28 00:45:34.395811 [ 120575 ] {} <Fatal> BaseDaemon: 15. ./build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:149: DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::routine(std::__1::shared_ptr<DB::TaskRuntimeData>) @ 0x2ea71ccb in /usr/bin/clickhouse
2022.05.28 00:45:34.437278 [ 120575 ] {} <Fatal> BaseDaemon: 16. ./build_docker/../src/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp:0: DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::threadFunction() @ 0x2ea74fd8 in /usr/bin/clickhouse
2022.05.28 00:45:34.476483 [ 120575 ] {} <Fatal> BaseDaemon: 17. ./build_docker/../contrib/libcxx/include/__functional/function.h:0: ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) @ 0xd5bb707 in /usr/bin/clickhouse
2022.05.28 00:45:34.512578 [ 120575 ] {} <Fatal> BaseDaemon: 18. ./build_docker/../src/Common/ThreadPool.h:189: ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&)::'lambda'()::operator()() @ 0xd5c1d73 in /usr/bin/clickhouse
2022.05.28 00:45:34.553693 [ 120575 ] {} <Fatal> BaseDaemon: 19. ./build_docker/../contrib/libcxx/include/__functional/function.h:0: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xd5b5e67 in /usr/bin/clickhouse
2022.05.28 00:45:34.595036 [ 120575 ] {} <Fatal> BaseDaemon: 20.1. inlined from ./build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:312: std::__1::unique_ptr<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'()>, std::__1::default_delete<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'()> > >::reset(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'()>*)
2022.05.28 00:45:34.595084 [ 120575 ] {} <Fatal> BaseDaemon: 20.2. inlined from ../contrib/libcxx/include/__memory/unique_ptr.h:269: ~unique_ptr
2022.05.28 00:45:34.595107 [ 120575 ] {} <Fatal> BaseDaemon: 20. ../contrib/libcxx/include/thread:295: 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*) @ 0xd5be1f7 in /usr/bin/clickhouse
2022.05.28 00:45:34.595150 [ 120575 ] {} <Fatal> BaseDaemon: 21. ? @ 0x7f1aa6f61609 in ?
2022.05.28 00:45:34.595182 [ 120575 ] {} <Fatal> BaseDaemon: 22. __clone @ 0x7f1aa6e86163 in ?
2022.05.28 00:45:35.728841 [ 120575 ] {} <Fatal> BaseDaemon: Calculated checksum of the binary: 74BE49CDEE0E5956AF99B70DD1C44FBB. There is no information about the reference checksum.
2022.05.28 00:45:51.283704 [ 393 ] {} <Fatal> Application: Child process was terminated by signal 6.
```

https://s3.amazonaws.com/clickhouse-test-reports/37597/735d2dfebd390c42a27554f85d9ccc87768ffc94/stateless_tests__address__actions__[2/2].html
{
    auto lock = (acquired_lock) ? DataPartsLock() : lockParts();
    DataPartsVector res;
    for (const auto & state : affordable_states)
    {
        DataPartStateAndPartitionID state_with_partition{state, partition_id};
        res.insert(res.end(), data_parts_by_state_and_info.lower_bound(state_with_partition), data_parts_by_state_and_info.upper_bound(state_with_partition));
    }
    return res;
}
MergeTreeData::DataPartsVector MergeTreeData::getDataPartsVectorInPartitionForInternalUsage(
    const MergeTreeData::DataPartState & state, const String & partition_id, DataPartsLock * acquired_lock) const
{
    DataPartStateAndPartitionID state_with_partition{state, partition_id};
    auto lock = (acquired_lock) ? DataPartsLock() : lockParts();
    return DataPartsVector(
        data_parts_by_state_and_info.lower_bound(state_with_partition),
        data_parts_by_state_and_info.upper_bound(state_with_partition));
}
MergeTreeData::DataPartsVector MergeTreeData::getVisibleDataPartsVectorInPartitions(ContextPtr local_context, const std::unordered_set<String> & partition_ids) const