@@ -438,56 +438,6 @@ impl ServiceInner {
438438 Ok ( ( ) )
439439 }
440440
441- /// Waits for sufficient neighbors to exist so the initial set of requests
442- /// can be sent out.
443- async fn wait_for_peers (
444- & self ,
445- expectation : & HashSet < Ipv6Addr > ,
446- our_bootstrap_address : Ipv6Addr ,
447- ) -> Result < Vec < Ipv6Addr > , DdmError > {
448- let ddm_admin_client = DdmAdminClient :: localhost ( & self . log ) ?;
449- let addrs = retry_notify (
450- retry_policy_internal_service_aggressive ( ) ,
451- || async {
452- let peer_addrs = ddm_admin_client
453- . derive_bootstrap_addrs_from_prefixes ( & [
454- BootstrapInterface :: GlobalZone ,
455- ] )
456- . await
457- . map_err ( |err| {
458- BackoffError :: transient ( format ! (
459- "Failed getting peers from mg-ddm: {err}"
460- ) )
461- } ) ?;
462-
463- let all_addrs = peer_addrs
464- . chain ( iter:: once ( our_bootstrap_address) )
465- . collect :: < HashSet < _ > > ( ) ;
466-
467- if all_addrs. is_superset ( expectation) {
468- Ok ( all_addrs. into_iter ( ) . collect ( ) )
469- } else {
470- Err ( BackoffError :: transient (
471- "Waiting for a set of peers not found yet" . to_string ( ) ,
472- ) )
473- }
474- } ,
475- |message, duration| {
476- info ! (
477- self . log,
478- "{} (will retry after {:?})" , message, duration
479- ) ;
480- } ,
481- )
482- // `retry_policy_internal_service_aggressive()` retries indefinitely on
483- // transient errors (the only kind we produce), allowing us to
484- // `.unwrap()` without panicking
485- . await
486- . unwrap ( ) ;
487-
488- Ok ( addrs)
489- }
490-
491441 async fn sled_timesync (
492442 & self ,
493443 sled_address : & SocketAddrV6 ,
@@ -897,7 +847,7 @@ impl ServiceInner {
897847 // Wait for either:
898848 // - All the peers to re-load an old plan (if one exists)
899849 // - Enough peers to create a new plan (if one does not exist)
900- let expected_peers = match & config. bootstrap_discovery {
850+ let bootstrap_addrs = match & config. bootstrap_discovery {
901851 BootstrapAddressDiscovery :: OnlyOurs => {
902852 HashSet :: from ( [ local_bootstrap_agent. our_address ( ) ] )
903853 }
@@ -907,18 +857,15 @@ impl ServiceInner {
907857 if let Some ( plan) = & maybe_sled_plan {
908858 let stored_peers: HashSet < Ipv6Addr > =
909859 plan. sleds . keys ( ) . map ( |a| * a. ip ( ) ) . collect ( ) ;
910- if stored_peers != expected_peers {
860+ if stored_peers != bootstrap_addrs {
911861 return Err ( SetupServiceError :: BadConfig ( "Set of sleds requested does not match those in existing sled plan" . to_string ( ) ) ) ;
912862 }
913863 }
914-
915- let addrs = self
916- . wait_for_peers (
917- & expected_peers,
918- local_bootstrap_agent. our_address ( ) ,
919- )
920- . await ?;
921- info ! ( self . log, "Enough peers exist to enact RSS plan" ) ;
864+ if bootstrap_addrs. is_empty ( ) {
865+ return Err ( SetupServiceError :: BadConfig (
866+ "Must request at least one peer" . to_string ( ) ,
867+ ) ) ;
868+ }
922869
923870 // If we created a plan, reuse it. Otherwise, create a new plan.
924871 //
@@ -931,7 +878,7 @@ impl ServiceInner {
931878 plan
932879 } else {
933880 info ! ( self . log, "Creating new allocation plan" ) ;
934- SledPlan :: create ( & self . log , config, addrs ) . await ?
881+ SledPlan :: create ( & self . log , config, bootstrap_addrs ) . await ?
935882 } ;
936883 let config = & plan. config ;
937884
0 commit comments