more comments

This commit is contained in:
Nikita Mikhaylov 2020-03-13 19:53:32 +03:00
parent 3e394bee24
commit b6d633a09e

View File

@ -4888,7 +4888,7 @@ void StorageReplicatedMergeTree::replacePartitionFrom(const StoragePtr & source_
String hash_hex = src_part->checksums.getTotalChecksumHex();
LOG_INFO(log, "Trying to attach " << src_part->name << " with hash_hex " << hash_hex);
LOG_INFO(log, "Trying to " << (replace ? "replace " : "attach ") << src_part->name << " with hash_hex " << hash_hex);
String block_id_path = replace ? "" : (zookeeper_path + "/blocks/" + partition_id + "_replace_from_" + hash_hex);
@ -4910,8 +4910,9 @@ void StorageReplicatedMergeTree::replacePartitionFrom(const StoragePtr & source_
part_checksums.emplace_back(hash_hex);
}
/// We have nothing to do - return
if (src_parts.empty())
/// In case of ATTACH PARTITION FROM we have nothing to do - return. Because no data will be added or removed.
/// In case of REPLACE PARTITION we can replace existing partition with empty.
if (!replace && src_parts.empty())
return;
ReplicatedMergeTreeLogEntryData entry;