How to reproduce (queries from test 02381_compress_marks_and_primary_key.sql):
```sql
create table test_02381_compact (a UInt64, b String) ENGINE = MergeTree order by (a, b);
insert into test_02381_compact values (1, 'Hello');
alter table test_02381_compact modify setting compress_marks = true, compress_primary_key = true;
insert into test_02381_compact values (2, 'World');
optimize table test_02381_compact final;
```
Then restart server and there will be an error:
```
<Error> default.test_02381_compact (cf52633f-7231-464c-af93-8b1c17cb778d): while loading part all_1_2_1 on path store/cf5/cf52633f-7231-464c-af93-8b1c17cb778d/all_1_2_1: Code: 33. DB::Exception: Cannot read all data. Bytes read: 0. Bytes expected: 8. (CANNOT_READ_ALL_DATA), Stack trace (when copying this message, always include the lines below):

0. /build/build_docker/../contrib/libcxx/include/exception:133: std::exception::capture() in /home/avogar/tmp/master/clickhouse
1. /build/build_docker/../contrib/libcxx/include/exception:111: std::exception::exception() in /home/avogar/tmp/master/clickhouse
2. /build/build_docker/../contrib/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) in /home/avogar/tmp/master/clickhouse
3. /build/build_docker/../src/Common/Exception.cpp:67: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) in /home/avogar/tmp/master/clickhouse
4. /build/build_docker/../src/IO/ReadBuffer.h:191: DB::ReadBuffer::readStrict(char*, unsigned long) in /home/avogar/tmp/master/clickhouse
5. /build/build_docker/../src/IO/ReadHelpers.h:113: void DB::readPODBinary<unsigned long>(unsigned long&, DB::ReadBuffer&) in /home/avogar/tmp/master/clickhouse
6. /build/build_docker/../src/IO/ReadHelpers.h:119: void DB::readIntBinary<unsigned long>(unsigned long&, DB::ReadBuffer&) in /home/avogar/tmp/master/clickhouse
7. /build/build_docker/../src/Storages/MergeTree/MergeTreeDataPartCompact.cpp:119: DB::MergeTreeDataPartCompact::loadIndexGranularityImpl(DB::MergeTreeIndexGranularity&, DB::MergeTreeIndexGranularityInfo const&, unsigned long, std::__1::shared_ptr<DB::IDataPartStorage> const&) in /home/avogar/tmp/master/clickhouse
8. /build/build_docker/../src/Storages/MergeTree/MergeTreeDataPartCompact.cpp:135: DB::MergeTreeDataPartCompact::loadIndexGranularity() in /home/avogar/tmp/master/clickhouse
9. /build/build_docker/../src/Storages/MergeTree/IMergeTreeDataPart.cpp:642: DB::IMergeTreeDataPart::loadColumnsChecksumsIndexes(bool, bool) in /home/avogar/tmp/master/clickhouse
10. /build/build_docker/../src/Storages/MergeTree/MergeTreeData.cpp:1042: DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_45::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IDisk> const&) const in /home/avogar/tmp/master/clickhouse
11. /build/build_docker/../src/Storages/MergeTree/MergeTreeData.cpp:1154: DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12::operator()() const in /home/avogar/tmp/master/clickhouse
12. /build/build_docker/../contrib/libcxx/include/type_traits:3640: decltype(static_cast<DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12&>(fp)()) std::__1::__invoke<DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12&>(DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12&) in /home/avogar/tmp/master/clickhouse
13. /build/build_docker/../contrib/libcxx/include/__functional/invoke.h:62: void std::__1::__invoke_void_return_wrapper<void, true>::__call<DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12&>(DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12&) in /home/avogar/tmp/master/clickhouse
14. /build/build_docker/../contrib/libcxx/include/__functional/function.h:230: std::__1::__function::__default_alloc_func<DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12, void ()>::operator()() in /home/avogar/tmp/master/clickhouse
15. /build/build_docker/../contrib/libcxx/include/__functional/function.h:711: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<DB::MergeTreeData::loadDataPartsFromDisk(std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >&, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >&, unsigned long, std::__1::queue<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::deque<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > >, std::__1::allocator<std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<DB::IDisk> > > > > > >&, bool, std::__1::shared_ptr<DB::MergeTreeSettings const> const&)::$_12, void ()> >(std::__1::__function::__policy_storage const*) in /home/avogar/tmp/master/clickhouse
16. /build/build_docker/../contrib/libcxx/include/__functional/function.h:843: std::__1::__function::__policy_func<void ()>::operator()() const in /home/avogar/tmp/master/clickhouse
17. /build/build_docker/../contrib/libcxx/include/__functional/function.h:1184: std::__1::function<void ()>::operator()() const in /home/avogar/tmp/master/clickhouse
18. /build/build_docker/../src/Common/ThreadPool.cpp:294: ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::worker(std::__1::__list_iterator<ThreadFromGlobalPoolImpl<false>, void*>) in /home/avogar/tmp/master/clickhouse
19. /build/build_docker/../src/Common/ThreadPool.cpp:144: void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()::operator()() const in /home/avogar/tmp/master/clickhouse
20. /build/build_docker/../contrib/libcxx/include/type_traits:3648: decltype(static_cast<void>(fp)()) std::__1::__invoke_constexpr<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()&>(void&&) in /home/avogar/tmp/master/clickhouse
21. /build/build_docker/../contrib/libcxx/include/tuple:1595: decltype(auto) std::__1::__apply_tuple_impl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()&, std::__1::tuple<>&>(void&&, std::__1::tuple<>&, std::__1::__tuple_indices<>) in /home/avogar/tmp/master/clickhouse
22. /build/build_docker/../contrib/libcxx/include/tuple:1604: decltype(auto) std::__1::apply<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()&, std::__1::tuple<>&>(void&&, std::__1::tuple<>&) in /home/avogar/tmp/master/clickhouse
23. /build/build_docker/../src/Common/ThreadPool.h:193: ThreadFromGlobalPoolImpl<false>::ThreadFromGlobalPoolImpl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&)::'lambda'()::operator()() in /home/avogar/tmp/master/clickhouse
24. /build/build_docker/../contrib/libcxx/include/type_traits:3640: decltype(static_cast<void>(fp)()) std::__1::__invoke<ThreadFromGlobalPoolImpl<false>::ThreadFromGlobalPoolImpl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&)::'lambda'()&>(void&&) in /home/avogar/tmp/master/clickhouse
25. /build/build_docker/../contrib/libcxx/include/__functional/invoke.h:62: void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPoolImpl<false>::ThreadFromGlobalPoolImpl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<false>::ThreadFromGlobalPoolImpl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&)::'lambda'()&) in /home/avogar/tmp/master/clickhouse
26. /build/build_docker/../contrib/libcxx/include/__functional/function.h:230: std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<false>::ThreadFromGlobalPoolImpl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&)::'lambda'(), void ()>::operator()() in /home/avogar/tmp/master/clickhouse
27. /build/build_docker/../contrib/libcxx/include/__functional/function.h:711: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<false>::ThreadFromGlobalPoolImpl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false> >::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()>(void&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) in /home/avogar/tmp/master/clickhouse
28. /build/build_docker/../contrib/libcxx/include/__functional/function.h:843: std::__1::__function::__policy_func<void ()>::operator()() const in /home/avogar/tmp/master/clickhouse
29. /build/build_docker/../contrib/libcxx/include/__functional/function.h:1184: std::__1::function<void ()>::operator()() const in /home/avogar/tmp/master/clickhouse
30. /build/build_docker/../src/Common/ThreadPool.cpp:294: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) in /home/avogar/tmp/master/clickhouse
31. /build/build_docker/../src/Common/ThreadPool.cpp:144: void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()::operator()() const in /home/avogar/tmp/master/clickhouse
 (version 22.10.1.1 (official build))
2022.09.26 11:58:25.188530 [ 3524981 ] {} <Error> default.test_02381_compact (cf52633f-7231-464c-af93-8b1c17cb778d): Detaching broken part ./store/cf5/cf52633f-7231-464c-af93-8b1c17cb778d/all_2_2_0 (size: 515.00 B). If it happened after update, it is likely because of backward incompatibility. You need to resolve this manually
2022.09.26 11:58:25.188711 [ 3524920 ] {} <Error> default.test_02381_compact (cf52633f-7231-464c-af93-8b1c17cb778d): Detaching broken part ./store/cf5/cf52633f-7231-464c-af93-8b1c17cb778d/all_1_2_1 (size: 518.00 B). If it happened after update, it is likely because of backward incompatibility. You need to resolve this manually
2022.09.26 11:58:25.189900 [ 3524962 ] {} <Debug> default.test_02381_compact (cf52633f-7231-464c-af93-8b1c17cb778d): Loaded data parts (1 items)
```

Server version 22.10.1 revision 54460.
std::string file_path = "count.txt";
            if (!data_part_storage->exists(file_path) || data_part_storage->getFileSize(file_path) == 0)
                throw Exception(
                    ErrorCodes::BAD_SIZE_OF_FILE_IN_DATA_PART,
                    "Part {} is broken: {} is empty",
                    data_part_storage->getRelativePath(),
                    std::string(fs::path(data_part_storage->getFullPath()) / file_path));
        }
        
        if (data_part_storage->exists(mrk_file_name))
        {
            UInt64 file_size = data_part_storage->getFileSize(mrk_file_name);
             if (!file_size)
                throw Exception(
                    ErrorCodes::BAD_SIZE_OF_FILE_IN_DATA_PART,
                    "Part {} is broken: {} is empty.",
                    data_part_storage->getRelativePath(),
                    std::string(fs::path(data_part_storage->getFullPath()) / mrk_file_name));
            UInt64 expected_file_size = index_granularity_info.getMarkSizeInBytes(columns.size()) * index_granularity.getMarksCount();
            if (expected_file_size != file_size)
                throw Exception(
                    ErrorCodes::BAD_SIZE_OF_FILE_IN_DATA_PART,
                    "Part {} is broken: bad size of marks file '{}': {}, must be: {}",
                    data_part_storage->getRelativePath(),
                    std::string(fs::path(data_part_storage->getFullPath()) / mrk_file_name),
                    std::to_string(file_size), std::to_string(expected_file_size));
        }
    }
}
bool MergeTreeDataPartCompact::isStoredOnRemoteDisk() const