Skip to content

HDDS-15349. Remove the non-ignorePipeline codec from OmKeyInfo.#10361

Merged
peterxcli merged 4 commits into
apache:masterfrom
YutaLin:HDDS-15349_remove_ignorepipeline_from_OMKeyInfo
May 27, 2026
Merged

HDDS-15349. Remove the non-ignorePipeline codec from OmKeyInfo.#10361
peterxcli merged 4 commits into
apache:masterfrom
YutaLin:HDDS-15349_remove_ignorepipeline_from_OMKeyInfo

Conversation

@YutaLin
Copy link
Copy Markdown
Contributor

@YutaLin YutaLin commented May 25, 2026

What changes were proposed in this pull request?

The ignorePipeline parameter is always true except for tests. Let's remove it in order to simplify the code.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15349

How was this patch tested?

CI (https://github.com/YutaLin/ozone/actions/runs/26421165778)

@YutaLin YutaLin marked this pull request as ready for review May 26, 2026 01:28
@YutaLin
Copy link
Copy Markdown
Contributor Author

YutaLin commented May 26, 2026

Hi @szetszwo,
Could you help me review this? Thanks

cc @Russole, @peterxcli

OmKeyInfo originKey = getKeyInfo(chunkNum);
byte[] rawData = codecWithPipeline.toPersistedFormat(originKey);
OmKeyInfo key = codecWithoutPipeline.fromPersistedFormat(rawData);
byte[] rawData = originKey
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
*
* @param ignorePipeline true for persist to DB, false for network transmit.
* @return KeyInfo
*/

if db record always ignore pipeline, then we dont have the compatibility problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @peterxcli, thanks for the review!

I am not sure what "compatibility problem" you are referring to.
AFAIK, we don't persist pipeline info because pipeline it can change over time. We re-fetched from SCM when we needed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if we really need this test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, I've check that legacy db rows need to survived 5+years without compaction, so we can remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the early version store the pipeline into db?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipeline was stored in DB before HDDS-3658, check commit: 71cc33d

Proto2Codec.get(KeyInfo.getDefaultInstance()),
OmKeyInfo::getFromProtobuf,
k -> k.getProtobuf(ignorePipeline, ClientVersion.CURRENT_VERSION),
k -> k.getProtobuf(true, ClientVersion.CURRENT_VERSION),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove also the ignorePipeline parameter from the getProtobuf(..) method. Something like below:

diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java
index da6c46f9b6..a214dbd205 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java
@@ -39,7 +39,6 @@
 import org.apache.hadoop.hdds.utils.db.CopyObject;
 import org.apache.hadoop.hdds.utils.db.DelegatedCodec;
 import org.apache.hadoop.hdds.utils.db.Proto2Codec;
-import org.apache.hadoop.ozone.ClientVersion;
 import org.apache.hadoop.ozone.OzoneAcl;
 import org.apache.hadoop.ozone.OzoneConsts;
 import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.FileChecksumProto;
@@ -59,8 +58,7 @@ public final class OmKeyInfo extends WithParentObjectId
     implements CopyObject<OmKeyInfo>, WithTags {
   private static final Logger LOG = LoggerFactory.getLogger(OmKeyInfo.class);
 
-  private static final Codec<OmKeyInfo> CODEC_TRUE = newCodec(true);
-  private static final Codec<OmKeyInfo> CODEC_FALSE = newCodec(false);
+  private static final Codec<OmKeyInfo> CODEC = newCodec();
   /**
    * Metadata key flag to indicate whether a deleted key was a committed key.
    * The flag is set when a committed key is deleted from AOS but still held in
@@ -131,17 +129,16 @@ private OmKeyInfo(Builder b) {
     this.expectedDataGeneration = b.expectedDataGeneration;
   }
 
-  private static Codec<OmKeyInfo> newCodec(boolean ignorePipeline) {
+  private static Codec<OmKeyInfo> newCodec() {
     return new DelegatedCodec<>(
         Proto2Codec.get(KeyInfo.getDefaultInstance()),
         OmKeyInfo::getFromProtobuf,
-        k -> k.getProtobuf(ignorePipeline, ClientVersion.CURRENT_VERSION),
+        OmKeyInfo::getProtobuf,
         OmKeyInfo.class);
   }
 
-  public static Codec<OmKeyInfo> getCodec(boolean ignorePipeline) {
-    LOG.debug("OmKeyInfo.getCodec ignorePipeline = {}", ignorePipeline);
-    return ignorePipeline ? CODEC_TRUE : CODEC_FALSE;
+  public static Codec<OmKeyInfo> getCodec() {
+    return CODEC;
   }
 
   public String getVolumeName() {
@@ -701,68 +698,52 @@ protected OmKeyInfo buildObject() {
     }
   }
 
-  /**
-   * For network transmit.
-   * @return KeyInfo
-   */
-  public KeyInfo getProtobuf(int clientVersion) {
-    return getProtobuf(false, clientVersion);
-  }
-
   /**
    * For network transmit to return KeyInfo.
-   * @param clientVersion
    * @param latestVersion
    * @return key info.
    */
-  public KeyInfo getNetworkProtobuf(int clientVersion, boolean latestVersion) {
-    return getProtobuf(false, null, clientVersion, latestVersion);
+  public KeyInfo getNetworkProtobuf(boolean latestVersion) {
+    return getProtobuf(null, latestVersion);
   }
 
   /**
    * For network transmit to return KeyInfo.
    *
    * @param fullKeyName the user given full key name
-   * @param clientVersion
    * @param latestVersion
    * @return key info with the user given full key name
    */
-  public KeyInfo getNetworkProtobuf(String fullKeyName, int clientVersion,
-      boolean latestVersion) {
-    return getProtobuf(false, fullKeyName, clientVersion, latestVersion);
+  public KeyInfo getNetworkProtobuf(String fullKeyName, boolean latestVersion) {
+    return getProtobuf(fullKeyName, latestVersion);
   }
 
   /**
    *
-   * @param ignorePipeline true for persist to DB, false for network transmit.
    * @return KeyInfo
    */
-  public KeyInfo getProtobuf(boolean ignorePipeline, int clientVersion) {
-    return getProtobuf(ignorePipeline, null, clientVersion, false);
+  public KeyInfo getProtobuf() {
+    return getProtobuf(null, false);
   }
 
   /**
    * Gets KeyInfo with the user given key name.
    *
-   * @param ignorePipeline   ignore pipeline flag
    * @param fullKeyName user given key name
    * @return key info object
    */
-  private KeyInfo getProtobuf(boolean ignorePipeline, String fullKeyName,
-                              int clientVersion, boolean latestVersionBlocks) {
+  private KeyInfo getProtobuf(String fullKeyName, boolean latestVersionBlocks) {
     long latestVersion = keyLocationVersions.isEmpty() ? -1 :
         keyLocationVersions.get(keyLocationVersions.size() - 1).getVersion();
 
     List<KeyLocationList> keyLocations = new ArrayList<>();
     if (!latestVersionBlocks) {
       for (OmKeyLocationInfoGroup locationInfoGroup : keyLocationVersions) {
-        keyLocations.add(locationInfoGroup.getProtobuf(
-            ignorePipeline, clientVersion));
+        keyLocations.add(locationInfoGroup.getProtobuf());
       }
     } else {
       if (latestVersion != -1) {
-        keyLocations.add(keyLocationVersions.get(keyLocationVersions.size() - 1)
-            .getProtobuf(ignorePipeline, clientVersion));
+        keyLocations.add(keyLocationVersions.get(keyLocationVersions.size() - 1).getProtobuf());
       }
     }
 
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfo.java
index d3fea73b21..3a80af98a0 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfo.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfo.java
@@ -88,41 +88,14 @@ public OmKeyLocationInfo build() {
     }
   }
 
-  public KeyLocation getProtobuf(int clientVersion) {
-    return getProtobuf(false, clientVersion);
-  }
-
-  public KeyLocation getProtobuf(boolean ignorePipeline, int clientVersion) {
-    KeyLocation.Builder builder = KeyLocation.newBuilder()
+  public KeyLocation getProtobuf() {
+    return KeyLocation.newBuilder()
         .setBlockID(getBlockID().getProtobuf())
         .setLength(getLength())
         .setOffset(getOffset())
         .setCreateVersion(getCreateVersion())
-        .setPartNumber(getPartNumber());
-    if (!ignorePipeline) {
-      Token<OzoneBlockTokenIdentifier> token = getToken();
-      if (token != null) {
-        builder.setToken(OMPBHelper.protoFromToken(token));
-      }
-
-      // Pipeline can be null when key create with override and
-      // on a versioning enabled bucket. for older versions of blocks
-      // We do not need to return pipeline as part of createKey,
-      // so we do not refresh pipeline in createKey, because of this reason
-      // for older version of blocks pipeline can be null.
-      // And also for key create we never need to return pipeline info
-      // for older version of blocks irrespective of versioning.
-
-      // Currently, we do not completely support bucket versioning.
-      // TODO: this needs to be revisited when bucket versioning
-      //  implementation is handled.
-
-      Pipeline pipeline = getPipeline();
-      if (pipeline != null) {
-        builder.setPipeline(pipeline.getProtobufMessage(clientVersion));
-      }
-    }
-    return builder.build();
+        .setPartNumber(getPartNumber())
+        .build();
   }
 
   private static Pipeline getPipeline(KeyLocation keyLocation) {
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfoGroup.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfoGroup.java
index e2477a4cef..c559d70adf 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfoGroup.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyLocationInfoGroup.java
@@ -124,15 +124,14 @@ public List<OmKeyLocationInfo> getLocationList(Long versionToFetch) {
     return new ArrayList<>(locationVersionMap.get(versionToFetch));
   }
 
-  public KeyLocationList getProtobuf(boolean ignorePipeline,
-      int clientVersion) {
+  public KeyLocationList getProtobuf() {
     KeyLocationList.Builder builder = KeyLocationList.newBuilder()
         .setVersion(version).setIsMultipartKey(isMultipartKey);
     List<OzoneManagerProtocolProtos.KeyLocation> keyLocationList =
         new ArrayList<>();
     for (List<OmKeyLocationInfo> locationList : locationVersionMap.values()) {
       for (OmKeyLocationInfo keyInfo : locationList) {
-        keyLocationList.add(keyInfo.getProtobuf(ignorePipeline, clientVersion));
+        keyLocationList.add(keyInfo.getProtobuf());
       }
     }
     return  builder.addAllKeyLocations(keyLocationList).build();
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartPartInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartPartInfo.java
index f8bf57de14..b2b0b22b21 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartPartInfo.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartPartInfo.java
@@ -316,7 +316,7 @@ private KeyLocationList getKeyLocationInfosAsProto() {
     if (keyLocationInfos == null || keyLocationInfos.isEmpty()) {
       throw new IllegalArgumentException("keyLocationList is required");
     }
-    return keyLocationInfos.get(0).getProtobuf(true, ClientVersion.CURRENT_VERSION);
+    return keyLocationInfos.get(0).getProtobuf(ClientVersion.CURRENT_VERSION);
   }
 
   private static List<OmKeyLocationInfoGroup> getKeyLocationInfosFromProto(
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
index 9ca5ff63f8..b9cd861317 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
@@ -850,7 +850,7 @@ private void updateKey(OmKeyArgs args, long clientId, boolean hsync, boolean rec
         .addAllMetadata(KeyValueUtil.toProtobuf(args.getMetadata()))
         .addAllKeyLocations(locationInfoList.stream()
             // TODO use OM version?
-            .map(info -> info.getProtobuf(ClientVersion.CURRENT_VERSION))
+            .map(info -> info.getProtobuf())
             .collect(Collectors.toList()));
 
     setReplicationConfig(args.getReplicationConfig(), keyArgsBuilder);
@@ -1766,7 +1766,7 @@ public OmMultipartCommitUploadPartInfo commitMultipartUploadPart(
         .addAllMetadata(KeyValueUtil.toProtobuf(omKeyArgs.getMetadata()))
         .addAllKeyLocations(locationInfoList.stream()
             // TODO use OM version?
-            .map(info -> info.getProtobuf(ClientVersion.CURRENT_VERSION))
+            .map(info -> info.getProtobuf())
             .collect(Collectors.toList()));
     multipartCommitUploadPartRequest.setClientID(clientId);
     multipartCommitUploadPartRequest.setKeyArgs(keyArgs.build());
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
index b76e5aa526..8d01efeb64 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
@@ -89,7 +89,6 @@
 import org.apache.hadoop.hdds.utils.db.cache.CacheKey;
 import org.apache.hadoop.hdds.utils.db.cache.CacheValue;
 import org.apache.hadoop.hdds.utils.db.cache.TableCache.CacheType;
-import org.apache.hadoop.ozone.ClientVersion;
 import org.apache.hadoop.ozone.OmUtils;
 import org.apache.hadoop.ozone.OzoneConsts;
 import org.apache.hadoop.ozone.common.BlockGroup;
@@ -1501,7 +1500,7 @@ public ExpiredOpenKeys getExpiredOpenKeys(Duration expireThreshold,
                 .map(OmKeyLocationInfoGroup::getLocationList)
                 .map(Collection::stream)
                 .orElseGet(Stream::empty)
-                .map(loc -> loc.getProtobuf(ClientVersion.CURRENT_VERSION))
+                .map(loc -> loc.getProtobuf())
                 .forEach(keyArgs::addKeyLocations);
 
             OzoneManagerProtocolClientSideTranslatorPB.setReplicationConfig(
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
index 9788cfbafe..e625d00d5e 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
@@ -145,7 +145,7 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
         .setDataSize(requestedSize);
 
     newKeyArgs.addAllKeyLocations(omKeyLocationInfoList.stream()
-        .map(info -> info.getProtobuf(getOmRequest().getVersion()))
+        .map(info -> info.getProtobuf())
         .collect(Collectors.toList()));
 
     generateRequiredEncryptionInfo(keyArgs, newKeyArgs, ozoneManager);
@@ -289,7 +289,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
 
       // Prepare response
       omResponse.setCreateFileResponse(CreateFileResponse.newBuilder()
-          .setKeyInfo(omKeyInfo.getNetworkProtobuf(getOmRequest().getVersion(),
+          .setKeyInfo(omKeyInfo.getNetworkProtobuf(
               keyArgs.getLatestVersionLocation()))
           .setID(clientID)
           .setOpenVersion(openVersion).build())
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequestWithFSO.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequestWithFSO.java
index 6036fe90db..3c39d178ce 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequestWithFSO.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequestWithFSO.java
@@ -209,7 +209,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
       // attribute in response object.
       int clientVersion = getOmRequest().getVersion();
       omResponse.setCreateFileResponse(CreateFileResponse.newBuilder()
-          .setKeyInfo(omFileInfo.getNetworkProtobuf(keyName, clientVersion,
+          .setKeyInfo(omFileInfo.getNetworkProtobuf(keyName,
               keyArgs.getLatestVersionLocation()))
           .setID(clientID)
           .setOpenVersion(openVersion).build())
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMRecoverLeaseRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMRecoverLeaseRequest.java
index ca1ea07ad6..add15c429c 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMRecoverLeaseRequest.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMRecoverLeaseRequest.java
@@ -257,8 +257,8 @@ private RecoverLeaseResponse doWork(OzoneManager ozoneManager,
     }
 
     RecoverLeaseResponse.Builder rb = RecoverLeaseResponse.newBuilder();
-    rb.setKeyInfo(keyInfo.getNetworkProtobuf(getOmRequest().getVersion(), true));
-    rb.setOpenKeyInfo(openKeyInfo.getNetworkProtobuf(getOmRequest().getVersion(), true));
+    rb.setKeyInfo(keyInfo.getNetworkProtobuf(true));
+    rb.setOpenKeyInfo(openKeyInfo.getNetworkProtobuf(true));
     return rb.build();
   }
 
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java
index e8b3abfe21..05a4bea7db 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java
@@ -140,7 +140,7 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
 
     // Add allocated block info.
     newAllocatedBlockRequest.setKeyLocation(
-        omKeyLocationInfoList.get(0).getProtobuf(getOmRequest().getVersion()));
+        omKeyLocationInfoList.get(0).getProtobuf());
 
     return getOmRequest().toBuilder().setUserInfo(userInfo)
         .setAllocateBlockRequest(newAllocatedBlockRequest).build();
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java
index d7b1445536..244e8c6447 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java
@@ -179,7 +179,7 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
               .setDataSize(effectiveDataSize);
 
       newKeyArgs.addAllKeyLocations(omKeyLocationInfoList.stream()
-          .map(info -> info.getProtobuf(false,
+          .map(info -> info.getProtobuf(
               getOmRequest().getVersion()))
           .collect(Collectors.toList()));
     } else {
@@ -353,7 +353,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
 
       // Prepare response
       omResponse.setCreateKeyResponse(CreateKeyResponse.newBuilder()
-          .setKeyInfo(omKeyInfo.getNetworkProtobuf(getOmRequest().getVersion(),
+          .setKeyInfo(omKeyInfo.getNetworkProtobuf(
               keyArgs.getLatestVersionLocation()))
           .setID(clientID)
           .setOpenVersion(openVersion).build())
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequestWithFSO.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequestWithFSO.java
index 99fabb46de..fe317ea761 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequestWithFSO.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequestWithFSO.java
@@ -201,9 +201,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
 
       // Prepare response. Sets user given full key name in the 'keyName'
       // attribute in response object.
-      int clientVersion = getOmRequest().getVersion();
       omResponse.setCreateKeyResponse(CreateKeyResponse.newBuilder()
-              .setKeyInfo(omFileInfo.getNetworkProtobuf(keyName, clientVersion,
+              .setKeyInfo(omFileInfo.getNetworkProtobuf(keyName,
                   keyArgs.getLatestVersionLocation()))
               .setID(clientID)
               .setOpenVersion(openVersion).build())
diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMRecoverLeaseRequest.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMRecoverLeaseRequest.java
index 590d125081..0e0ad71f52 100644
--- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMRecoverLeaseRequest.java
+++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMRecoverLeaseRequest.java
@@ -31,7 +31,6 @@
 import java.util.stream.Collectors;
 import org.apache.hadoop.hdds.client.RatisReplicationConfig;
 import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
-import org.apache.hadoop.ozone.ClientVersion;
 import org.apache.hadoop.ozone.OzoneConfigKeys;
 import org.apache.hadoop.ozone.OzoneConsts;
 import org.apache.hadoop.ozone.om.helpers.BucketLayout;
@@ -377,7 +376,7 @@ private KeyArgs getNewKeyArgs(OmKeyInfo omKeyInfo, long deltaLength) throws IOEx
         .setDataSize(keyArgs.getDataSize())
         .addAllMetadata(KeyValueUtil.toProtobuf(keyArgs.getMetadata()))
         .addAllKeyLocations(locationInfoList.stream()
-            .map(info -> info.getProtobuf(ClientVersion.CURRENT_VERSION))
+            .map(info -> info.getProtobuf())
             .collect(Collectors.toList()));
     setReplicationConfig(keyArgs.getReplicationConfig(), keyArgsBuilder);
     return keyArgsBuilder.build();

Copy link
Copy Markdown
Contributor Author

@YutaLin YutaLin May 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @szetszwo, thanks for the review
Just wanna confirm that do any RPC paths require pipeline field to be set on the wire for the client to function? It seems to be deleted in the diff above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... do any RPC paths require pipeline field to be set on the wire for the client to function? ...

@YutaLin , you are right that some non-test code may pass ignorePipeline = false to OmKeyInfo .getProtobuf(..). Just the db always set it to true.

Then, we cannot remove it.

Copy link
Copy Markdown
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@adoroszlai adoroszlai marked this pull request as draft May 26, 2026 11:43
@adoroszlai adoroszlai marked this pull request as ready for review May 26, 2026 11:43
@adoroszlai adoroszlai marked this pull request as draft May 26, 2026 11:46
@adoroszlai
Copy link
Copy Markdown
Contributor

Please do not merge yet, need to run CI first, but GitHub Actions is experiencing problems: https://www.githubstatus.com/incidents/gnftqj9htp0ga

@adoroszlai adoroszlai marked this pull request as ready for review May 26, 2026 13:20
@szetszwo szetszwo changed the title HDDS-15349. Remove ignorePipeline from OmKeyInfo.getProtobuf HDDS-15349. Remove the ignorePipeline codec from OmKeyInfo. May 26, 2026
@szetszwo szetszwo changed the title HDDS-15349. Remove the ignorePipeline codec from OmKeyInfo. HDDS-15349. Remove the non-ignorePipeline codec from OmKeyInfo. May 26, 2026
…k:YutaLin/ozone into HDDS-15349_remove_ignorepipeline_from_OMKeyInfo
@peterxcli peterxcli merged commit c477957 into apache:master May 27, 2026
47 checks passed
@peterxcli
Copy link
Copy Markdown
Member

Thanks @szetszwo for the patch, @szetszwo for the review, @adoroszlai for the help of CI!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants