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 

throw Exception("Found a non-empty part with uninitialized minmax_idx. It's a bug", ErrorCodes::LOGICAL_ERROR);
        if (need_primary_key_max_column && !part->index_granularity.hasFinalMark())
        {
            normal_parts.push_back(part);
            continue;
        }
        size_t pos = 0;
        for (size_t i : metadata_snapshot->minmax_count_projection->partition_value_indices)
        {
            if (i >= part->partition.value.size())
                throw Exception("Partition value index is out of boundary. It's a bug", ErrorCodes::LOGICAL_ERROR);
            partition_minmax_count_columns[pos++]->insert(part->partition.value[i]);
        }
        size_t minmax_idx_size = part->minmax_idx->hyperrectangle.size();
        for (size_t i = 0; i < minmax_idx_size; ++i)
        {
            auto & min_column = assert_cast<ColumnAggregateFunction &>(*partition_minmax_count_columns[pos++]);
            auto & max_column = assert_cast<ColumnAggregateFunction &>(*partition_minmax_count_columns[pos++]);
            const auto & range = part->minmax_idx->hyperrectangle[i];
            insert(min_column, range.left);
            insert(max_column, range.right);
        }
        if (!primary_key_max_column_name.empty())
        {
            const auto & primary_key_column = *part->index[0];
            auto & min_column = assert_cast<ColumnAggregateFunction &>(*partition_minmax_count_columns[pos++]);
            auto & max_column = assert_cast<ColumnAggregateFunction &>(*partition_minmax_count_columns[pos++]);
            insert(min_column, primary_key_column[0]);
            insert(max_column, primary_key_column[primary_key_column.size() - 1]);
        }