sodonnel commented on code in PR #3360:
URL: https://github.com/apache/ozone/pull/3360#discussion_r1001599903
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerStateManagerImpl.java:
##########
@@ -260,11 +260,23 @@ private void initialize() throws IOException {
}
private Map<LifeCycleEvent, CheckedConsumer<ContainerInfo, IOException>>
- getContainerStateChangeActions() {
+ getContainerStateChangeActions(final Configuration conf) {
final Map<LifeCycleEvent, CheckedConsumer<ContainerInfo, IOException>>
actions = new EnumMap<>(LifeCycleEvent.class);
actions.put(FINALIZE, info -> pipelineManager
.removeContainerFromPipeline(info.getPipelineID(),
info.containerID()));
+
+ boolean shouldRemoveDeletedContainer = conf.getBoolean(
+ ScmConfigKeys.OZONE_SCM_REMOVE_DELETED_CONTAINER_ENABLED,
+ ScmConfigKeys.OZONE_SCM_REMOVE_DELETED_CONTAINER_ENABLED_DEFAULT);
+ if (shouldRemoveDeletedContainer) {
+ // when a CLEANUP event if fired , the state of the container will be
+ // changed to DELETED. at this time, we should remove the reference
+ // of the container from scm. this happens immediately, thus DELETED
+ // is a transient state and hardly be captured.
+ actions.put(CLEANUP, info ->
+ removeContainer(info.containerID().getProtobuf()));
Review Comment:
I am not sure if this is logged anywhere else, but could we ensure a lot
message is written at INFO level saying container xxx has been deleted as it is
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]