**Describe the unexpected behaviour**
An update fails after materialize index is called for wide part on CH 22.3.9, but works fine on master [master just create hard link for the skipping index, no recalculated on updated column, not correct too]. 
Should we fix this issue on 22.3-lts? 

**How to reproduce**
drop table if exists t_light;

create table t_light(a int, b int, c int, index i_c(b) type minmax granularity 4) engine = MergeTree order by a settings min_bytes_for_wide_part=0;
INSERT INTO t_light SELECT number, number, number FROM numbers(10);

set mutations_sync=1;

alter table t_light MATERIALIZE INDEX i_c;  <<< materialize index i_c on column b.
alter table t_light update b=-1 where a<3;  <<< index i_c should be recalculated.

* Which ClickHouse server version to use
ck 22.3.9

**Expected behavior**
The alter table ... update runs successfully.

**Error message and/or stacktrace**
Received exception from server (version 22.3.9):
Code: 341. DB::Exception: Received from localhost:9000. DB::Exception: Exception happened during execution of mutation 'mutation_3.txt' with part 'all_1_1_0_2' reason: 'Code: 76. DB::ErrnoException: Cannot open file /var/lib/clickhouse/store/4c1/4c15a019-28b1-4776-8e92-401f54b2bcad/tmp_mut_all_1_1_0_3/skp_idx_i_c.idx2, errno: 13, strerror: Permission denied. (CANNOT_OPEN_FILE) (version 22.3.9.19 (official build))'. This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query. (UNFINISHED)

== stacktrace ===
2022.08.04 18:37:21.657377 [ 121652 ] {4c15a019-28b1-4776-8e92-401f54b2bcad::all_1_1_0_3} <Error> virtual bool DB::MutatePlainMergeTreeTask::executeStep(): Code: 76. DB::ErrnoException: Cannot open file /var/lib/clickhouse/store/4c1/4c15a019-28b1-4776-8e92-401f54b2bcad/tmp_mut_all_1_1_0_3/skp_idx_i_c.idx2, errno: 13, strerror: Permission denied. (CANNOT_OPEN_FILE), 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) @ 0xb3744fa in /usr/bin/clickhouse
1. DB::throwFromErrnoWithPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int) @ 0xb3758ea in /usr/bin/clickhouse
2. DB::WriteBufferFromFile::WriteBufferFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, int, unsigned int, char*, unsigned long) @ 0xb4abc1a in /usr/bin/clickhouse
3. DB::DiskLocal::writeFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, DB::WriteMode) @ 0x1534abf7 in /usr/bin/clickhouse
4. DB::MergeTreeDataPartWriterOnDisk::Stream::Stream(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IDisk>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::ICompressionCodec> const&, unsigned long) @ 0x16392a23 in /usr/bin/clickhouse
5. DB::MergeTreeDataPartWriterOnDisk::initSkipIndices() @ 0x16393d93 in /usr/bin/clickhouse
6. DB::MergeTreeDataPartWriterOnDisk::MergeTreeDataPartWriterOnDisk(std::__1::shared_ptr<DB::IMergeTreeDataPart const> const&, DB::NamesAndTypesList const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeIndex const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeIndex const> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::ICompressionCodec> const&, DB::MergeTreeWriterSettings const&, DB::MergeTreeIndexGranularity const&) @ 0x1639346a in /usr/bin/clickhouse
7. DB::MergeTreeDataPartWriterWide::MergeTreeDataPartWriterWide(std::__1::shared_ptr<DB::IMergeTreeDataPart const> const&, DB::NamesAndTypesList const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeIndex const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeIndex const> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::ICompressionCodec> const&, DB::MergeTreeWriterSettings const&, DB::MergeTreeIndexGranularity const&) @ 0x163961af in /usr/bin/clickhouse
8. DB::MergeTreeDataPartWide::getWriter(DB::NamesAndTypesList const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeIndex const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeIndex const> > > const&, std::__1::shared_ptr<DB::ICompressionCodec> const&, DB::MergeTreeWriterSettings const&, DB::MergeTreeIndexGranularity const&) const @ 0x16386a82 in /usr/bin/clickhouse
9. DB::MergedColumnOnlyOutputStream::MergedColumnOnlyOutputStream(std::__1::shared_ptr<DB::IMergeTreeDataPart const> const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::Block const&, std::__1::shared_ptr<DB::ICompressionCodec>, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeIndex const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeIndex const> > > const&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*, DB::MergeTreeIndexGranularity const&, DB::MergeTreeIndexGranularityInfo const*) @ 0x164729cd in /usr/bin/clickhouse
10. void std::__1::allocator_traits<std::__1::allocator<DB::MergedColumnOnlyOutputStream> >::__construct<DB::MergedColumnOnlyOutputStream, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const>&, DB::Block&, std::__1::shared_ptr<DB::ICompressionCodec>&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeIndex const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeIndex const> > >, std::nullptr_t, DB::MergeTreeIndexGranularity const&, DB::MergeTreeIndexGranularityInfo const*>(std::__1::integral_constant<bool, true>, std::__1::allocator<DB::MergedColumnOnlyOutputStream>&, DB::MergedColumnOnlyOutputStream*, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const>&, DB::Block&, std::__1::shared_ptr<DB::ICompressionCodec>&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeIndex const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeIndex const> > >&&, std::nullptr_t&&, DB::MergeTreeIndexGranularity const&, DB::MergeTreeIndexGranularityInfo const*&&) @ 0x16491d01 in /usr/bin/clickhouse
11. DB::MutateSomePartColumnsTask::prepare() @ 0x164904b5 in /usr/bin/clickhouse
12. DB::MutateSomePartColumnsTask::executeStep() @ 0x1648f05f in /usr/bin/clickhouse
13. DB::MutatePlainMergeTreeTask::executeStep() @ 0x16478f35 in /usr/bin/clickhouse
14. DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::routine(std::__1::shared_ptr<DB::TaskRuntimeData>) @ 0xb34b7ab in /usr/bin/clickhouse
15. DB::MergeTreeBackgroundExecutor<DB::MergeMutateRuntimeQueue>::threadFunction() @ 0xb34b3f9 in /usr/bin/clickhouse
16. ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) @ 0xb41beca in /usr/bin/clickhouse
17. ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&, void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()&&...)::'lambda'()::operator()() @ 0xb41e064 in /usr/bin/clickhouse


{
        auto & current_level_parts = level_parts[current_level];
        auto & next_level_parts = level_parts[next_level];
        MergeTreeData::MutableDataPartsVector selected_parts;
        while (selected_parts.size() < max_parts_to_merge_in_one_level && !current_level_parts.empty())
        {
            selected_parts.push_back(std::move(current_level_parts.back()));
            current_level_parts.pop_back();
        }
        if (selected_parts.empty())
        {
            if (next_level_parts.empty())
            {
                LOG_WARNING(log, "There is no projection parts merged");
                
                return false;
            }
            current_level = next_level;
            ++next_level;
        }
        else if (selected_parts.size() == 1)
        {
            if (next_level_parts.empty())
            {
                LOG_DEBUG(log, "Merged a projection part in level {}", current_level);
                auto builder = selected_parts[0]->data_part_storage->getBuilder();
                selected_parts[0]->renameTo(projection.name + ".proj", true, builder);
                selected_parts[0]->name = projection.name;
                selected_parts[0]->is_temp = false;
                builder->commit();