sumitagrawl commented on code in PR #8566:
URL: https://github.com/apache/ozone/pull/8566#discussion_r2158520515


##########
hadoop-hdds/interface-client/src/main/proto/hdds.proto:
##########
@@ -408,6 +408,11 @@ message BlockID {
     optional uint64 blockCommitSequenceId = 2 [default = 0];
 }
 
+message DeletedBlock {

Review Comment:
   This needs to be part of ScmServerProtocol.proto as this is specific for 
om-scm communication



##########
hadoop-hdds/interface-server/src/main/proto/ScmServerProtocol.proto:
##########
@@ -167,7 +167,13 @@ message AllocateScmBlockRequestProto {
  * multiple number of keys (and their blocks).
  */
 message DeleteScmKeyBlocksRequestProto {
-  repeated KeyBlocks keyBlocks = 1;
+
+  // Field kept for rolling upgrades.  It contains KeyBlocks without
+  // per-block size information.
+  repeated KeyBlocks keyBlocks = 1 [deprecated = true];

Review Comment:
   KeyBlocks is used only for this deleteBlock api, so this may not need to be 
removed. But message having DeletedKeyBlocks can be changed. Also do we need 
support compatibility between om and scm ?



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/ScmBlockLocationProtocolClientSideTranslatorPB.java:
##########
@@ -229,12 +230,20 @@ public List<AllocatedBlock> allocateBlock(
    */
   @Override
   public List<DeleteBlockGroupResult> deleteKeyBlocks(
-      List<BlockGroup> keyBlocksInfoList) throws IOException {
-    List<KeyBlocks> keyBlocksProto = keyBlocksInfoList.stream()
-        .map(BlockGroup::getProto).collect(Collectors.toList());
+      List<DeletedBlockGroup> keyBlocksInfoList) throws IOException {
+    List<DeletedKeyBlocks> dkProto = keyBlocksInfoList.stream()
+        .map(DeletedBlockGroup::getProto)
+        .collect(Collectors.toList());
+
+// Build KeyBlocks (legacy format, no usedBytes)
+    List<KeyBlocks> legacy = keyBlocksInfoList.stream()
+        .map(DeletedBlockGroup::getLegacyProto)
+        .collect(Collectors.toList());
+
     DeleteScmKeyBlocksRequestProto request = DeleteScmKeyBlocksRequestProto
         .newBuilder()
-        .addAllKeyBlocks(keyBlocksProto)
+        .addAllDeletedKeyBlocks(dkProto)   // new field (#2)

Review Comment:
   when we are going to stop twice list? it will increase message size by 
double,. but we have config to send higher message. So check how to avoid this?



-- 
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]

Reply via email to