yunikorn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-yunikorn-k8shim] wilfred-s commented on a change in pull request #72: Add ability to support 3rd party K8s operator integration
Date Tue, 25 Feb 2020 00:48:47 GMT
wilfred-s commented on a change in pull request #72: Add ability to support 3rd party K8s operator
integration
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/72#discussion_r383600254
 
 

 ##########
 File path: pkg/shim/scheduler.go
 ##########
 @@ -152,20 +160,42 @@ func (ss *KubernetesShim) recoverSchedulerState() func(e *fsm.Event)
{
 		// do not block main thread
 		go func() {
 			log.Logger.Info("recovering scheduler states")
-			// wait for recovery, max timeout 3 minutes
-			if err := ss.context.WaitForRecovery(3 * time.Minute); err != nil {
+			// step 1: recover all applications
+			// this step, we collect all the existing allocated pods from api-server,
+			// identify the scheduling identity (aka applicationInfo) from the pod,
+			// and then add these applications to the scheduler.
+			if err := ss.appManager.WaitForRecovery(3 * time.Minute); err != nil {
 				// failed
 				log.Logger.Fatal("scheduler recovery failed", zap.Error(err))
 				dispatcher.Dispatch(ShimSchedulerEvent{
 					event: events.RecoverSchedulerFailed,
 				})
-			} else {
-				// success
-				log.Logger.Info("scheduler recovery succeed")
+			}
+
+			// step 2: recover existing allocations
+			// this step, we collect all existing allocations (allocated pods) from api-server,
+			// rerun the scheduling for these allocations in order to restore scheduler-state,
+			// the rerun is like a replay, not a actual scheduling procedure.
+			recoverableApps := make([]interfaces.Recoverable, 0)
 
 Review comment:
   `recoverableApps` is not a list of apps it is a list of managers.
   When reviewing I was put on the wrong track by the naming: it should be called `mgrs`
   
   This also flows on into the parameter naming of the function `context.WaitForRecovery`,
`context.getExistingAllocation` and for `context.recover` it should be `mgrs` not _mgr_

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org


Mime
View raw message