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

Aperta
#9,035 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Rust
Stelle
5.5k
Fork
869
Merge medio
8h 2m
PR unite (30g)
862

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/opendal

Tutte le issue di apache/opendal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.