manirajv06 commented on code in PR #740:
URL: https://github.com/apache/yunikorn-core/pull/740#discussion_r1409083589


##########
pkg/scheduler/objects/allocation.go:
##########
@@ -152,7 +154,9 @@ func NewAllocationFromSI(alloc *si.Allocation) *Allocation {
                createTime:        time.Unix(creationTime, 0),
                allocLog:          make(map[string]*AllocationLogEntry),
        }
-       return NewAllocation(alloc.UUID, alloc.NodeID, ask)
+       newAlloc := NewAllocation(alloc.NodeID, ask)
+       newAlloc.uuid = alloc.UUID
+       return newAlloc

Review Comment:
   yes, correct.
   
   During recovery, application#addAllocationInternal populates `allocations` 
map with allocation id/uuid. While doing this, entry overrides if key exists. 
It happens while running `TestSchedulerRecovery` in 
`pkg/scheduler/tests/recovery_test.go`. If we don't have this change, this test 
fails. Test has 4 allocations alloc-1-0, alloc-1-1, alloc-2-0 & alloc-2-1. 
After restart, allocations alloc-1-0 & alloc-2-0 change to alloc-1-1 & 
alloc-2-1. So when the actual allocations with the same name later, it 
overrides. Hence test fails.



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