[ 
https://issues.apache.org/jira/browse/HADOOP-15628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554611#comment-16554611
 ] 

Steve Loughran edited comment on HADOOP-15628 at 7/24/18 7:44 PM:
------------------------------------------------------------------

ps: that's not the current delete code. [This 
is|https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java#L1401].
 It's critical to have a look at the latest stuff to see if the problem still 
exists there, as if it doesn't, it just gets closed as WORKSFORME. As noted, I 
don't think it is perfect, but since we're only going to be tuning the 3.1+ 
line, you aren't ever going to see the fix in 2.8; 2.9 should already have the 
core fix; I'm just worrying about s3guard

That said: if you can replicate the situation where deleteObjects does a 
partial delete without raising an exception, that is a sign that the AWS SDK 
doesn't do what the javadocs say, so it's something we may need to worry about 
(although as we are on a much newer version of that SDK, again, it may be 
fixed). So: please try to replicate on the latest version, attempting it on the 
command line should be enough to try and trigger it. thanks


was (Author: ste...@apache.org):
ps: that's not the current delete code. [This 
is|https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java#L1401].
 It's critical to have a look at the latest stuff to see if the problem still 
exists there, as if it doesn't, it just gets closed as WORKSFORME. As noted, I 
don't think it is perfect, but since we're only going to be tuning the 3.1+ 
line, you aren't ever going to see the fix in 2.8. and as noted, 2.9 should 
have the core fix; I'm just worrying about s3guard

That said: if you can replicate the situation where deleteObjects does a 
partial delete without raising an exception, that is a sign that the AWS SDK 
doesn't do what the javadocs say, so it's something we may need to worry about 
(although as we are on a much newer version of that SDK, again, it may be 
fixed). So: please try to replicate on the latest version, attempting it on the 
command line should be enough to try and trigger it. thanks

> S3A Filesystem does not check return from AmazonS3Client deleteObjects
> ----------------------------------------------------------------------
>
>                 Key: HADOOP-15628
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15628
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/s3
>    Affects Versions: 2.9.1, 2.8.4, 3.1.1, 3.0.3
>         Environment: Hadoop 3.0.2 / Hadoop 2.8.3
> Hive 2.3.2 / Hive 2.3.3 / Hive 3.0.0
>            Reporter: Steve Jacobs
>            Assignee: Steve Loughran
>            Priority: Minor
>
> Deletes in S3A that use the Multi-Delete functionality in the Amazon S3 api 
> do not check to see if all objects have been succesfully delete. In the event 
> of a failure, the api will still return a 200 OK (which isn't checked 
> currently):
> [Delete Code from Hadoop 
> 2.8|https://github.com/apache/hadoop/blob/a0da1ec01051108b77f86799dd5e97563b2a3962/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java#L574]
>  
> {code:java}
> if (keysToDelete.size() == MAX_ENTRIES_TO_DELETE) {
> DeleteObjectsRequest deleteRequest =
> new DeleteObjectsRequest(bucket).withKeys(keysToDelete);
> s3.deleteObjects(deleteRequest);
> statistics.incrementWriteOps(1);
> keysToDelete.clear();
> }
> {code}
> This should be converted to use the DeleteObjectsResult class from the 
> S3Client: 
> [Amazon Code 
> Example|https://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingMultipleObjectsUsingJava.htm]
> {code:java}
> // Verify that the objects were deleted successfully.
> DeleteObjectsResult delObjRes = 
> s3Client.deleteObjects(multiObjectDeleteRequest); int successfulDeletes = 
> delObjRes.getDeletedObjects().size();
> System.out.println(successfulDeletes + " objects successfully deleted.");
> {code}
> Bucket policies can be misconfigured, and deletes will fail without warning 
> by S3A clients.
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to