szetszwo commented on code in PR #6178:
URL: https://github.com/apache/ozone/pull/6178#discussion_r1480511488


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerSizeCountTask.java:
##########
@@ -122,6 +123,11 @@ private void process(ContainerInfo container,
       Map<ContainerSizeCountKey, Long> map) {
     final ContainerID id = container.containerID();
     final long currentSize = container.getUsedBytes();
+    if (currentSize < 0) {
+      LOG.error("Negative container size: {} for container: {}", currentSize,
+          id);
+      return;
+    }

Review Comment:
   > ... could there be a scenario where the size is momentarily calculated or 
reported as negative??
   
   It probably is a bug.  Let's don't change the log message since it will hide 
the bug instead of fixing it.



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

Reply via email to