adoroszlai commented on a change in pull request #1295:
URL: https://github.com/apache/hadoop-ozone/pull/1295#discussion_r467721841



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestBlockDeletion.java
##########
@@ -82,7 +83,6 @@
 /**
  * Tests for Block deletion.
  */
-@Ignore
 public class TestBlockDeletion {

Review comment:
       Please see #1121 for an attempt to enable this integration test.

##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMBlockDeletingService.java
##########
@@ -109,8 +109,8 @@ public void handlePendingDeletes(PendingDeleteStatusList 
deletionStatusList) {
     DatanodeDetails dnDetails = deletionStatusList.getDatanodeDetails();
     for (PendingDeleteStatusList.PendingDeleteStatus deletionStatus :
         deletionStatusList.getPendingDeleteStatuses()) {
-      LOG.info(
-          "Block deletion txnID mismatch in datanode {} for containerID {}."
+      LOG.debug(
+          "Block deletion txnID behinds in datanode {} for containerID {}."

Review comment:
       ```suggestion
             "Block deletion txnID lagging in datanode {} for containerID {}."
   ```

##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
##########
@@ -312,6 +312,26 @@ private void processContainer(ContainerID id) {
           action -> replicas.stream()
               .noneMatch(r -> r.getDatanodeDetails().equals(action.datanode)));
 
+      if (state == LifeCycleState.CLOSED) {
+        // check container key count and bytes used
+        long maxUsedBytes = 0;
+        long maxKeyCount = 0;
+        ContainerReplica[] rps = replicas.toArray(new ContainerReplica[0]);
+        for (int i = 0; i < rps.length; i++) {
+          maxUsedBytes = Math.max(maxUsedBytes, rps[i].getBytesUsed());
+          maxKeyCount = Math.max(maxKeyCount, rps[i].getKeyCount());
+          LOG.info("Replica key count {}, bytes used {}",
+              rps[i].getKeyCount(), rps[i].getBytesUsed());
+        }
+        if (maxKeyCount < container.getNumberOfKeys()) {
+          container.setNumberOfKeys(maxKeyCount);
+        }
+        if (maxUsedBytes < container.getUsedBytes()) {
+          container.setUsedBytes(maxUsedBytes);
+        }
+        LOG.info("Container key count {}, bytes used {}",
+            container.getNumberOfKeys(), container.getUsedBytes());

Review comment:
       Please extract this block to a new method to keep the level of 
abstraction consistent.




----------------------------------------------------------------
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.

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



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

Reply via email to