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

ASF GitHub Bot commented on HADOOP-18910:
-----------------------------------------

steveloughran commented on code in PR #6069:
URL: https://github.com/apache/hadoop/pull/6069#discussion_r1391613074


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -798,6 +806,11 @@ public AbfsRestOperation append(final String path, final 
byte[] buffer,
       if (!op.hasResult()) {
         throw e;
       }
+

Review Comment:
   on the topic of ex parsing, L797 will blow up with a ClassCastException if 
the exception caught is anything other than a AbfsRestOperationException.
   
   so the type of exception caught can be changed to  AbfsRestOperationException



##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java:
##########
@@ -879,9 +880,8 @@ private boolean checkUserError(int responseStatusCode) {
    * @return boolean whether exception is due to MD5Mismatch or not
    */
   protected boolean isMd5ChecksumError(final AzureBlobFileSystemException e) {
-    return ((AbfsRestOperationException) e).getStatusCode()
-        == HttpURLConnection.HTTP_BAD_REQUEST
-        && e.getMessage().contains(MD5_ERROR_SERVER_MESSAGE);
+    AzureServiceErrorCode storageErrorCode = ((AbfsRestOperationException) 
e).getErrorCode();

Review Comment:
   see my comment above about making the catch on L787 a 
AbfsRestOperationException





> ABFS: Adding Support for MD5 Hash based integrity verification of the request 
> content during transport 
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-18910
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18910
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/azure
>            Reporter: Anuj Modi
>            Assignee: Anuj Modi
>            Priority: Major
>              Labels: pull-request-available
>
> Azure Storage Supports Content-MD5 Request Headers in Both Read and Append 
> APIs.
> Read: [Path - Read - REST API (Azure Storage Services) | Microsoft 
> Learn|https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/read]
> Append: [Path - Update - REST API (Azure Storage Services) | Microsoft 
> Learn|https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update]
> This change is to make client-side changes to support them. In Read request, 
> we will send the appropriate header in response to which server will return 
> the MD5 Hash of the data it sends back. On Client we will tally this with the 
> MD5 hash computed from the data received.
> In Append request, we will compute the MD5 Hash of the data that we are 
> sending to the server and specify that in appropriate header. Server on 
> finding that header will tally this with the MD5 hash it will compute on the 
> data received. 
> This whole Checksum Validation Support is guarded behind a config, Config is 
> by default disabled because with the use of "https" integrity of data is 
> preserved anyways. This is introduced as an additional data integrity check 
> which will have a performance impact as well.
> Users can decide if they want to enable this or not by setting the following 
> config to *"true"* or *"false"* respectively. *Config: 
> "fs.azure.enable.checksum.validation"*



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
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