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.
{
    std::lock_guard lock(pull_logs_to_queue_mutex);
    if (pull_log_blocker.isCancelled())
        throw Exception("Log pulling is cancelled", ErrorCodes::ABORTED);
    String index_str = zookeeper->get(replica_path + "/log_pointer");
    UInt64 index;
    
    Coordination::Stat stat;
    zookeeper->get(zookeeper_path + "/log", &stat);
    Strings log_entries = zookeeper->getChildrenWatch(zookeeper_path + "/log", nullptr, watch_callback);
    
    
    
    
    updateMutations(zookeeper);
    if (index_str.empty())
    {
        
        index = log_entries.empty() ? 0 : parse<UInt64>(std::min_element(log_entries.begin(), log_entries.end())->substr(strlen("log-")));
        zookeeper->set(replica_path + "/log_pointer", toString(index));
    }
    else
    {
        index = parse<UInt64>(index_str);
    }
    String min_log_entry = "log-" + padIndex(index);