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 

MergeTreeDataWriter writer;
    MergeTreeDataMergerMutator merger_mutator;
    MergeStrategyPicker merge_strategy_picker;
    /** The queue of what needs to be done on this replica to catch up with everyone. It is taken from ZooKeeper (/replicas/me/queue/).
     * In ZK entries in chronological order. Here it is not necessary.
     */
    ReplicatedMergeTreeQueue queue;
    std::atomic<time_t> last_queue_update_start_time{0};
    std::atomic<time_t> last_queue_update_finish_time{0};
    mutable std::mutex last_queue_update_exception_lock;
    String last_queue_update_exception;
    String getLastQueueUpdateException() const;
    DataPartsExchange::Fetcher fetcher;
    
    Poco::Event startup_event;
    
    std::atomic<bool> partial_shutdown_called {false};
    
    Poco::Event partial_shutdown_event {false};     
    int metadata_version = 0;
    
    
    bool queue_update_in_progress = false;
    BackgroundSchedulePool::TaskHolder queue_updating_task;
    BackgroundSchedulePool::TaskHolder mutations_updating_task;
    
    BackgroundSchedulePool::TaskHolder merge_selecting_task;
    
    std::mutex merge_selecting_mutex;