bug(services/hdfs-native): delegation tokens with NameNode addresses and viewfs:// name_node fail
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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:
- NameNode addresses with a delegation token. For
hdfs://host:portandhdfs://nn1:port,nn2:port, the service names the nameservicenameservice. The client then uses only a token whose service isha-hdfs:nameservice. A token that the cluster issues has the servicehost:portorha-hdfs:<nameservice>, so the client skips it and SASL fails. - A
viewfs://name_node. The value contains:and/, so the service parses it as a list of NameNode addresses. The client retries the addressviewfs:, 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.
- Start MiniDFS with
security token(and withsecurity token ha). SetHADOOP_TOKEN_FILE_LOCATIONto itsdelegation_token. There is no Kerberos ticket. - 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
- With NameNode addresses, the service uses the token that the cluster issued for them.
- A
viewfs://name_node uses the ViewFS mount table, asname_node = "default"does whenfs.defaultFSisviewfs://....
Additional Context
- For a single address, passing
hdfs://host:porttoClientBuilder::with_urlmakes the client use the token servicehost: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 toClientBuilder::with_urlwithout 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.
- Dominant language
- Rust
- Stars
- 5.5k
- Forks
- 869
- Avg merge
- 8h 2m
- Merged PRs (30d)
- 862
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/opendal
-
bug(services/fs): deleting "/" removes the configured root directoryPossibly taken @xgbtxy claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
apache/opendal#9635 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
core enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
apache/opendal#9572 · 1 reaction ·
Maintainers usually reply within 1 day
-
fix(bindings/nodejs): reject negative and overflowing BigInt values in WriteOptions.chunk and Read/ReaderOptions.gapPossibly taken @rohan4naik claimed this today. Openbindings/nodejs bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
apache/opendal#9569 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug(layers/throttle): throttle streaming ReadStream bytes instead of pre-charging ReadOptions::limit upper bounds on open()Possibly taken @Xuanwo claimed this today. Openbug core
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/opendal#9567 · 1 reaction ·
Maintainers usually reply within 1 day
-
bindings/c bindings/dotnet bindings/go bindings/java bindings/python bindings/ruby core integrations/object_store release release-blocker services/azblob services/azdls services/dropbox services/gcs_grpc services/git services/hf3fs services/redis services/remotestorage services/s3 website
Difficulty 5/5 Over a week Newbie friendliness 20/100
apache/opendal#9560 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
Android bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anefzaoui/misterdownloadmanager#2516 ·
Maintainers usually reply within 1 day
-
editor ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
state:triage tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 89/100
agent8-cash/ethpayserver#731 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day