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

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 30175010c7 Fix nullptr in perform_remote_tablet_gc (#11820)
30175010c7 is described below

commit 30175010c78bd3c622f58a8c4f7f8e0c73c3db2e
Author: plat1ko <platonekos...@gmail.com>
AuthorDate: Tue Aug 16 16:50:21 2022 +0800

    Fix nullptr in perform_remote_tablet_gc (#11820)
---
 be/src/olap/data_dir.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/data_dir.cpp b/be/src/olap/data_dir.cpp
index 6d67cab4f4..f9ab6eabdf 100644
--- a/be/src/olap/data_dir.cpp
+++ b/be/src/olap/data_dir.cpp
@@ -871,11 +871,16 @@ void DataDir::perform_remote_tablet_gc() {
     for (auto& [key, resource] : tablet_gc_kvs) {
         auto tablet_id = key.substr(REMOTE_TABLET_GC_PREFIX.size());
         auto fs = io::FileSystemMap::instance()->get(resource);
-        auto st = fs->delete_directory(DATA_PREFIX + "/" + tablet_id);
+        if (!fs) {
+            LOG(WARNING) << "could not get file system. resource_id=" << 
resource;
+            continue;
+        }
+        auto st = fs->delete_directory(DATA_PREFIX + '/' + tablet_id);
         if (st.ok()) {
             deleted_keys.push_back(std::move(key));
         } else {
-            LOG(WARNING) << st;
+            LOG(WARNING) << "failed to perform remote tablet gc. tablet_id=" 
<< tablet_id
+                         << ", reason: " << st;
         }
     }
     for (const auto& key : deleted_keys) {


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

Reply via email to