chitralverma opened a new issue, #9035:
URL: https://github.com/apache/opendal/issues/9035
### 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`.
```rust
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?
- [x] 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.
- [x] Yes, I would like to submit a PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]