How to reproduce (this is the part of 01526_alter_add_and_modify_order_zookeeper test):

```sql
CREATE TABLE table_for_alter
(
    `d` Date,
    `a` String,
    `b` UInt8,
    `x` String,
    `y` Int8,
    `version` UInt64,
    `sign` Int8 DEFAULT 1
)
ENGINE = ReplicatedVersionedCollapsingMergeTree('/clickhouse/tables/01526_alter_add/t4', '1', sign, version)
PARTITION BY y
ORDER BY d
SETTINGS index_granularity = 8192;

INSERT INTO table_for_alter VALUES(toDate('2019-10-01'), 'a', 1, 'aa', 1, 1, 1);

ALTER TABLE table_for_alter ADD COLUMN order UInt32, MODIFY ORDER BY (d, order);
```

After restarting server it fails with the error:
```
<Error> Application: DB::Exception: Existing table metadata in ZooKeeper differs in sorting key expression. Stored in ZooKeeper: d, order, local: d, order, version: Cannot attach table `default`.`table_for_alter` from metadata file /home/avogar/ClickHouse/programs/server/store/379/3795dcee-cc60-41ab-b795-dceecc6001ab/table_for_alter.sql from query ATTACH TABLE default.table_for_alter UUID 'b7e7470c-6fcb-4a95-b7e7-470c6fcbda95' (`d` Date, `a` String, `b` UInt8, `x` String, `y` Int8, `version` UInt64, `sign` Int8 DEFAULT 1, `order` UInt32) ENGINE = ReplicatedVersionedCollapsingMergeTree('/clickhouse/tables/01526_alter_add/t4', '1', sign, version) PARTITION BY y PRIMARY KEY d ORDER BY (d, order) SETTINGS index_granularity = 8192: while loading database `default` from path ./metadata/default
```
}
    else
        index_granularity_bytes = 0;
    if (checkString("constraints: ", in))
        in >> constraints >> "\n";
}
ReplicatedMergeTreeTableMetadata ReplicatedMergeTreeTableMetadata::parse(const String & s)
{
    ReplicatedMergeTreeTableMetadata metadata;
    ReadBufferFromString buf(s);
    metadata.read(buf);
    return metadata;
}
void ReplicatedMergeTreeTableMetadata::checkImmutableFieldsEquals(const ReplicatedMergeTreeTableMetadata & from_zk) const
{
    if (data_format_version < MERGE_TREE_DATA_MIN_FORMAT_VERSION_WITH_CUSTOM_PARTITIONING)
    {
        if (date_column != from_zk.date_column)
            throw Exception("Existing table metadata in ZooKeeper differs in date index column."
                " Stored in ZooKeeper: " + from_zk.date_column + ", local: " + date_column,
                ErrorCodes::METADATA_MISMATCH);
    }
    else if (!from_zk.date_column.empty())
    {
        throw Exception(
            "Existing table metadata in ZooKeeper differs in date index column."
            " Stored in ZooKeeper: " + from_zk.date_column + ", local is custom-partitioned.",
            ErrorCodes::METADATA_MISMATCH);
    }
    if (index_granularity != from_zk.index_granularity)