https://play.clickhouse.com/play?user=play#c2VsZWN0IAp0b1N0YXJ0T2ZEYXkoY2hlY2tfc3RhcnRfdGltZSkgYXMgZCwKY291bnQoKSwgIGdyb3VwVW5pcUFycmF5KHB1bGxfcmVxdWVzdF9udW1iZXIpLCAgYW55KHJlcG9ydF91cmwpCmZyb20gY2hlY2tzIHdoZXJlICcyMDIyLTA2LTAxJyA8PSBjaGVja19zdGFydF90aW1lIGFuZCB0ZXN0X25hbWUgbGlrZSAnJTAyNDgxX2FzeW5jX2luc2VydF9kZWR1cCUnIGFuZCB0ZXN0X3N0YXR1cyBpbiAoJ0ZBSUwnLCAnRkxBS1knKSBncm91cCBieSBkIG9yZGVyIGJ5IGQgZGVzYw==

Example: https://s3.amazonaws.com/clickhouse-test-reports/44202/ec09a66fbb074fcccfae4a743106d5e7c3b64e26/stateless_tests__debug__s3_storage__[3/6].html
{
    if (!delayed_chunk)
        return;
    for (auto & partition: delayed_chunk->partitions)
    {
        int retry_times = 0;
        while (true)
        {
            partition.temp_part.finalize();
            auto conflict_block_ids = commitPart(zookeeper, partition.temp_part.part, partition.block_id, delayed_chunk->replicas_num, false);
            if (conflict_block_ids.empty())
                break;
            LOG_DEBUG(log, "Found depulicate block IDs: {}, retry times {}", toString(conflict_block_ids), ++retry_times);
            
            rewriteBlock(log, partition, conflict_block_ids);
            if (partition.block_id.empty())
                break;
            partition.block_with_partition.partition = std::move(partition.temp_part.part->partition.value);
            partition.temp_part = storage.writer.writeTempPart(partition.block_with_partition, metadata_snapshot, context);
        }
    }
    delayed_chunk.reset();
}
template<bool async_insert>
void ReplicatedMergeTreeSinkImpl<async_insert>::writeExistingPart(MergeTreeData::MutableDataPartPtr & part)