This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 96fc70e66c HDDS-10719. Avoid empty ETag for key created outside of S3
(#6563)
96fc70e66c is described below
commit 96fc70e66cec3bbbf843c3f1cfa293ccc7e13470
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Sun Apr 21 08:33:24 2024 +0200
HDDS-10719. Avoid empty ETag for key created outside of S3 (#6563)
---
.../main/java/org/apache/hadoop/ozone/om/helpers/BasicOmKeyInfo.java | 5 +++--
hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/BasicOmKeyInfo.java
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/BasicOmKeyInfo.java
index fdbbef8aec..a2e9423862 100644
---
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/BasicOmKeyInfo.java
+++
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/BasicOmKeyInfo.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.ozone.om.helpers;
import java.io.IOException;
import java.util.Objects;
+import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.hdds.client.ECReplicationConfig;
import org.apache.hadoop.hdds.client.ReplicationConfig;
import
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.BasicKeyInfo;
@@ -51,7 +52,7 @@ public final class BasicOmKeyInfo {
this.modificationTime = b.modificationTime;
this.replicationConfig = b.replicationConfig;
this.isFile = b.isFile;
- this.eTag = b.eTag;
+ this.eTag = StringUtils.isNotEmpty(b.eTag) ? b.eTag : null;
}
private BasicOmKeyInfo(OmKeyInfo b) {
@@ -179,7 +180,7 @@ public final class BasicOmKeyInfo {
} else {
builder.setFactor(ReplicationConfig.getLegacyFactor(replicationConfig));
}
- if (eTag != null) {
+ if (StringUtils.isNotEmpty(eTag)) {
builder.setETag(eTag);
}
diff --git a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot
b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot
index d1a6c5c7d0..685f57fd2b 100644
--- a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell-lib.robot
@@ -167,6 +167,7 @@ Test key handling
Should Not Contain ${result} NOTICE.txt.1 exists
${result} = Execute ozone sh key info
${protocol}${server}/${volume}/bb1/key1 | jq -r '. | select(.name=="key1")'
Should contain ${result} creationTime
+ Should not contain ${result} ETag
${result} = Execute ozone sh key list
${protocol}${server}/${volume}/bb1 | jq -r '.[] | select(.name=="key1") | .name'
Should Be Equal ${result} key1
Execute ozone sh key rename
${protocol}${server}/${volume}/bb1 key1 key2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]