diff --git a/src/Storages/MergeTree/DataPartStorageOnDisk.cpp b/src/Storages/MergeTree/DataPartStorageOnDisk.cpp index e0a062e2407..aaef512ccf1 100644 --- a/src/Storages/MergeTree/DataPartStorageOnDisk.cpp +++ b/src/Storages/MergeTree/DataPartStorageOnDisk.cpp @@ -732,13 +732,14 @@ DataPartStoragePtr DataPartStorageOnDisk::freeze( const std::string & dir_path, bool make_source_readonly, std::function save_metadata_callback, - const NameSet & files_to_copy_instead_of_hardlinks, - bool copy_instead_of_hardlink) const + bool copy_instead_of_hardlink, + const NameSet & files_to_copy_instead_of_hardlinks) const + { auto disk = volume->getDisk(); disk->createDirectories(to); - localBackup(disk, getRelativePath(), fs::path(to) / dir_path, make_source_readonly, {}, files_to_copy_instead_of_hardlinks, copy_instead_of_hardlink); + localBackup(disk, getRelativePath(), fs::path(to) / dir_path, make_source_readonly, {}, copy_instead_of_hardlink, files_to_copy_instead_of_hardlinks); if (save_metadata_callback) save_metadata_callback(disk); diff --git a/src/Storages/MergeTree/DataPartStorageOnDisk.h b/src/Storages/MergeTree/DataPartStorageOnDisk.h index 80a235f0756..adf1b78cdfb 100644 --- a/src/Storages/MergeTree/DataPartStorageOnDisk.h +++ b/src/Storages/MergeTree/DataPartStorageOnDisk.h @@ -100,8 +100,8 @@ public: const std::string & dir_path, bool make_source_readonly, std::function save_metadata_callback, - const NameSet & files_to_copy_instead_of_hardlinks, - bool copy_instead_of_hardlink) const override; + bool copy_instead_of_hardlink, + const NameSet & files_to_copy_instead_of_hardlinks) const override; DataPartStoragePtr clone( const std::string & to, diff --git a/src/Storages/MergeTree/IDataPartStorage.h b/src/Storages/MergeTree/IDataPartStorage.h index 896990ece90..59445e0e672 100644 --- a/src/Storages/MergeTree/IDataPartStorage.h +++ b/src/Storages/MergeTree/IDataPartStorage.h @@ -197,8 +197,8 @@ public: const std::string & dir_path, bool make_source_readonly, std::function save_metadata_callback, - const NameSet & files_to_copy_instead_of_hardlinks, - bool copy_instead_of_hardlink) const = 0; + bool copy_instead_of_hardlink, + const NameSet & files_to_copy_instead_of_hardlinks) const = 0; /// Make a full copy of a data part into 'to/dir_path' (possibly to a different disk). virtual std::shared_ptr clone( diff --git a/src/Storages/MergeTree/IMergeTreeDataPart.cpp b/src/Storages/MergeTree/IMergeTreeDataPart.cpp index 2e512cf18b7..3ff17b2c6e7 100644 --- a/src/Storages/MergeTree/IMergeTreeDataPart.cpp +++ b/src/Storages/MergeTree/IMergeTreeDataPart.cpp @@ -1523,8 +1523,8 @@ void IMergeTreeDataPart::makeCloneInDetached(const String & prefix, const Storag getRelativePathForDetachedPart(prefix), /*make_source_readonly*/ true, {}, - {}, - copy_instead_of_hardlink); + copy_instead_of_hardlink, + {}); } DataPartStoragePtr IMergeTreeDataPart::makeCloneOnDisk(const DiskPtr & disk, const String & directory_name) const diff --git a/src/Storages/MergeTree/MergeTreeData.cpp b/src/Storages/MergeTree/MergeTreeData.cpp index a771207ab0b..0e62ca16cb9 100644 --- a/src/Storages/MergeTree/MergeTreeData.cpp +++ b/src/Storages/MergeTree/MergeTreeData.cpp @@ -6205,7 +6205,7 @@ std::pair MergeTreeData::cloneAn std::string(fs::path(src_part_storage->getFullRootPath()) / tmp_dst_part_name), with_copy); - auto dst_part_storage = src_part_storage->freeze(relative_data_path, tmp_dst_part_name, /* make_source_readonly */ false, {}, files_to_copy_instead_of_hardlinks, copy_instead_of_hardlink); + auto dst_part_storage = src_part_storage->freeze(relative_data_path, tmp_dst_part_name, /* make_source_readonly */ false, {}, copy_instead_of_hardlink, files_to_copy_instead_of_hardlinks); auto dst_data_part = createPart(dst_part_name, dst_part_info, dst_part_storage); @@ -6393,8 +6393,8 @@ PartitionCommandsResultInfo MergeTreeData::freezePartitionsByMatcher( part->data_part_storage->getPartDirectory(), /*make_source_readonly*/ true, callback, - {}, - /*copy_instead_of_hardlink*/ false); + /*copy_instead_of_hardlink*/ false, + {}); part->is_frozen.store(true, std::memory_order_relaxed); result.push_back(PartitionCommandResultInfo{ diff --git a/src/Storages/MergeTree/localBackup.cpp b/src/Storages/MergeTree/localBackup.cpp index bcd69743d81..3559eff1f6b 100644 --- a/src/Storages/MergeTree/localBackup.cpp +++ b/src/Storages/MergeTree/localBackup.cpp @@ -89,7 +89,7 @@ private: void localBackup( const DiskPtr & disk, const String & source_path, const String & destination_path, bool make_source_readonly, - std::optional max_level, const NameSet & files_to_copy_intead_of_hardlinks, bool copy_instead_of_hardlinks) + std::optional max_level, bool copy_instead_of_hardlinks, const NameSet & files_to_copy_intead_of_hardlinks) { if (disk->exists(destination_path) && !disk->isDirectoryEmpty(destination_path)) { diff --git a/src/Storages/MergeTree/localBackup.h b/src/Storages/MergeTree/localBackup.h index f32caf347de..74b188daff6 100644 --- a/src/Storages/MergeTree/localBackup.h +++ b/src/Storages/MergeTree/localBackup.h @@ -20,6 +20,6 @@ namespace DB * If max_level is specified, than only files which depth relative source_path less or equal max_level will be copied. * So, if max_level=0 than only direct file child are copied. */ - void localBackup(const DiskPtr & disk, const String & source_path, const String & destination_path, bool make_source_readonly = true, std::optional max_level = {}, const NameSet & files_to_copy_intead_of_hardlinks = {}, bool copy_instead_of_hardlinks = false); + void localBackup(const DiskPtr & disk, const String & source_path, const String & destination_path, bool make_source_readonly = true, std::optional max_level = {}, bool copy_instead_of_hardlinks = false, const NameSet & files_to_copy_intead_of_hardlinks = {}); }