kerneltime commented on code in PR #4367:
URL: https://github.com/apache/ozone/pull/4367#discussion_r1132987250
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java:
##########
@@ -159,6 +160,26 @@ public static void removeContainer(KeyValueContainerData
containerData,
FileUtils.deleteDirectory(containerMetaDataPath.getParentFile());
}
+ /**
+ * Returns if there are no blocks in the container.
+ * @param containerData Container to check
+ * @param conf configuration
+ * @return true if the directory containing blocks is empty
+ * @throws IOException
+ */
+ public static boolean noBlocksInContainer(KeyValueContainerData
Review Comment:
The read data is the block. We should work towards making sure blocks are
written only if valid, and if they are on disk, we should err towards not
cleaning them up. Even with HDDS-8138, I would like to keep this check in
place. We can get HDDS-8117 in but while that is being worked on we should
check in this fix to avoid any data loss which is the main motivation for this
PR.
--
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]