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. - 

required_columns.insert(column.name);
            if (rewrite_before_where(candidate, projection, required_columns, projection.sample_block, {}))
            {
                candidate.required_columns = {required_columns.begin(), required_columns.end()};
                candidates.push_back(std::move(candidate));
            }
            /
        }
    }
    /
    if (!candidates.empty())
    {
        /
        query_info.merge_tree_data_select_cache = std::make_unique<MergeTreeDataSelectCache>();
        std::unique_ptr<PartitionIdToMaxBlock> max_added_blocks;
        if (settings.select_sequential_consistency)
        {
            if (const StorageReplicatedMergeTree * replicated = dynamic_cast<const StorageReplicatedMergeTree *>(this))
                max_added_blocks = std::make_unique<PartitionIdToMaxBlock>(replicated->getMaxAddedBlocks());
        }
        auto parts = getDataPartsVector();
        MergeTreeDataSelectExecutor reader(*this);
        reader.readFromParts(
            parts,
            analysis_result.required_columns,
            metadata_snapshot,
            metadata_snapshot,
            query_info, /
            query_context,
            0, /