wilfred-s commented on a change in pull request #321:
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/321#discussion_r747162799



##########
File path: pkg/cache/node.go
##########
@@ -149,10 +149,13 @@ func (n *SchedulerNode) handleNodeRecovery(event 
*fsm.Event) {
                zap.String("nodeID", n.name),
                zap.Bool("schedulable", n.schedulable))
 
-       request := &si.UpdateRequest{
+       allocRequest := &si.AllocationRequest{
                Asks:     nil,
                Releases: nil,
-               NewSchedulableNodes: []*si.NewNodeInfo{
+               RmID:     conf.GetSchedulerConf().ClusterID,
+       }

Review comment:
       Sending this would be a nop in the core. The core checks for the length 
of Asks and Releases and if they are zero (0) we just return without doing 
anything. See `handleRMUpdateAllocationEvent()`

##########
File path: pkg/cache/node.go
##########
@@ -197,23 +209,32 @@ func (n *SchedulerNode) handleDrainNode(event *fsm.Event) 
{
        }
 
        // send request to scheduler-core
-       if err := n.schedulerAPI.Update(request); err != nil {
-               log.Logger().Error("failed to send request",
-                       zap.Any("request", request))
+       if err := n.schedulerAPI.UpdateAllocation(allocRequest); err != nil {
+               log.Logger().Error("failed to send UpdateAllocation request",
+                       zap.Any("request", allocRequest))
+       }
+
+       // send request to scheduler-core
+       if err := n.schedulerAPI.UpdateNode(nodeRequest); err != nil {
+               log.Logger().Error("failed to send UpdateNode request",
+                       zap.Any("request", nodeRequest))
        }
 }
 
 func (n *SchedulerNode) handleRestoreNode(event *fsm.Event) {
        log.Logger().Info("restore node from draining mode",
                zap.String("nodeID", n.name))
 
-       request := &si.UpdateRequest{
+       allocRequest := &si.AllocationRequest{
                Asks:     nil,
                Releases: nil,
-               UpdatedNodes: []*si.UpdateNodeInfo{
+               RmID:     conf.GetSchedulerConf().ClusterID,
+       }

Review comment:
       Same here: this is a nop on the core side

##########
File path: pkg/cache/node.go
##########
@@ -163,29 +166,38 @@ func (n *SchedulerNode) handleNodeRecovery(event 
*fsm.Event) {
                                        
constants.DefaultNodeAttributeNodeLabelsKey: n.labels,
                                },
                                ExistingAllocations: n.existingAllocations,
+                               Action:              si.NodeInfo_CREATE,
                        },
                },
                RmID: conf.GetSchedulerConf().ClusterID,
        }
 
-       // send request to scheduler-core
-       if err := n.schedulerAPI.Update(request); err != nil {
-               log.Logger().Error("failed to send request",
-                       zap.Any("request", request))
+       // send alloc request to scheduler-core
+       if err := n.schedulerAPI.UpdateAllocation(allocRequest); err != nil {
+               log.Logger().Error("failed to send UpdateAllocation request",
+                       zap.Any("request", allocRequest))
+       }
+       // send node request to scheduler-core
+       if err := n.schedulerAPI.UpdateNode(nodeRequest); err != nil {
+               log.Logger().Error("failed to send UpdateNode request",
+                       zap.Any("request", nodeRequest))
        }
 }
 
 func (n *SchedulerNode) handleDrainNode(event *fsm.Event) {
        log.Logger().Info("node enters draining mode",
                zap.String("nodeID", n.name))
 
-       request := &si.UpdateRequest{
+       allocRequest := &si.AllocationRequest{
                Asks:     nil,
                Releases: nil,
-               UpdatedNodes: []*si.UpdateNodeInfo{
+               RmID:     conf.GetSchedulerConf().ClusterID,
+       }

Review comment:
       Same here: this is a nop on the core side




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