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

NamesAndTypesList getVirtuals() const override;
    bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand, ContextPtr, const StorageMetadataPtr & metadata_snapshot) const override;
    
    void loadDataParts(bool skip_sanity_checks);
    String getLogName() const { return log_name; }
    Int64 getMaxBlockNumber() const;
    
    DataParts getDataParts(const DataPartStates & affordable_states) const;
    
    
    DataPartsVector getDataPartsVector(
        const DataPartStates & affordable_states, DataPartStateVector * out_states = nullptr, bool require_projection_parts = false) const;
    
    DataPartsVector getAllDataPartsVector(DataPartStateVector * out_states = nullptr, bool require_projection_parts = false) const;
    
    DetachedPartsInfo getDetachedParts() const;
    void validateDetachedPartName(const String & name) const;
    void dropDetached(const ASTPtr & partition, bool part, ContextPtr context);
    MutableDataPartsVector tryLoadPartsToAttach(const ASTPtr & partition, bool attach_part,
            ContextPtr context, PartsTemporaryRename & renamed_parts);
    
    DataParts getDataParts() const;
    DataPartsVector getDataPartsVector() const;
    
    DataPartPtr getActiveContainingPart(const String & part_name) const;
    DataPartPtr getActiveContainingPart(const MergeTreePartInfo & part_info) const;
    DataPartPtr getActiveContainingPart(const MergeTreePartInfo & part_info, DataPartState state, DataPartsLock & lock) const;