Skip to content

Commit 41739da

Browse files
author
lupengfan1
committed
fix(bulkload) Follow acelyc111's advice, remove get_f_meta variable.
1 parent acf7dec commit 41739da

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/replica/bulk_load/replica_bulk_loader.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -543,19 +543,14 @@ void replica_bulk_loader::download_sst_file(const std::string &remote_dir,
543543
return;
544544
}
545545
file_meta f_meta;
546-
bool get_f_meta = true;
547546
{
548547
zauto_read_lock l(_lock);
549548
if (file_index < _metadata.files.size()) {
550549
f_meta = _metadata.files[file_index];
551-
} else {
552-
get_f_meta = false;
553550
}
554551
}
555-
if (!get_f_meta) {
556-
LOG_WARNING_PREFIX("sst file index {} exceeds number of bulkload sst files, Cancel "
557-
"download_sst_file task.",
558-
file_index);
552+
if (f_meta.name.empty()) {
553+
LOG_WARNING_PREFIX("Cannot get file_meta of {}, cancel download_sst_file task.", file_index);
559554
return;
560555
}
561556
uint64_t f_size = 0;
@@ -613,16 +608,13 @@ void replica_bulk_loader::download_sst_file(const std::string &remote_dir,
613608
METRIC_VAR_INCREMENT_BY(bulk_load_download_file_bytes, f_size);
614609

615610
// download next file
616-
get_f_meta = true;
617611
{
618612
zauto_read_lock l(_lock);
619613
if (file_index + 1 < _metadata.files.size()) {
620614
f_meta = _metadata.files[file_index + 1];
621-
} else {
622-
get_f_meta = false;
623615
}
624616
}
625-
if (get_f_meta) {
617+
if (!f_meta.name.empty()) {
626618
_download_files_task[f_meta.name] =
627619
tasking::enqueue(LPC_BACKGROUND_BULK_LOAD,
628620
tracker(),

0 commit comments

Comments
 (0)