ruojieranyishen commented on code in PR #2077:
URL:
https://github.com/apache/incubator-pegasus/pull/2077#discussion_r1774325029
##########
src/replica/bulk_load/replica_bulk_loader.cpp:
##########
@@ -519,22 +521,34 @@ void replica_bulk_loader::download_files(const
std::string &provider_name,
}
// download sst files asynchronously
- if (!_metadata.files.empty()) {
- const file_meta &f_meta = _metadata.files[0];
- _download_files_task[f_meta.name] = tasking::enqueue(
- LPC_BACKGROUND_BULK_LOAD,
- tracker(),
- std::bind(&replica_bulk_loader::download_sst_file, this,
remote_dir, local_dir, 0, fs));
+ std::vector<::dsn::replication::file_meta> download_file_metas;
+ {
+ zauto_read_lock l(_lock);
+ std::copy(_metadata.files.begin(),
+ _metadata.files.end(),
+ std::back_inserter(download_file_metas));
Review Comment:
Thank you for your prompt reply, `_metadata.files` cannot pop element,
because `replica_bulk_loader::report_bulk_load_states_to_meta` will send it to
meta server and update zookeeper.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]