You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by kx...@apache.org on 2023/06/27 16:50:33 UTC

[doris] 01/05: [Fix](invert index)fix s3 failed to check the directory (#21232)

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

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

commit 650322f33d0362244d3060914597fb00e2f57bc9
Author: zzzxl <33...@users.noreply.github.com>
AuthorDate: Tue Jun 27 20:01:46 2023 +0800

    [Fix](invert index)fix s3 failed to check the directory (#21232)
---
 .../olap/rowset/segment_v2/inverted_index_compound_directory.cpp   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp
index be19be580a..83660cca66 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp
@@ -467,7 +467,6 @@ void DorisCompoundDirectory::init(const io::FileSystemSPtr& _fs, const char* _pa
 
     if (lock_factory == nullptr) {
         lock_factory = _CLNEW lucene::store::NoLockFactory();
-        fs->create_directory(directory);
     }
 
     setLockFactory(lock_factory);
@@ -476,6 +475,10 @@ void DorisCompoundDirectory::init(const io::FileSystemSPtr& _fs, const char* _pa
         lockFactory->setLockPrefix(nullptr);
     }
 
+    // It's fail checking directory existence in S3.
+    if (fs->type() == io::FileSystemType::S3) {
+        return;
+    }
     bool exists = false;
     Status status = fs->exists(directory, &exists);
     if (!status.ok()) {
@@ -579,7 +582,7 @@ DorisCompoundDirectory* DorisCompoundDirectory::getDirectory(
     bool exists = false;
     _fs->exists(file, &exists);
     if (!exists) {
-        mkdir(file, 0777);
+        _fs->create_directory(file);
     }
 
     dir = _CLNEW DorisCompoundDirectory();


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