One of our users just killed mutations produced by `ALTER MODIFY` queries on 21 servers. After that new alters on three servers stuck with:
```
Cannot execute alter metadata with version: 8 because another alter 7 must be executed before
```

However, there is no corresponding alter №7 in the replication queue and no undone mutations:
```
select * from system.mutations where is_done = 0
```

However, in the ZooKeeper, we have the correct state of metadata_version:
```
Row 13:
───────
name:           metadata_version
value:          7
czxid:          23078663291
mzxid:          29401964979
ctime:          2020-09-02 17:52:08
mtime:          2020-11-13 00:43:18
version:        7
cversion:       0
aversion:       0
ephemeralOwner: 0
dataLength:     1
numChildren:    0
pzxid:          23078663291
```
`SYSTEM RESTART REPLICA dbname.table_name` solves the issue, but it seems like` KILL MUTATION` in some cases can lead to unfinished alter.
return nullptr;
        mutation_was_active = !it->second.is_done;
        entry = it->second.entry;
        for (const auto & partition_and_block_num : entry->block_numbers)
        {
            auto & in_partition = mutations_by_partition[partition_and_block_num.first];
            in_partition.erase(partition_and_block_num.second);
            if (in_partition.empty())
                mutations_by_partition.erase(partition_and_block_num.first);
        }
        if (entry->isAlterMutation())
        {
            LOG_DEBUG(log, "Removed alter {} because mutation {} were killed.", entry->alter_version, entry->znode_name);
            alter_sequence.finishDataAlter(entry->alter_version, state_lock);
        }
        mutations_by_znode.erase(it);
        LOG_DEBUG(log, "Removed mutation {} from local state.", entry->znode_name);
    }
    if (mutation_was_active)
        storage.background_executor.triggerTask();
    return entry;
}
ReplicatedMergeTreeQueue::StringSet ReplicatedMergeTreeQueue::moveSiblingPartsForMergeToEndOfQueue(const String & part_name)
{
    std::lock_guard lock(state_mutex);
    
    StringSet parts_for_merge;
    Queue::iterator merge_entry = queue.end();
    for (Queue::iterator it = queue.begin(); it != queue.end(); ++it)
    {