xiaokang commented on code in PR #20970:
URL: https://github.com/apache/doris/pull/20970#discussion_r1233581289


##########
be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:
##########
@@ -133,12 +133,18 @@ class InvertedIndexColumnWriterImpl : public 
InvertedIndexColumnWriter {
                 _directory + "/" + _segment_file_name, 
_index_meta->index_id());
 
         // LOG(INFO) << "inverted index path: " << index_path;
-
-        if (lucene::index::IndexReader::indexExists(index_path.c_str())) {
-            create = false;
-            if (lucene::index::IndexReader::isLocked(index_path.c_str())) {
-                LOG(WARNING) << ("Lucene Index was locked... unlocking it.\n");
-                lucene::index::IndexReader::unlock(index_path.c_str());
+        bool exists = false;
+        auto st = _fs->exists(index_path.c_str(), &exists);
+        if (!st.ok()) {
+            LOG(ERROR) << "index_path:"
+                       << " exists error:" << st;
+            return st;
+        }
+        if (exists) {
+            st = _fs->delete_directory(index_path.c_str());

Review Comment:
   can just return error Status



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to