@@ -408,7 +408,6 @@ func UpdateGlobalCoordinationState(
408
408
}
409
409
410
410
processes := GetProcessesFromProcessMap (processGroup .ProcessGroupID , processesMap )
411
-
412
411
var excluded bool
413
412
for _ , process := range processes {
414
413
excluded = excluded || process .Excluded
@@ -418,10 +417,14 @@ func UpdateGlobalCoordinationState(
418
417
// exclusion timestamp set or because the processes are excluded.
419
418
if ! (processGroup .IsExcluded () || excluded ) {
420
419
if _ , ok := pendingForExclusion [processGroup .ProcessGroupID ]; ! ok {
420
+ logger .V (1 ).
421
+ Info ("Adding to pendingForExclusion" , "processGroupID" , processGroup .ProcessGroupID , "reason" , "process group is marked for removal but not excluded" )
421
422
updatesPendingForExclusion [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionAdd
422
423
}
423
424
424
425
if _ , ok := pendingForInclusion [processGroup .ProcessGroupID ]; ! ok {
426
+ logger .V (1 ).
427
+ Info ("Adding to pendingForInclusion" , "processGroupID" , processGroup .ProcessGroupID , "reason" , "process group is marked for removal but not excluded" )
425
428
updatesPendingForInclusion [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionAdd
426
429
}
427
430
} else {
@@ -469,20 +472,29 @@ func UpdateGlobalCoordinationState(
469
472
}
470
473
}
471
474
472
- // If the process group is marked for removal and the resources are stuck in terminating or the processes are not running, we should
473
- // remove them from the restart list, because there are no processes to restart.
474
- if processGroup .GetConditionTime (fdbv1beta2 .ResourcesTerminating ) != nil ||
475
- processGroup .GetConditionTime (fdbv1beta2 .MissingProcesses ) != nil {
476
- if _ , ok := pendingForRestart [processGroup .ProcessGroupID ]; ok {
475
+ // If the process group is stuck in terminating, we can add it to the ready for inclusion list.
476
+ if processGroup .GetConditionTime (fdbv1beta2 .ResourcesTerminating ) != nil {
477
+ if _ , ok := pendingForInclusion [processGroup .ProcessGroupID ]; ! ok {
477
478
logger .V (1 ).
478
- Info ("Removing from pendingForRestart" , "processGroupID" , processGroup .ProcessGroupID , "reason" , "process group is marked for removal" )
479
- updatesPendingForRestart [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionDelete
479
+ Info ("Adding to pendingForInclusion and readyForInclusion" , "processGroupID" , processGroup .ProcessGroupID , "reason" , "process group is marked for removal and in terminating" )
480
+ updatesPendingForInclusion [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionAdd
481
+ updatesReadyForInclusion [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionAdd
480
482
}
481
483
482
- if _ , ok := readyForRestart [processGroup .ProcessGroupID ]; ok {
483
- logger .V (1 ).
484
- Info ("Removing from readyForRestart" , "processGroupID" , processGroup .ProcessGroupID , "reason" , "process group is marked for removal" )
485
- updatesReadyForRestart [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionDelete
484
+ // If the process group is marked for removal and the resources are stuck in terminating or the processes are not running, we should
485
+ // remove them from the restart list, because there are no processes to restart.
486
+ if processGroup .GetConditionTime (fdbv1beta2 .MissingProcesses ) != nil {
487
+ if _ , ok := pendingForRestart [processGroup .ProcessGroupID ]; ok {
488
+ logger .V (1 ).
489
+ Info ("Removing from pendingForRestart" , "processGroupID" , processGroup .ProcessGroupID , "reason" , "process group is marked for removal" )
490
+ updatesPendingForRestart [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionDelete
491
+ }
492
+
493
+ if _ , ok := readyForRestart [processGroup .ProcessGroupID ]; ok {
494
+ logger .V (1 ).
495
+ Info ("Removing from readyForRestart" , "processGroupID" , processGroup .ProcessGroupID , "reason" , "process group is marked for removal" )
496
+ updatesReadyForRestart [processGroup .ProcessGroupID ] = fdbv1beta2 .UpdateActionDelete
497
+ }
486
498
}
487
499
}
488
500
0 commit comments