Skip to content

Commit

Permalink
fix(bulkload) Follow acelyc111's advice, remove get_f_meta variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
lupengfan1 committed Jul 25, 2024
1 parent acf7dec commit fdd04eb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/replica/bulk_load/replica_bulk_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,18 +543,14 @@ void replica_bulk_loader::download_sst_file(const std::string &remote_dir,
return;
}
file_meta f_meta;
bool get_f_meta = true;
{
zauto_read_lock l(_lock);
if (file_index < _metadata.files.size()) {
f_meta = _metadata.files[file_index];
} else {
get_f_meta = false;
}
}
if (!get_f_meta) {
LOG_WARNING_PREFIX("sst file index {} exceeds number of bulkload sst files, Cancel "
"download_sst_file task.",
if (f_meta.name.empty()) {
LOG_WARNING_PREFIX("Cannot get file_meta of {}, cancel download_sst_file task.",
file_index);
return;
}
Expand Down Expand Up @@ -613,16 +609,13 @@ 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
get_f_meta = true;
{
zauto_read_lock l(_lock);
if (file_index + 1 < _metadata.files.size()) {
f_meta = _metadata.files[file_index + 1];
} else {
get_f_meta = false;
}
}
if (get_f_meta) {
if (!f_meta.name.empty()) {
_download_files_task[f_meta.name] =
tasking::enqueue(LPC_BACKGROUND_BULK_LOAD,
tracker(),
Expand Down

0 comments on commit fdd04eb

Please sign in to comment.