After upgrading clickhouse client and server from version 21.5.6.6 to version 21.6.3.14, I've lost all data stored prior to the update (or at least, access to this data).

All my table definitions are intact, but data from before the upgrade is not available. 

The clickhouse-server.log file has a lot of errors of the type "While loading part <path> calculated partition ID: <some-id> differs from partition ID in part name: <other-id>". For example:

```
2021.06.06 04:35:58.031714 [ 2076 ] {} <Error> auto DB::MergeTreeData::loadDataParts(bool)::(anonymous class)::operator()() const: Code: 246, e.displayText() = DB::Exception: While loading part /datadisk/clickhouse/store/1af/1afedfe1-c1e7-4382-9a39-6b81acd36f2c/7602567da462c2a7f2677c06a783bf1c_234_234_0/: calculated partition ID: 61df88718388867b629412876782fda3 differs from partition ID in part name: 7602567da462c2a7f2677c06a783bf1c, Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x8b5b17a in /usr/bin/clickhouse
1. DB::IMergeTreeDataPart::loadPartitionAndMinMaxIndex() @ 0x100992a0 in /usr/bin/clickhouse
2. ? @ 0x1011ef1c in /usr/bin/clickhouse
3. ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) @ 0x8b9df58 in /usr/bin/clickhouse
4. ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&, void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()&&...)::'lambda'()::operator()() @ 0x8b9f91f in /usr/bin/clickhouse
5. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x8b9b49f in /usr/bin/clickhouse
6. ? @ 0x8b9e9c3 in /usr/bin/clickhouse
7. start_thread @ 0x76db in /lib/x86_64-linux-gnu/libpthread-2.27.so
8. __clone @ 0x12171f in /lib/x86_64-linux-gnu/libc-2.27.so
 (version 21.6.3.14 (official build))
```

I've noticed I have some data stored in a /detached/ folder. When I try to attach that with the "alter table X attach partition id 'Y'" syntax, I get the same error that the calculated partition ID  differs from partition ID in part name.

What can have caused this? Is there anyway to get the data back?

Additional information:
- my tables are using the MergeTree engine, while some materialized views use AggregatingMergeTree and SummingMergeTree. All of them have lost older data.
- In the system tables, some tables have data from before the upgrade, while others seem to have been truncated when upgrading (e.g. system.trace_log includes old data, while system.errors only has data from after the upgrade). I don't know if this is by design or not.
- my best guess is that the upgrade caused this, but for all I know it is possible that some corruption happened before this, and the upgrade made it visible
- the partitioning key for all my tables is of type (UUID, UInt32) (e.g PARTITION BY (Id, toYYYYMM(timestamp)) )

{
        throw Exception("Cannot convert UInt128 to " + demangle(typeid(T).name()), ErrorCodes::CANNOT_CONVERT_TYPE);
    }
    template <typename U>
    T operator() (const DecimalField<U> & x) const
    {
        if constexpr (std::is_floating_point_v<T>)
            return x.getValue(). template convertTo<T>() / x.getScaleMultiplier(). template convertTo<T>();
        else if constexpr (std::is_same_v<T, UInt128>)
        {
            
            if constexpr (sizeof(U) < 16)
            {
                return UInt128(0, (x.getValue() / x.getScaleMultiplier()).value);
            }
            else if constexpr (sizeof(U) == 16)
            {
                auto tmp = (x.getValue() / x.getScaleMultiplier()).value;
                return UInt128(tmp >> 64, UInt64(tmp));
            }
            else
                throw Exception("No conversion to old UInt128 from " + demangle(typeid(U).name()), ErrorCodes::NOT_IMPLEMENTED);
        }
        else
            return (x.getValue() / x.getScaleMultiplier()). template convertTo<T>();
    }
    T operator() (const AggregateFunctionStateData &) const