-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-19393. ABFS: Returning FileAlreadyExists Exception for UnauthorizedBlobOverwrite Rename Errors #7312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
69228d3
2b8b130
00b426f
401052c
001e137
6822054
0ec4803
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,8 @@ public enum AzureServiceErrorCode { | |
| ACCOUNT_REQUIRES_HTTPS("AccountRequiresHttps", HttpURLConnection.HTTP_BAD_REQUEST, null), | ||
| MD5_MISMATCH("Md5Mismatch", HttpURLConnection.HTTP_BAD_REQUEST, | ||
| "The MD5 value specified in the request did not match with the MD5 value calculated by the server."), | ||
| UNKNOWN(null, -1, null); | ||
| UNKNOWN(null, -1, null), | ||
| UNAUTHORIZED_BLOB_OVERWRITE("UnauthorizedBlobOverwrite", HttpURLConnection.HTTP_FORBIDDEN, "This request is not authorized to perform blob overwrites."); | ||
|
||
|
|
||
| private final String errorCode; | ||
| private final int httpStatusCode; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ | |
| import com.fasterxml.jackson.core.JsonToken; | ||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
|
||
| import org.apache.hadoop.fs.FileAlreadyExistsException; | ||
| import org.apache.hadoop.fs.azurebfs.AbfsConfiguration; | ||
| import org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore; | ||
| import org.apache.hadoop.fs.azurebfs.constants.AbfsHttpConstants; | ||
|
|
@@ -127,6 +128,7 @@ | |
| import static org.apache.hadoop.fs.azurebfs.constants.HttpQueryParams.QUERY_PARAM_RETAIN_UNCOMMITTED_DATA; | ||
| import static org.apache.hadoop.fs.azurebfs.contracts.services.AzureServiceErrorCode.RENAME_DESTINATION_PARENT_PATH_NOT_FOUND; | ||
| import static org.apache.hadoop.fs.azurebfs.contracts.services.AzureServiceErrorCode.SOURCE_PATH_NOT_FOUND; | ||
| import static org.apache.hadoop.fs.azurebfs.contracts.services.AzureServiceErrorCode.UNAUTHORIZED_BLOB_OVERWRITE; | ||
|
|
||
| /** | ||
| * AbfsClient interacting with the DFS Endpoint. | ||
|
|
@@ -613,6 +615,11 @@ public AbfsClientRenameResult renamePath( | |
| throw e; | ||
| } | ||
|
|
||
| if(op.getResult().getStorageErrorCode() | ||
| .equals(UNAUTHORIZED_BLOB_OVERWRITE.getErrorCode())){ | ||
| throw new FileAlreadyExistsException("File already exists." ); | ||
|
||
| } | ||
|
|
||
| // ref: HADOOP-18242. Rename failure occurring due to a rare case of | ||
| // tracking metadata being in incomplete state. | ||
| if (op.getResult().getStorageErrorCode() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: split the line with the text on the line below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taken