In class IDiskRemote, all metadata file system operations use os file system api directly.
There is little extendiability if we want store the metadata of HDFS or S3 into distributed file system.
So I suggest change this way by using DiskPtr and will propose a pull request.

In addition, metadata of HDFS or S3 only store local FS which is not sharable.

{
    auto settings = current_settings.get();
    WriteBufferFromS3 buffer(
        settings->client,
        bucket,
        remote_fs_root_path + SCHEMA_VERSION_OBJECT,
        settings->s3_min_upload_part_size,
        settings->s3_max_single_part_upload_size);
    writeIntText(version, buffer);
    buffer.finalize();
}
void DiskS3::updateObjectMetadata(const String & key, const ObjectMetadata & metadata)
{
    copyObjectImpl(bucket, key, bucket, key, std::nullopt, metadata);
}
void DiskS3::migrateFileToRestorableSchema(const String & path)
{
    LOG_TRACE(log, "Migrate file {} to restorable schema", metadata_path + path);
    auto meta = readMeta(path);
    for (const auto & [key, _] : meta.remote_fs_objects)
    {
        ObjectMetadata metadata {
            {"path", path}
        };
        updateObjectMetadata(remote_fs_root_path + key, metadata);
    }
}
void DiskS3::migrateToRestorableSchemaRecursive(const String & path, Futures & results)