errose28 commented on a change in pull request #3052:
URL: https://github.com/apache/ozone/pull/3052#discussion_r801921918



##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java
##########
@@ -254,6 +255,13 @@ public static void 
parseKVContainerData(KeyValueContainerData kvContainerData,
       if (!isBlockMetadataSet) {
         initializeUsedBytesAndBlockCount(store, kvContainerData);
       }
+
+      // If the container is missing a chunks directory, possibly due to the
+      // bug fixed by HDDS-6235, create it here.
+      File chunksDir = new File(kvContainerData.getChunksPath());
+      if (!chunksDir.exists()) {

Review comment:
       Hi @guihecheng, thanks for checking out the PR! There's two cases we 
want to fix here:
   1. Empty containers that may need to be replicated in the future.
       - ReplicationManager is supposed to delete these, so this is more of a 
defensive code path.
   2. Existing empty containers that got replicated before this patch and 
HDDS-5359 and lost their chunks directory.
   
   Most of this patch is aimed at the first case, but these lines are aimed at 
the second case. We want to repair the existing containers that already lost 
their chunks directory so they do not get marked unhealthy by the scrubber (if 
running). Also, a container missing its chunks directory will fail replication 
on the datanode even before this patch, so SCM constantly reports it as 
under-replicated. There may be a lot of containers in this state due to the 
issue reported in HDDS-5359, which prevented many empty containers from being 
deleted.




-- 
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-unsubscr...@ozone.apache.org

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



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

Reply via email to