F64116045 commented on code in PR #10928:
URL: https://github.com/apache/ozone/pull/10928#discussion_r3708394102


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/PendingContainerTracker.java:
##########
@@ -148,6 +162,24 @@ synchronized boolean remove(ContainerID containerID) {
     synchronized int getCount() {
       return currentWindow.size() + previousWindow.size();
     }
+
+    /**
+     * Count pending containers of the given storage type.
+     */
+    synchronized int getCount(StorageType storageType) {

Review Comment:
   Thanks for pointing this out, that makes sense!
   
   > Are we fine with this gap of overestimating space in this case ?
   
   I don’t think we should leave that gap. I updated `getCount(StorageType)` to 
handle this conservatively by counting null pending allocations together with 
the requested type. So for example, `getCount(DISK)` now includes both DISK and 
null pending allocations.
   
   I also added a test for this case: 
`testUnknownStorageTypePendingCountsAgainstTypedChecks`.



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