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

bool optimize(
        const ASTPtr & query,
        const StorageMetadataPtr & ,
        const ASTPtr & partition,
        bool final,
        bool deduplicate,
        const Names & deduplicate_by_columns,
        ContextPtr context) override;
    void mutate(const MutationCommands & commands, ContextPtr context) override;
    
    std::vector<MergeTreeMutationStatus> getMutationsStatus() const override;
    CancellationCode killMutation(const String & mutation_id) override;
    void drop() override;
    void truncate(const ASTPtr &, const StorageMetadataPtr &, ContextPtr, TableExclusiveLockHolder &) override;
    void alter(const AlterCommands & commands, ContextPtr context, TableLockHolder & table_lock_holder) override;
    void checkTableCanBeDropped() const override;
    ActionLock getActionLock(StorageActionBlockType action_type) override;
    void onActionLockRemove(StorageActionBlockType action_type) override;
    CheckResults checkData(const ASTPtr & query, ContextPtr context) override;
    std::optional<JobAndPool> getDataProcessingJob() override;
    MergeTreeDeduplicationLog * getDeduplicationLog() { return deduplication_log.get(); }
private:
    
    std::mutex mutation_wait_mutex;
    std::condition_variable mutation_wait_event;
    MergeTreeDataSelectExecutor reader;
    MergeTreeDataWriter writer;
    MergeTreeDataMergerMutator merger_mutator;
    BackgroundJobsExecutor background_executor;
    BackgroundMovesExecutor background_moves_executor;