sumitagrawl commented on code in PR #7149:
URL: https://github.com/apache/ozone/pull/7149#discussion_r1746690591
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/fsck/ContainerHealthTask.java:
##########
@@ -273,34 +278,44 @@ private long processExistingDBRecords(long currentTime,
recordCount++;
UnhealthyContainersRecord rec = cursor.fetchNext();
try {
+ // Set the current container if it's not already set
if (currentContainer == null) {
currentContainer = setCurrentContainer(rec.getContainerId());
}
+ // If the container ID has changed, finish processing the previous
one
if (currentContainer.getContainerID() != rec.getContainerId()) {
completeProcessingContainer(
currentContainer, existingRecords, currentTime,
unhealthyContainerStateCountMap);
existingRecords.clear();
currentContainer = setCurrentContainer(rec.getContainerId());
}
- if (ContainerHealthRecords
- .retainOrUpdateRecord(currentContainer, rec
- )) {
- // Check if the missing container is deleted in SCM
- if (currentContainer.isMissing() &&
- containerDeletedInSCM(currentContainer.getContainer())) {
- rec.delete();
- }
- existingRecords.add(rec.getContainerState());
- if (rec.changed()) {
- rec.update();
- }
- } else {
+
+ // Unhealthy Containers such as MISSING, EMPTY_MISSING,
UNDER_REPLICATED,
+ // OVER_REPLICATED, MIS_REPLICATED can have their unhealthy states
changed or retained.
+ if (!ContainerHealthRecords.retainOrUpdateRecord(currentContainer,
rec)) {
LOG.info("DELETED existing unhealthy container record...for
Container: {}",
currentContainer.getContainerID());
rec.delete();
+ continue;
+ }
+
+ // If the container is marked as MISSING and it's deleted in SCM,
remove the record
+ if (currentContainer.isMissing() &&
containerDeletedInSCM(currentContainer.getContainer())) {
+ rec.delete();
+ }
+
+ // If the container is in the EMPTY_MISSING state, delete the record
+ if (currentContainer.isEmptyMissing()) {
Review Comment:
Do empty missing needs verified from SCM ? missing is possible if DN is not
registered and same can be reported as empty also
--
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]