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. 

{
        if (done)
            return;
        data_out->next();
        data_out_compressed->next();
        data_out_compressed->finalize();
        
        storage.saveIndices(lock);
        
        storage.saveFileSizes(lock);
        storage.updateTotalRows(lock);
        done = true;
        
        
        
        lock.unlock();
    }
private:
    StorageStripeLog & storage;
    StorageMetadataPtr metadata_snapshot;
    WriteLock lock;
    std::unique_ptr<WriteBuffer> data_out_compressed;
    std::unique_ptr<CompressedWriteBuffer> data_out;
    std::unique_ptr<NativeWriter> block_out;
    bool done = false;
};
StorageStripeLog::StorageStripeLog(