You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/08/03 03:35:33 UTC

[GitHub] [ozone] JacksonYao287 commented on a diff in pull request #3644: HDDS-7077. EC: Fix block deletion not allowed due to missing pipelineID

JacksonYao287 commented on code in PR #3644:
URL: https://github.com/apache/ozone/pull/3644#discussion_r936197083


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -194,13 +194,17 @@ private boolean isDeletionAllowed(ContainerData containerData,
       return false;
     } else if (!containerData.isClosed()) {
       return false;
+    } else if (containerData.getOriginPipelineId() == null

Review Comment:
   what if a ratis container does not have a originPipelineID exceptionally? is it a good behavior to just return true directlly?
   
   IMHO, the problem here is caused by 
   `if (ozoneContainer.getWriteChannel() instanceof XceiverServerRatis)`.
   we should not differentiate containers by the write channel , we should differentiate them by container type. so the code should be like
   ```
   ContainerType contianerType = containerData.getContainerType();
   switch(contianerType) {
   case Ratis:
   return isDeletionAllowedForRatis()
   default:
   //for non-ratis container, they do not have pipelineid
   return true:
   }
   ```
   what is more, we could also add a sanity check for ratis container pipeline in `isDeletionAllowedForRatis()` to make sure the pipelineid is not empty
   



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org