acelyc111 commented on code in PR #2077:
URL:
https://github.com/apache/incubator-pegasus/pull/2077#discussion_r1706438543
##########
src/replica/bulk_load/replica_bulk_loader.cpp:
##########
@@ -609,21 +596,23 @@ void replica_bulk_loader::download_sst_file(const
std::string &remote_dir,
METRIC_VAR_INCREMENT_BY(bulk_load_download_file_bytes, f_size);
// download next file
+ file_meta next_f_meta;
{
zauto_read_lock l(_lock);
- if (file_index + 1 < _metadata.files.size()) {
- f_meta = _metadata.files[file_index + 1];
+ if (!_metadata.files.empty()) {
Review Comment:
Nowthat `_metadata` is updated here, it's needed to use "write lock", i.e.
`zauto_write_lock`.
##########
src/replica/bulk_load/replica_bulk_loader.cpp:
##########
@@ -520,38 +520,25 @@ 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];
+ const file_meta f_meta = _metadata.files.back();
Review Comment:
It's needed to protect the scope by a write lock.
--
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]