I am reading clickhouse mutation code. In StorageMergeTree->selectPartsToMutate() function, there is a check 
`if (current_ast_elements + commands_size >= max_ast_elements)
                break;`

I think if there are many mutations then the check result will be true, so that it will skip the remaining mutations.
But the new part's mutation is set to the last one in mutation map, and it does not apply the remaining mutations actually.
`new_part_info.mutation = current_mutations_by_version.rbegin()->first;`

Then the new part will miss the remaining mutations in future mutation job.

I think it's wrong here. Am I right?

If it is right, I will submit a PR 

BackgroundSchedulePool::TaskHolder mutations_finalizing_task;
    
    ReplicatedMergeTreeCleanupThread cleanup_thread;
    
    ReplicatedMergeTreePartCheckThread part_check_thread;
    
    ReplicatedMergeTreeRestartingThread restarting_thread;
    PartMovesBetweenShardsOrchestrator part_moves_between_shards_orchestrator;
    
    bool other_replicas_fixed_granularity = false;
    
    const bool allow_renaming;
    const size_t replicated_fetches_pool_size;
    
    
    ThrottlerPtr replicated_fetches_throttler;
    ThrottlerPtr replicated_sends_throttler;
    template <class Func>
    void foreachCommittedParts(Func && func, bool select_sequential_consistency) const;
    /** Creates the minimum set of nodes in ZooKeeper and create first replica.
      * Returns true if was created, false if exists.
      */
    bool createTableIfNotExists(const StorageMetadataPtr & metadata_snapshot);
    /**
     * Creates a replica in ZooKeeper and adds to the queue all that it takes to catch up with the rest of the replicas.
     */
    void createReplica(const StorageMetadataPtr & metadata_snapshot);
    /** Create nodes in the ZK, which must always be, but which might not exist when older versions of the server are running.
      */
    void createNewZooKeeperNodes();