branch-2.1: [fix](clone) Fix the skipped link file due to the stale value #46009 (#46068)

Cherry-picked from #46009

Co-authored-by: walter <maochuan@selectdb.com>
This commit is contained in:
github-actions[bot]
2024-12-27 16:30:16 +08:00
committed by GitHub
parent dd916c0626
commit d2aa890887

View File

@ -702,8 +702,6 @@ Status EngineCloneTask::_finish_clone(Tablet* tablet, const std::string& clone_d
/// Traverse all downloaded clone files in CLONE dir.
/// If it does not exist in local tablet dir, link the file to local tablet dir
/// And save all linked files in linked_success_files.
/// if binlog exist in clone dir and md5sum equal, then skip link file
bool skip_link_file = false;
for (const string& clone_file : clone_file_names) {
if (local_file_names.find(clone_file) != local_file_names.end()) {
VLOG_NOTICE << "find same file when clone, skip it. "
@ -711,6 +709,8 @@ Status EngineCloneTask::_finish_clone(Tablet* tablet, const std::string& clone_d
continue;
}
/// if binlog exist in clone dir and md5sum equal, then skip link file
bool skip_link_file = false;
std::string to;
if (clone_file.ends_with(".binlog") || clone_file.ends_with(".binlog-index")) {
if (!contain_binlog) {