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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4678ec8  Delete unused log (#1957)
4678ec8 is described below

commit 4678ec8dd939aca10301ff4879edd5399cd11213
Author: kangpinghuang <kangpinghu...@126.com>
AuthorDate: Fri Oct 11 23:12:38 2019 +0800

    Delete unused log (#1957)
---
 be/src/olap/rowset/segment_group.cpp | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/be/src/olap/rowset/segment_group.cpp 
b/be/src/olap/rowset/segment_group.cpp
index 1a7f44a..3786aea 100644
--- a/be/src/olap/rowset/segment_group.cpp
+++ b/be/src/olap/rowset/segment_group.cpp
@@ -217,18 +217,24 @@ bool SegmentGroup::delete_all_files() {
 
         LOG(INFO) << "delete index file. path=" << index_path;
         if (remove(index_path.c_str()) != 0) {
-            char errmsg[64];
-            LOG(WARNING) << "fail to delete index file. err=" << 
strerror_r(errno, errmsg, 64)
-                         << ", path=" << index_path;
-            success = false;
+            // if the errno is not ENOENT, log the error msg.
+            // ENOENT stands for 'No such file or directory'
+            if (errno != ENOENT) {
+                char errmsg[64];
+                LOG(WARNING) << "fail to delete index file. err=" << 
strerror_r(errno, errmsg, 64)
+                        << ", path=" << index_path;
+                success = false;
+            }
         }
 
         LOG(INFO) << "delete data file. path=" << data_path;
         if (remove(data_path.c_str()) != 0) {
-            char errmsg[64];
-            LOG(WARNING) << "fail to delete data file. err=" << 
strerror_r(errno, errmsg, 64)
-                         << ", path=" << data_path;
-            success = false;
+            if (errno != ENOENT) {
+                char errmsg[64];
+                LOG(WARNING) << "fail to delete data file. err=" << 
strerror_r(errno, errmsg, 64)
+                        << ", path=" << data_path;
+                success = false;
+            }
         }
     }
     return success;


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

Reply via email to