1996fanrui commented on code in PR #19499:
URL: https://github.com/apache/flink/pull/19499#discussion_r901698881


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java:
##########
@@ -298,7 +318,11 @@ public int getNumBuffers() {
 
     @Override
     public int bestEffortGetNumOfUsedBuffers() {
-        return Math.max(0, numberOfRequestedMemorySegments - 
availableMemorySegments.size());
+        return Math.max(
+                0,
+                numberOfRequestedMemorySegments
+                        + numberOfRequestedOverdraftMemorySegments
+                        - availableMemorySegments.size());

Review Comment:
   Thanks for your reminder. 
   
   I prefer report the pool usage was > 100% if overdraft buffers are being 
used. Because the overdraft buffer is overused, it doesn’t belong inside the 
LocalBufferPool. So I prefer it, what do you think?
   
   I updated the metric doc and added some check bestEffortGetNumOfUsedBuffers 
in unit tests.



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

Reply via email to