@@ -30,7 +30,7 @@ pub struct HostosRolloutSubnetAffected {
30
30
pub subnet_size : usize ,
31
31
}
32
32
33
- #[ derive( Eq , PartialEq ) ]
33
+ #[ derive( Eq , PartialEq , Debug ) ]
34
34
pub enum HostosRolloutReason {
35
35
NoNodeHealthy ,
36
36
NoNodeWithoutProposal ,
@@ -275,23 +275,7 @@ impl HostosRollout {
275
275
info ! ( "All valid nodes in the subnet: {} have been updated" , subnet_id) ;
276
276
None
277
277
} else {
278
- if nodes. len ( ) < nodes_to_take {
279
- debug ! (
280
- "Updating all valid nodes ({}) left in the subnet: {}\n \
281
- {}% of all nodes in the subnet",
282
- nodes. len( ) ,
283
- subnet_id,
284
- actual_percent
285
- ) ;
286
- } else {
287
- debug ! (
288
- "Updating {} valid nodes in the subnet: {}\n \
289
- {}% of all nodes in the subnet",
290
- nodes. len( ) ,
291
- subnet_id,
292
- actual_percent
293
- ) ;
294
- }
278
+ info ! ( "Updating {} nodes ({}%) in the subnet {}" , nodes. len( ) , actual_percent, subnet_id, ) ;
295
279
Some ( nodes)
296
280
}
297
281
} )
@@ -385,7 +369,22 @@ impl HostosRollout {
385
369
nodes_with_open_proposals : Vec < UpdateNodesHostosVersionsProposal > ,
386
370
update_group : NodeGroupUpdate ,
387
371
) -> anyhow:: Result < HostosRolloutResponse > {
388
- info ! ( "CANDIDATES SELECTION FOR {:?}" , & update_group) ;
372
+ info ! (
373
+ "CANDIDATES SELECTION FROM {} HEALTHY NODES FOR {} {} {}" ,
374
+ nodes_health
375
+ . iter( )
376
+ . filter_map( |( principal, status) | {
377
+ if * status == Status :: Healthy {
378
+ Some ( principal)
379
+ } else {
380
+ None
381
+ }
382
+ } )
383
+ . count( ) ,
384
+ update_group. maybe_number_nodes. unwrap_or_default( ) ,
385
+ update_group. node_group. owner,
386
+ update_group. node_group. assignment
387
+ ) ;
389
388
390
389
match update_group. node_group . assignment {
391
390
NodeAssignment :: Unassigned => {
@@ -398,13 +397,18 @@ impl HostosRollout {
398
397
CandidatesSelection :: Ok ( candidates_unassigned) => {
399
398
let nodes_to_take = update_group. nodes_to_take ( unassigned_nodes. len ( ) ) ;
400
399
let nodes_to_update = candidates_unassigned. into_iter ( ) . take ( nodes_to_take) . collect :: < Vec < _ > > ( ) ;
400
+ info ! ( "{} candidate nodes selected for: {}" , nodes_to_update. len( ) , update_group. node_group) ;
401
401
Ok ( HostosRolloutResponse :: Ok ( nodes_to_update, None ) )
402
402
}
403
- CandidatesSelection :: None ( reason) => Ok ( HostosRolloutResponse :: None ( vec ! [ ( update_group. node_group, reason) ] ) ) ,
403
+ CandidatesSelection :: None ( reason) => {
404
+ info ! ( "No candidate nodes selected for: {} ==> {:?}" , update_group. node_group, reason) ;
405
+ Ok ( HostosRolloutResponse :: None ( vec ! [ ( update_group. node_group, reason) ] ) )
406
+ }
404
407
}
405
408
}
406
409
NodeAssignment :: Assigned => {
407
410
let assigned_nodes = self . filter_nodes_in_group ( update_group) . await ?;
411
+ info ! ( "{} candidate nodes selected for: {}" , assigned_nodes. len( ) , update_group. node_group) ;
408
412
409
413
match self
410
414
. candidates_selection ( nodes_health, nodes_with_open_proposals, assigned_nodes. clone ( ) )
@@ -428,9 +432,13 @@ impl HostosRollout {
428
432
} )
429
433
. collect :: < Vec < HostosRolloutSubnetAffected > > ( ) ;
430
434
435
+ info ! ( "{} candidate nodes selected for: {}" , nodes_to_update. len( ) , update_group. node_group) ;
431
436
Ok ( HostosRolloutResponse :: Ok ( nodes_to_update, Some ( subnets_affected) ) )
432
437
}
433
- CandidatesSelection :: None ( reason) => Ok ( HostosRolloutResponse :: None ( vec ! [ ( update_group. node_group, reason) ] ) ) ,
438
+ CandidatesSelection :: None ( reason) => {
439
+ info ! ( "No candidate nodes selected for: {} ==> {:?}" , update_group. node_group, reason) ;
440
+ Ok ( HostosRolloutResponse :: None ( vec ! [ ( update_group. node_group, reason) ] ) )
441
+ }
434
442
}
435
443
}
436
444
NodeAssignment :: All => {
@@ -449,14 +457,32 @@ impl HostosRollout {
449
457
)
450
458
. await
451
459
. map ( |response| match response {
452
- ( Ok ( assigned_nodes, subnet_affected) , None ( _) ) => Ok ( assigned_nodes, subnet_affected) ,
453
- ( None ( _) , Ok ( unassigned_nodes, _) ) => Ok ( unassigned_nodes, Option :: None ) ,
460
+ ( Ok ( assigned_nodes, subnet_affected) , None ( reason) ) => {
461
+ info ! ( "No unassigned nodes selected for: {:?} ==> {:?}" , update_group. node_group, reason) ;
462
+ Ok ( assigned_nodes, subnet_affected)
463
+ }
464
+ ( None ( reason) , Ok ( unassigned_nodes, _) ) => {
465
+ info ! ( "No assigned nodes selected for: {:?} ==> {:?}" , update_group. node_group, reason) ;
466
+ Ok ( unassigned_nodes, Option :: None )
467
+ }
454
468
455
469
( Ok ( assigned_nodes, subnet_affected) , Ok ( unassigned_nodes, _) ) => {
470
+ info ! (
471
+ "{} assigned nodes and {} unassigned nodes selected for: {}" ,
472
+ assigned_nodes. len( ) ,
473
+ unassigned_nodes. len( ) ,
474
+ update_group. node_group
475
+ ) ;
456
476
Ok ( assigned_nodes. into_iter ( ) . chain ( unassigned_nodes) . collect ( ) , subnet_affected. clone ( ) )
457
477
}
458
478
459
- ( None ( assigned_reason) , None ( unassigned_reason) ) => None ( assigned_reason. into_iter ( ) . chain ( unassigned_reason) . collect ( ) ) ,
479
+ ( None ( assigned_reason) , None ( unassigned_reason) ) => {
480
+ info ! (
481
+ "No candidate nodes selected for: {:?} ==> {:?} {:?}" ,
482
+ update_group. node_group, assigned_reason, unassigned_reason
483
+ ) ;
484
+ None ( assigned_reason. into_iter ( ) . chain ( unassigned_reason) . collect ( ) )
485
+ }
460
486
} )
461
487
}
462
488
}
0 commit comments