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 

if ((*it)->getState() != DataPartState::Committed)
            {
                addPartContributionToColumnAndSecondaryIndexSizes(*it);
                addPartContributionToDataVolume(*it);
                modifyPartState(it, DataPartState::Committed);
            }
            pos = (*it)->info.max_block + 1;
            restored.push_back((*it)->name);
        }
        if (pos != part->info.max_block + 1)
            error = true;
        for (const String & name : restored)
        {
            LOG_INFO(log, "Activated part {}", name);
        }
        if (error)
        {
            LOG_ERROR(log, "The set of parts restored in place of {} looks incomplete. There might or might not be a data loss.{}", part->name, (error_parts.empty() ? "" : " Suspicious parts: " + error_parts));
        }
    }
}
void MergeTreeData::tryRemovePartImmediately(DataPartPtr && part)
{
    DataPartPtr part_to_delete;
    {
        auto lock = lockParts();
        LOG_TRACE(log, "Trying to immediately remove part {}", part->getNameWithState());
        if (part->getState() != DataPartState::Temporary)
        {
            auto it = data_parts_by_info.find(part->info);