[
https://issues.apache.org/jira/browse/HADOOP-19635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18010282#comment-18010282
]
ASF GitHub Bot commented on HADOOP-19635:
-----------------------------------------
Copilot commented on code in PR #7825:
URL: https://github.com/apache/hadoop/pull/7825#discussion_r2235023374
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java:
##########
@@ -1160,8 +1160,12 @@ public AbfsRestOperation setPathProperties(final String
path,
// This path could be present as an implicit directory in FNS.
if (op.getResult().getStatusCode() == HTTP_NOT_FOUND &&
isNonEmptyDirectory(path, tracingContext)) {
// Implicit path found, create a marker blob at this path and set
properties.
- this.createPathRestOp(path, false, false, false, null,
- contextEncryptionAdapter, tracingContext);
+ try {
+ this.createPathRestOp(path, false, false, false, null,
+ contextEncryptionAdapter, tracingContext);
+ } catch (AbfsRestOperationException exception) {
+ LOG.debug("Marker creation failed for path {} during
setPathProperties", path);
Review Comment:
Consider including the exception details in the debug log message to aid in
troubleshooting. For example: `LOG.debug("Marker creation failed for path {}
during setPathProperties: {}", path, exception.getMessage());`
```suggestion
LOG.debug("Marker creation failed for path {} during
setPathProperties: {}", path, exception.getMessage());
```
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java:
##########
@@ -1242,7 +1246,12 @@ public AbfsRestOperation getPathStatus(final String path,
&& isImplicitCheckRequired && isNonEmptyDirectory(path,
tracingContext)) {
// Implicit path found.
// Create a marker blob at this path.
- this.createMarkerAtPath(path, null, contextEncryptionAdapter,
tracingContext);
+ try {
+ this.createMarkerAtPath(path, null, contextEncryptionAdapter,
+ tracingContext);
+ } catch (AbfsRestOperationException exception) {
+ LOG.debug("Marker creation failed for path {} during getPathStatus
", path);
Review Comment:
Consider including the exception details in the debug log message to aid in
troubleshooting. For example: `LOG.debug("Marker creation failed for path {}
during getPathStatus: {}", path, exception.getMessage());`
```suggestion
LOG.debug("Marker creation failed for path {} during
getPathStatus: {}", path, exception.getMessage());
```
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemOauth.java:
##########
@@ -167,6 +168,30 @@ public void testBlobDataReader() throws Exception {
}
+ /*
+ * BLOB DATA READER should have only READ access to the container and blobs
in the container.
+ * */
+ @Test
+ public void testGetPathStatusWithReader() throws Exception {
+ String clientId =
this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_ID);
+ Assume.assumeTrue("Reader client id not provided", clientId != null);
+ String secret =
this.getConfiguration().get(TestConfigurationKeys.FS_AZURE_BLOB_DATA_READER_CLIENT_SECRET);
+ Assume.assumeTrue("Reader client secret not provided", secret != null);
+
+ Path existedFolderPath = path(EXISTED_FOLDER_PATH);
+ createAzCopyFolder(existedFolderPath);
+ final AzureBlobFileSystem fs = getBlobReader();
+
+ // Use abfsStore in this test to verify the ERROR code in
AbfsRestOperationException
+ AzureBlobFileSystemStore abfsStore = fs.getAbfsStore();
+ TracingContext tracingContext = getTestTracingContext(fs, true);
+
+ // GETPATHSTATUS marker creation fail should not be propagated to the
caller.
Review Comment:
There's an extra space at the beginning of this comment line. Remove the
leading space for consistent formatting.
```suggestion
// GETPATHSTATUS marker creation fail should not be propagated to the
caller.
```
> ABFS: [FNS Over Blob] Marker creation fail exception should not be propagated
> -----------------------------------------------------------------------------
>
> Key: HADOOP-19635
> URL: https://issues.apache.org/jira/browse/HADOOP-19635
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: hadoop-azure
> Affects Versions: 3.4.1
> Reporter: Anmol Asrani
> Assignee: Anmol Asrani
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.4.1
>
>
> Marker creation is attempted during certain operations such as {*}create{*},
> {*}getPathStatus{*}, {*}setPathProperties{*}, and {*}rename{*}, in order to
> add a 0-byte file that signifies the existence of a folder at that path.
> However, if marker creation fails, the failure should not be propagated to
> the user.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]