xintongsong commented on a change in pull request #8704: [FLINK-12812][runtime] 
Set resource profiles for task slots
URL: https://github.com/apache/flink/pull/8704#discussion_r294208163
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java
 ##########
 @@ -585,7 +585,8 @@ private TaskManagerSlot 
createAndRegisterTaskManagerSlot(SlotID slotId, Resource
        @Nullable
        private PendingTaskManagerSlot 
findExactlyMatchingPendingTaskManagerSlot(ResourceProfile resourceProfile) {
                for (PendingTaskManagerSlot pendingTaskManagerSlot : 
pendingSlots.values()) {
-                       if 
(pendingTaskManagerSlot.getResourceProfile().equals(resourceProfile)) {
+                       // there might be slight error between slot resource 
profiles calculated by RM / TM
+                       if 
(pendingTaskManagerSlot.getResourceProfile().approximate(resourceProfile)) {
 
 Review comment:
   The reason we need approximation is due to precision issue. Currently slot 
profile are calculated on both RM and TM, with the same rules but different 
implementations. As a result, the calculation results may have slight 
difference. We are planing to unify the memory calculation so that RM and TM 
use the same implementation in the next version. Once we have that, the 
approximation could be removed. 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to