[
https://issues.apache.org/jira/browse/HDDS-338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16627955#comment-16627955
]
Hanisha Koneru commented on HDDS-338:
-------------------------------------
Hi [~msingh],
Found the following behavior with ozone fs.
# When we put a key with keyName ending with a slash, the trailing slash is
removed.
{code:java}
$ ./ozone sh key put volume/bucket/testKey3/ /etc/services -r=ONE
$ ./ozone sh key list volume/bucket
[ {
"version" : 0,
"md5hash" : null,
"createdOn" : "Tue, 25 Sep 2018 20:40:41 GMT",
"modifiedOn" : "Tue, 25 Sep 2018 21:12:57 GMT",
"size" : 677972,
"keyName" : "testKey3"
} ]{code}
# Sub-folders of a directory are not listed if we there is a key present with
the same name without trailing slash.
{code:java}
# There is a key "testKey2" and a directory "testKey2/" under the root folder /.
$ bin ./ozone fs -ls /
-rw-rw-rw- 1 5253 2018-09-25 13:16 /testKey2
drwxrwxrwx - 0 2018-09-25 11:26 /testKey2
# Directory and its subfolders are not listed, only the key is listed
$ ./ozone fs -ls /testKey2/
-rw-rw-rw- 1 5253 2018-09-25 13:16 /testKey2
# If no key is present with the same name as the directory, the subfolders are
listed
$ ./ozone fs -ls /testKey2/subKey2_1
drwxrwxrwx - 0 2018-09-25 13:13 /testKey2/subKey2_1/subsubKey2_1_1{code}
I think we should have a consistent behavior when listing files/ folders.
> ozoneFS allows to create file key and directory key with same keyname
> ---------------------------------------------------------------------
>
> Key: HDDS-338
> URL: https://issues.apache.org/jira/browse/HDDS-338
> Project: Hadoop Distributed Data Store
> Issue Type: Bug
> Components: Ozone Filesystem
> Reporter: Nilotpal Nandi
> Assignee: Hanisha Koneru
> Priority: Major
> Attachments: HDDS-338.001.patch
>
>
> steps taken :
> ----------------------
> 1. created a directory through ozoneFS interface.
> {noformat}
> hadoop@1a1fa8a11332:~/bin$ ./ozone fs -mkdir /temp1/
> 2018-08-08 13:50:26 WARN NativeCodeLoader:60 - Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> hadoop@1a1fa8a11332:~/bin$ ./ozone fs -ls /
> 2018-08-08 14:09:59 WARN NativeCodeLoader:60 - Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> Found 1 items
> drwxrwxrwx - 0 2018-08-08 13:51 /temp1{noformat}
> 2. create a new key with name 'temp1' at same bucket.
> {noformat}
> hadoop@1a1fa8a11332:~/bin$ ./ozone oz -putKey root-volume/root-bucket/temp1
> -file /etc/passwd
> 2018-08-08 14:10:34 WARN NativeCodeLoader:60 - Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> 2018-08-08 14:10:35 INFO ConfUtils:41 - raft.rpc.type = GRPC (default)
> 2018-08-08 14:10:35 INFO ConfUtils:41 - raft.grpc.message.size.max = 33554432
> (custom)
> 2018-08-08 14:10:35 INFO ConfUtils:41 - raft.client.rpc.retryInterval = 300
> ms (default)
> 2018-08-08 14:10:35 INFO ConfUtils:41 -
> raft.client.async.outstanding-requests.max = 100 (default)
> 2018-08-08 14:10:35 INFO ConfUtils:41 - raft.client.async.scheduler-threads =
> 3 (default)
> 2018-08-08 14:10:35 INFO ConfUtils:41 - raft.grpc.flow.control.window = 1MB
> (=1048576) (default)
> 2018-08-08 14:10:35 INFO ConfUtils:41 - raft.grpc.message.size.max = 33554432
> (custom)
> 2018-08-08 14:10:35 INFO ConfUtils:41 - raft.client.rpc.request.timeout =
> 3000 ms (default)
> Aug 08, 2018 2:10:36 PM
> org.apache.ratis.shaded.io.grpc.internal.ProxyDetectorImpl detectProxy
> WARNING: Failed to construct URI for proxy lookup, proceeding without proxy
> java.net.URISyntaxException: Illegal character in hostname at index 13:
> https://ozone_datanode_3.ozone_default:9858
> at java.net.URI$Parser.fail(URI.java:2848)
> at java.net.URI$Parser.parseHostname(URI.java:3387)
> at java.net.URI$Parser.parseServer(URI.java:3236)
> at java.net.URI$Parser.parseAuthority(URI.java:3155)
> at java.net.URI$Parser.parseHierarchical(URI.java:3097)
> at java.net.URI$Parser.parse(URI.java:3053)
> at java.net.URI.<init>(URI.java:673)
> at
> org.apache.ratis.shaded.io.grpc.internal.ProxyDetectorImpl.detectProxy(ProxyDetectorImpl.java:128)
> at
> org.apache.ratis.shaded.io.grpc.internal.ProxyDetectorImpl.proxyFor(ProxyDetectorImpl.java:118)
> at
> org.apache.ratis.shaded.io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:207)
> at
> org.apache.ratis.shaded.io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:188)
> at
> org.apache.ratis.shaded.io.grpc.internal.ManagedChannelImpl$SubchannelImpl.requestConnection(ManagedChannelImpl.java:1130)
> at
> org.apache.ratis.shaded.io.grpc.PickFirstBalancerFactory$PickFirstBalancer.handleResolvedAddressGroups(PickFirstBalancerFactory.java:79)
> at
> org.apache.ratis.shaded.io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl$1NamesResolved.run(ManagedChannelImpl.java:1032)
> at
> org.apache.ratis.shaded.io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:73)
> at
> org.apache.ratis.shaded.io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:1000)
> at
> org.apache.ratis.shaded.io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onAddresses(ManagedChannelImpl.java:1044)
> at
> org.apache.ratis.shaded.io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:201)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748){noformat}
> Observed that there are multiple entries of 'temp1' when ozone fs -ls command
> is run. Also . both the entries are considered as file . '/temp1' directory
> is not visible anymore.
> {noformat}
> hadoop@1a1fa8a11332:~/bin$ ./ozone fs -ls /
> 2018-08-08 14:10:41 WARN NativeCodeLoader:60 - Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> Found 2 items
> -rw-rw-rw- 1 963 2018-08-08 14:10 /temp1
> -rw-rw-rw- 1 963 2018-08-08 14:10 /temp1{noformat}
>
> {noformat}
> hadoop@1a1fa8a11332:~/bin$ ./ozone oz -listKey root-volume/root-bucket
> 2018-08-08 14:17:43 WARN NativeCodeLoader:60 - Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> [ {
> "version" : 0,
> "md5hash" : null,
> "createdOn" : "Sun, 15 Mar +50572 16:23:00 GMT",
> "modifiedOn" : "Sun, 15 Mar +50572 16:51:13 GMT",
> "size" : 963,
> "keyName" : "temp1"
> }, {
> "version" : 0,
> "md5hash" : null,
> "createdOn" : "Mon, 02 Mar +50572 01:59:07 GMT",
> "modifiedOn" : "Mon, 02 Mar +50572 02:10:13 GMT",
> "size" : 0,
> "keyName" : "temp1/"
> } ]{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]