Xuanwo commented on issue #4894:
URL: https://github.com/apache/opendal/issues/4894#issuecomment-2227675257
There is a history behind using `stat("/")` and `stat("path/to/dir/")`.
Previously, services like S3 did not support statting a directory; they
would always return `Ok` because object storage services lack a concept of
directories. As a workaround, we treated `/` specially to enable it to return
quickly without going through the entire process.
In newer versions, we've improved how we handle `stat("path/to/dir/")` by
verifying the existence of the path on S3 using `list("path/to/dir/")`.
However, listing operations are expensive (10 times more than `GET`/`HEAD`) and
slow (1/10 as fast as `HEAD`). Therefore, we have kept the logic for
`stat("/")` unchanged.
Perhaps we can relocate the list-stat simulation logic to S3 and allow users
to enable/disable it, ensuring that `stat("/")` is always sent with a real
request.
--
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]