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