You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sumitagrawl (via GitHub)" <gi...@apache.org> on 2023/06/28 16:21:20 UTC
[GitHub] [ozone] sumitagrawl commented on a diff in pull request #4995: HDDS-8062. Persist reason for container replica being marked unhealthy.
sumitagrawl commented on code in PR #4995:
URL: https://github.com/apache/ozone/pull/4995#discussion_r1245470739
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java:
##########
@@ -87,20 +88,46 @@ public KeyValueContainerCheck(String metadataPath, ConfigurationSource conf,
*
* @return true : integrity checks pass, false : otherwise.
*/
- public boolean fastCheck() {
+ public ScanResult fastCheck() {
LOG.debug("Running basic checks for container {};", containerID);
- boolean valid = false;
+
+ // Container directory should exist.
+ File containerDir = new File(metadataPath).getParentFile();
+ if (!containerDir.exists()) {
+ return ScanResult.unhealthy(ScanResult.FailureType.MISSING_CONTAINER_DIR,
+ containerDir, new FileNotFoundException("Container directory " +
+ containerDir + " not found."));
+ }
+
+ // Metadata directory should exist.
+ File metadataDir = new File(metadataPath);
+ if (!metadataDir.exists()) {
+ return ScanResult.unhealthy(ScanResult.FailureType.MISSING_METADATA_DIR,
+ metadataDir, new FileNotFoundException("Metadata directory " +
+ metadataDir + " not found."));
+ }
+
+ File containerFile = KeyValueContainer
+ .getContainerFile(metadataPath, containerID);
try {
- loadContainerData();
- checkLayout();
Review Comment:
checkLayout is removed, and check is provided for existence. But this method used to have directory check and list file check. Do this is required or removed ?
--
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