[
https://issues.apache.org/jira/browse/HDDS-314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16578654#comment-16578654
]
Anu Engineer commented on HDDS-314:
-----------------------------------
{noformat}
Expectation :
-------------------
key overwrite with same name should not be allowed.{noformat}
I submit that this expectation is not correct. Ozone's defined semantics is
that a key will overwritten without any warning, the same is true for S3.
Here are the relevant references:
>From page *34* from *Book of Ozone*:
{noformat}
PUT /{volume}/{bucket}/{key}
When putting a key it is the responsibility of the user to ensure that the key
does not exist, Otherwise put will overwrite an existing key. Key names can be
from 3 bytes to maximum length of 1024 bytes. Maximum size of data that can be
stored in a single key is 5 GB. All valid URI(as defined) characters can be
used for keys.{noformat}
>From the following URL:
[https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html]
{noformat}
Amazon S3 is a distributed system. If it receives multiple write requests for
the same object simultaneously, it overwrites all but the last object written.
Amazon S3 does not provide object locking; if you need this, make sure to build
it into your application layer or use versioning instead.{noformat}
I am more than happy to change the semantics if you think it is required. I am
just mentioning that this is the current defined semantics. I am sorry I did
not get back to earlier with this.
> ozoneShell putKey command overwrites the existing key having same name
> ----------------------------------------------------------------------
>
> Key: HDDS-314
> URL: https://issues.apache.org/jira/browse/HDDS-314
> Project: Hadoop Distributed Data Store
> Issue Type: Bug
> Components: Ozone Client
> Reporter: Nilotpal Nandi
> Assignee: Nilotpal Nandi
> Priority: Critical
> Fix For: 0.2.1
>
> Attachments: HDDS-314.001.patch, HDDS-314.002.patch,
> HDDS-314.003.patch
>
>
> steps taken :
> 1) created a volume root-volume and a bucket root-bucket.
> 2) Ran following command to put a key with name 'passwd'
>
> {noformat}
> hadoop@08315aa4b367:~/bin$ ./ozone oz -putKey /root-volume/root-bucket/passwd
> -file /etc/services -v
> 2018-08-02 09:20:17 WARN NativeCodeLoader:60 - Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> Volume Name : root-volume
> Bucket Name : root-bucket
> Key Name : passwd
> File Hash : 567c100888518c1163b3462993de7d47
> 2018-08-02 09:20:18 INFO ConfUtils:41 - raft.rpc.type = GRPC (default)
> 2018-08-02 09:20:18 INFO ConfUtils:41 - raft.grpc.message.size.max = 33554432
> (custom)
> 2018-08-02 09:20:18 INFO ConfUtils:41 - raft.client.rpc.retryInterval = 300
> ms (default)
> 2018-08-02 09:20:18 INFO ConfUtils:41 -
> raft.client.async.outstanding-requests.max = 100 (default)
> 2018-08-02 09:20:18 INFO ConfUtils:41 - raft.client.async.scheduler-threads =
> 3 (default)
> 2018-08-02 09:20:18 INFO ConfUtils:41 - raft.grpc.flow.control.window = 1MB
> (=1048576) (default)
> 2018-08-02 09:20:18 INFO ConfUtils:41 - raft.grpc.message.size.max = 33554432
> (custom)
> 2018-08-02 09:20:18 INFO ConfUtils:41 - raft.client.rpc.request.timeout =
> 3000 ms (default)
> Aug 02, 2018 9:20:18 AM
> org.apache.ratis.shaded.io.grpc.internal.ProxyDetectorImpl detectProxy
>
> {noformat}
> 3) Ran following command to put a key with name 'passwd' again.
> {noformat}
> hadoop@08315aa4b367:~/bin$ ./ozone oz -putKey /root-volume/root-bucket/passwd
> -file /etc/passwd -v
> 2018-08-02 09:20:41 WARN NativeCodeLoader:60 - Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> Volume Name : root-volume
> Bucket Name : root-bucket
> Key Name : passwd
> File Hash : b056233571cc80d6879212911cb8e500
> 2018-08-02 09:20:41 INFO ConfUtils:41 - raft.rpc.type = GRPC (default)
> 2018-08-02 09:20:42 INFO ConfUtils:41 - raft.grpc.message.size.max = 33554432
> (custom)
> 2018-08-02 09:20:42 INFO ConfUtils:41 - raft.client.rpc.retryInterval = 300
> ms (default)
> 2018-08-02 09:20:42 INFO ConfUtils:41 -
> raft.client.async.outstanding-requests.max = 100 (default)
> 2018-08-02 09:20:42 INFO ConfUtils:41 - raft.client.async.scheduler-threads =
> 3 (default)
> 2018-08-02 09:20:42 INFO ConfUtils:41 - raft.grpc.flow.control.window = 1MB
> (=1048576) (default)
> 2018-08-02 09:20:42 INFO ConfUtils:41 - raft.grpc.message.size.max = 33554432
> (custom)
> 2018-08-02 09:20:42 INFO ConfUtils:41 - raft.client.rpc.request.timeout =
> 3000 ms (default)
> Aug 02, 2018 9:20:42 AM
> org.apache.ratis.shaded.io.grpc.internal.ProxyDetectorImpl
> detectProxy{noformat}
>
> key 'passwd' was overwritten with new content and it did not throw any saying
> that the key is already present.
> Expectation :
> -------------------
> key overwrite with same name should not be allowed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]