bug(services/hdfs-native): delegation tokens with NameNode addresses and viewfs:// name_node fail

オープン
#9,035 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
backend

調査の方向性

The fault is in services/hdfs-native, where the name_node value is turned into a nameservice or an address list before the token is chosen. Start with that parsing and with how the token service string is matched, then compare against hdfs_native::Client using the MiniDFS setup in the report. Done means the three name_node forms list / with a delegation token and viewfs:// uses the mount table.

索引モデルが issue の本文から書いたものです。

説明

bug services/hdfs_native
OpenDAL version or commit

main (d86cd9245) with #9016 (910c76a1b) merged on top

Affected service or component

services/hdfs-native

Describe the bug

#9016 routes default and logical nameservices through the Hadoop configuration. Two name_node forms still fail where hdfs_native::Client succeeds:

  1. NameNode addresses with a delegation token. For hdfs://host:port and hdfs://nn1:port,nn2:port, the service names the nameservice nameservice. The client then uses only a token whose service is ha-hdfs:nameservice. A token that the cluster issues has the service host:port or ha-hdfs:<nameservice>, so the client skips it and SASL fails.
  2. A viewfs:// name_node. The value contains : and /, so the service parses it as a list of NameNode addresses. The client retries the address viewfs:, then fails.
Steps to Reproduce

I used MiniDFS from the hdfs-native repository. HADOOP_CONF_DIR points at the core-site.xml that it writes.

  1. Start MiniDFS with security token (and with security token ha). Set HADOOP_TOKEN_FILE_LOCATION to its delegation_token. There is no Kerberos ticket.
  2. Start MiniDFS with viewfs.
async fn list(name_node: &str, path: &str) -> opendal_core::Result<()> {
    let op = Operator::new(HdfsNative::default().name_node(name_node))?;
    op.list(path).await.map(|_| ())
}

// 1
list("hdfs://127.0.0.1:9000", "/").await?;
list("hdfs://localhost:34991,localhost:35931,localhost:44035", "/").await?; // `ha`
// 2
list("viewfs://minidfs-viewfs", "/mount1/").await?;
Actual Behavior
name_node OpenDAL hdfs_native::Client
hdfs://127.0.0.1:9000, token GSSAPI error: GssMajorCodes { raw: "0x00070000", ... } lists / (URL hdfs://127.0.0.1:9000)
HA addresses, token GSSAPI error: GssMajorCodes { raw: "0x00070000", ... } lists / (URL hdfs://minidfs-ns)
default, token lists /
viewfs://minidfs-viewfs invalid port value after about 175 s writes and lists /mount1 (URL viewfs://minidfs-viewfs)
Expected Behavior
  1. With NameNode addresses, the service uses the token that the cluster issued for them.
  2. A viewfs:// name_node uses the ViewFS mount table, as name_node = "default" does when fs.defaultFS is viewfs://....
Additional Context
  • For a single address, passing hdfs://host:port to ClientBuilder::with_url makes the client use the token service host:port, which matches the token that the cluster issues. For several addresses, a logical nameservice is the only form that matches a cluster token. That works with #9016.
  • For a viewfs:// name_node, passing the URL to ClientBuilder::with_url without change makes the client use the mount table.
Are you willing to submit a PR to fix this bug?
  • I reproduced this issue against the affected component. For a service-specific report, I used the actual service rather than only a mock, emulator, or source-code analysis.
  • Yes, I would like to submit a PR.
主要言語
Rust
スター
5.5k
フォーク
869
平均マージ
8時間 2分
マージ済み PR(30日)
862

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/opendal のほかの issue

apache/opendal の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。