This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 1e336ed7ea8 [fix](restore) avoid change the hard link files of a 
snapshot (#50753)
1e336ed7ea8 is described below

commit 1e336ed7ea81235bed2289b5a08b9aa26d41f419
Author: walter <maoch...@selectdb.com>
AuthorDate: Sat May 10 08:27:46 2025 +0800

    [fix](restore) avoid change the hard link files of a snapshot (#50753)
---
 be/src/runtime/snapshot_loader.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/be/src/runtime/snapshot_loader.cpp 
b/be/src/runtime/snapshot_loader.cpp
index 2a4860ba9c1..0985ff3d9b4 100644
--- a/be/src/runtime/snapshot_loader.cpp
+++ b/be/src/runtime/snapshot_loader.cpp
@@ -472,11 +472,13 @@ Status SnapshotLoader::remote_http_download(
                                        ec.message());
             }
             std::string md5;
-            auto status = 
io::global_local_filesystem()->md5sum(local_file_path, &md5);
-            if (!status.ok()) {
-                LOG(WARNING) << "download file error, local file " << 
local_file_path
-                             << " md5sum: " << status.to_string();
-                return status;
+            if (config::enable_download_md5sum_check) {
+                auto status = 
io::global_local_filesystem()->md5sum(local_file_path, &md5);
+                if (!status.ok()) {
+                    LOG(WARNING) << "download file error, local file " << 
local_file_path
+                                 << " md5sum: " << status.to_string();
+                    return status;
+                }
             }
             local_files[local_file] = {local_file_size, md5};
         }
@@ -565,7 +567,9 @@ Status SnapshotLoader::remote_http_download(
                 continue;
             }
 
-            if (auto& local_filestat = it->second; local_filestat.md5 != 
remote_filestat.md5) {
+            if (auto& local_filestat = it->second;
+                !remote_filestat.md5.empty() && // compatible with old version
+                local_filestat.md5 != remote_filestat.md5) {
                 need_download_files.emplace_back(remote_file);
                 continue;
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to