imay commented on a change in pull request #1193: Fix bug that restore process 
in BE causes BE crash 
URL: https://github.com/apache/incubator-doris/pull/1193#discussion_r286845898
 
 

 ##########
 File path: be/src/runtime/snapshot_loader.cpp
 ##########
 @@ -538,6 +539,18 @@ Status SnapshotLoader::move(
         std::vector<std::string> snapshot_files;
         RETURN_IF_ERROR(_get_existing_files_from_local(snapshot_path, 
&snapshot_files));
 
+        // 0. check all existing tablet files, revoke file if it is in GC queue
+        std::vector<std::string> tablet_files;
+        RETURN_IF_ERROR(_get_existing_files_from_local(tablet_path, 
&tablet_files));
+        std::vector<std::string> files_to_check;
+        for (auto& snapshot_file : snapshot_files) {
+            if (std::find(tablet_files.begin(), tablet_files.end(), 
snapshot_file) != tablet_files.end()) {
+                std::string file_path = tablet_path + "/" + snapshot_file;
+                files_to_check.push_back(file_path);
 
 Review comment:
   ```suggestion
                   files_to_check.emplace_back(std::move(file_path));
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to