jojochuang commented on code in PR #8838:
URL: https://github.com/apache/ozone/pull/8838#discussion_r2302483356
##########
hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot:
##########
@@ -155,3 +155,16 @@ HSync Lease Recover Can Be Used
Pass Execution If '${CLIENT_VERSION}' < '${HSYNC_VERSION}' Client
does not support HSYNC
Pass Execution If '${CLUSTER_VERSION}' < '${HSYNC_VERSION}' Cluster
does not support HSYNC
Execute ozone admin om lease recover
--path=ofs://om/vol1/fso-bucket-${DATA_VERSION}/dir/subdir/file
+
+Key Info File Flag Should Be Set Correctly
+ Pass Execution If '${CLUSTER_VERSION}' <= '${EC_VERSION}' Cluster
does not support 'file' flag
+ Pass Execution If '${CLIENT_VERSION}' <= '${EC_VERSION}' Client does
not support 'file' flag
+
+ ${dirpath} = Set Variable
/vol1/fso-bucket-${DATA_VERSION}/dir/subdir/
+ ${filepath} = Set Variable ${dirpath}file
+
+ ${key_info} = Execute ozone sh key info ${filepath}
Review Comment:
this test does not look valid to me.
ozone sh key info is implemented by InfoKeyHandler, which doesn't use
BasicOmKeyInfo.
Perhaps we should try ozone sh key list, which uses RpcClient.listKeys() API
and uses BasicOmKeyInfo objects.
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/BasicOmKeyInfo.java:
##########
@@ -227,9 +228,14 @@ public static BasicOmKeyInfo getFromProtobuf(BasicKeyInfo
basicKeyInfo,
basicKeyInfo.getFactor(),
basicKeyInfo.getEcReplicationConfig()))
.setETag(basicKeyInfo.getETag())
- .setIsFile(!keyName.endsWith("/"))
.setOwnerName(basicKeyInfo.getOwnerName());
+ if (basicKeyInfo.hasIsFile()) {
+ builder.setIsFile(basicKeyInfo.getIsFile());
+ } else {
+ builder.setIsFile(!keyName.endsWith("/"));
Review Comment:
The keyName of a dir in a FSO bucket is guaranteed to have a trailing slash
because of KeyManagerImpl.getOmKeyInfoFSO().
Same for OBS and Legacy buckets in KeyManagerImpl.getOzoneFileStatus()
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]