You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/11 15:16:48 UTC

[doris] branch branch-1.2-lts updated: [Fix](multi-catalog) fix hive catalog query bug when kerberos token is expired. (#18551)

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

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new 9c60bde39e [Fix](multi-catalog) fix hive catalog query bug when kerberos token is expired. (#18551)
9c60bde39e is described below

commit 9c60bde39e4cf81d121b45f5acac93913f03b0dc
Author: Xiangyu Wang <du...@gmail.com>
AuthorDate: Tue Apr 11 23:16:40 2023 +0800

    [Fix](multi-catalog) fix hive catalog query bug when kerberos token is expired. (#18551)
    
    Co-authored-by: wangxiangyu@360shuke.com <wa...@360shuke.com>
---
 be/src/io/hdfs_file_reader.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/be/src/io/hdfs_file_reader.cpp b/be/src/io/hdfs_file_reader.cpp
index ad3e3ca299..7117ec0e7c 100644
--- a/be/src/io/hdfs_file_reader.cpp
+++ b/be/src/io/hdfs_file_reader.cpp
@@ -73,7 +73,19 @@ Status HdfsFileReader::open() {
     RETURN_IF_ERROR(HdfsFsCache::instance()->get_connection(_hdfs_params, &_fs_handle));
     _hdfs_fs = _fs_handle->hdfs_fs;
     if (hdfsExists(_hdfs_fs, _path.c_str()) != 0) {
-        return Status::NotFound("{} not exists!", _path);
+        if (_fs_handle->from_cache) {
+            // hdfsFS may be disconnected if not used for a long time or kerberos token is expired
+            _fs_handle->set_invalid();
+            _fs_handle->dec_ref();
+            // retry
+            RETURN_IF_ERROR(HdfsFsCache::instance()->get_connection(_hdfs_params, &_fs_handle));
+            _hdfs_fs = _fs_handle->hdfs_fs;
+            if (hdfsExists(_hdfs_fs, _path.c_str()) != 0) {
+                return Status::NotFound("{} not exists!", _path);
+            }
+        } else {
+            return Status::NotFound("{} not exists!", _path);
+        }
     }
     _hdfs_file = hdfsOpenFile(_hdfs_fs, _path.c_str(), O_RDONLY, 0, 0, 0);
     if (_hdfs_file == nullptr) {


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