@@ -102,7 +102,7 @@ namespace
102102 {
103103 BackupFileInfos file_infos;
104104
105- static String serialize (const BackupFileInfos & file_infos_, bool is_lightweight_snapshot )
105+ static String serialize (const BackupFileInfos & file_infos_)
106106 {
107107 WriteBufferFromOwnString out;
108108 writeBinary (file_infos_.size (), out);
@@ -115,17 +115,13 @@ namespace
115115 writeBinary (info.base_checksum , out);
116116 writeBinary (info.encrypted_by_disk , out);
117117 writeBinary (info.reference_target , out);
118- if (is_lightweight_snapshot)
119- {
120- writeBinary (info.object_key , out);
121- }
122118 // / We don't store `info.data_file_name` and `info.data_file_index` because they're determined automalically
123119 // / after reading file infos for all the hosts (see the class BackupCoordinationFileInfos).
124120 }
125121 return out.str ();
126122 }
127123
128- static FileInfos deserialize (const String & str, bool is_lightweight_snapshot )
124+ static FileInfos deserialize (const String & str)
129125 {
130126 ReadBufferFromString in{str};
131127 FileInfos res;
@@ -142,10 +138,6 @@ namespace
142138 readBinary (info.base_checksum , in);
143139 readBinary (info.encrypted_by_disk , in);
144140 readBinary (info.reference_target , in);
145- if (is_lightweight_snapshot)
146- {
147- readBinary (info.object_key , in);
148- }
149141 }
150142 return res;
151143 }
@@ -172,7 +164,6 @@ size_t BackupCoordinationOnCluster::findCurrentHostIndex(const String & current_
172164BackupCoordinationOnCluster::BackupCoordinationOnCluster (
173165 const UUID & backup_uuid_,
174166 bool is_plain_backup_,
175- bool is_lightweight_snapshot_,
176167 const String & root_zookeeper_path_,
177168 zkutil::GetZooKeeper get_zookeeper_,
178169 const BackupKeeperSettings & keeper_settings_,
@@ -191,7 +182,6 @@ BackupCoordinationOnCluster::BackupCoordinationOnCluster(
191182 , current_host(current_host_)
192183 , current_host_index(findCurrentHostIndex(current_host, all_hosts))
193184 , plain_backup(is_plain_backup_)
194- , lightweight_snapshot(is_lightweight_snapshot_)
195185 , process_list_element(process_list_element_)
196186 , log(getLogger(" BackupCoordinationOnCluster" ))
197187 , with_retries(log, get_zookeeper_, keeper_settings, process_list_element_, [root_zookeeper_path_](Coordination::ZooKeeperWithFaultInjection::Ptr zk) { zk->sync (root_zookeeper_path_); })
@@ -759,7 +749,7 @@ void BackupCoordinationOnCluster::addFileInfos(BackupFileInfos && file_infos_)
759749 }
760750
761751 // / Serialize `file_infos_` and write it to ZooKeeper's nodes.
762- String file_infos_str = FileInfos::serialize (file_infos_, lightweight_snapshot );
752+ String file_infos_str = FileInfos::serialize (file_infos_);
763753 serializeToMultipleZooKeeperNodes (zookeeper_path + " /file_infos/" + current_host, file_infos_str, " addFileInfos" );
764754}
765755
@@ -798,7 +788,7 @@ void BackupCoordinationOnCluster::prepareFileInfos() const
798788 for (const String & host : hosts_with_file_infos)
799789 {
800790 String file_infos_str = deserializeFromMultipleZooKeeperNodes (zookeeper_path + " /file_infos/" + host, " prepareFileInfos" );
801- auto deserialized_file_infos = FileInfos::deserialize (file_infos_str, lightweight_snapshot ).file_infos ;
791+ auto deserialized_file_infos = FileInfos::deserialize (file_infos_str).file_infos ;
802792 file_infos->addFileInfos (std::move (deserialized_file_infos), host);
803793 }
804794}
0 commit comments