Symptoms: all threads in BackgroundScheduledPool busy, lot of tasks in replication queue, none of the tasks is executing. 

![Screenshot from 2021-04-16 16-21-44_](https://user-images.githubusercontent.com/1549571/115193796-e767d600-a0ec-11eb-887c-5c9c2412e50c.png)

Related to #16895

Possible workarounds (poor options): increasing the background_schedule_pool_size to huge values, or restart server every time when that happens etc. - 

std::unordered_set<String> partition_ids;
            for (const DataPartPtr & part : data_parts)
                partition_ids.emplace(part->info.partition_id);
            UInt64 disk_space = getStoragePolicy()->getMaxUnreservedFreeSpace();
            for (const String & partition_id : partition_ids)
            {
                size_t try_no = 0;
                for (; try_no < max_retries; ++try_no)
                {
                    
                    
                    std::lock_guard merge_selecting_lock(merge_selecting_mutex);
                    ReplicatedMergeTreeMergePredicate can_merge = queue.getMergePredicate(zookeeper);
                    FutureMergedMutatedPart future_merged_part;
                    if (storage_settings.get()->assign_part_uuids)
                        future_merged_part.uuid = UUIDHelpers::generateV4();
                    SelectPartsDecision select_decision = merger_mutator.selectAllPartsToMergeWithinPartition(
                        future_merged_part, disk_space, can_merge, partition_id, true, metadata_snapshot, nullptr, query_context->getSettingsRef().optimize_skip_merged_partitions);
                    if (select_decision != SelectPartsDecision::SELECTED)
                        break;
                    ReplicatedMergeTreeLogEntryData merge_entry;
                    CreateMergeEntryResult create_result = createLogEntryToMergeParts(
                        zookeeper, future_merged_part.parts,
                        future_merged_part.name, future_merged_part.uuid, future_merged_part.type,
                        deduplicate, deduplicate_by_columns,
                        &merge_entry, can_merge.getVersion(), future_merged_part.merge_type);
                    if (create_result == CreateMergeEntryResult::MissingPart)
                        return handle_noop("Can't create merge queue node in ZooKeeper, because some parts are missing");
                    if (create_result == CreateMergeEntryResult::LogUpdated)
                        continue;