Ordinary database engine is deprecated but there is no simple mean to change database engine to Atomic for existing databases.

Possible options:
- ALTER DATABASE MODIFY ENGINE query.
- Flag that triggers migration at ClickHouse startup.

The latter should be easier to implement. 

{
    auto zookeeper = getZooKeeper();
    
    
    
    auto broken_part_info = MergeTreePartInfo::fromPartName(part_name, format_version);
    auto partition_range = getVisibleDataPartsVectorInPartition(getContext(), broken_part_info.partition_id);
    for (const auto & part : partition_range)
    {
        if (!broken_part_info.contains(part->info))
            continue;
        
        assert(broken_part_info != part->info);
        part->makeCloneInDetached("covered-by-broken", getInMemoryMetadataPtr());
    }
    
    
    
    
    
    
    
    
    
    
    queue.removePartProducingOpsInRange(zookeeper, broken_part_info, {});