diff --git a/io-engine/src/grpc/server.rs b/io-engine/src/grpc/server.rs index 44e4bf53a..a347e3edd 100644 --- a/io-engine/src/grpc/server.rs +++ b/io-engine/src/grpc/server.rs @@ -90,7 +90,7 @@ impl MayastorGrpcServer { })) .add_optional_service( enable_v1 - .map(|_| v1::pool::PoolRpcServer::new(PoolService::new())), + .map(|_| v1::pool::PoolRpcServer::new(pool_v1.clone())), ) .add_optional_service(enable_v1.map(|_| { v1::replica::ReplicaRpcServer::new(replica_v1.clone()) diff --git a/io-engine/src/lvs/lvs_store.rs b/io-engine/src/lvs/lvs_store.rs index 0dd32127c..6c389ae99 100644 --- a/io-engine/src/lvs/lvs_store.rs +++ b/io-engine/src/lvs/lvs_store.rs @@ -863,11 +863,20 @@ impl Lvs { .map(Lvol::from_inner_ptr)?; if let Some(id) = entity_id { - let mut lvol_mut = Pin::new(&mut lvol); - lvol_mut.as_mut().set(PropValue::EntityId(id)).await?; + if let Err(error) = + Pin::new(&mut lvol).set(PropValue::EntityId(id)).await + { + let lvol_uuid = lvol.uuid(); + if let Err(error) = lvol.destroy().await { + warn!( + "uuid/{lvol_uuid}: failed to destroy lvol after failing to set entity id: {error:?}", + ); + } + return Err(error); + } } - info!("{:?}: wiping super", lvol); + info!("{lvol:?}: wiping super"); if let Err(error) = lvol.wipe_super().await { // If we fail to destroy it hopefully the control-plane will clean @@ -876,14 +885,13 @@ impl Lvs { let lvol_uuid = lvol.uuid(); if let Err(error) = lvol.destroy().await { warn!( - "uuid/{}: failed to destroy lvol after failing to wipe super: {:?}", - lvol_uuid, error + "uuid/{lvol_uuid}: failed to destroy lvol after failing to wipe super: {error:?}", ); } return Err(error); } - info!("{:?}: created", lvol); + info!("{lvol:?}: created"); lvol.event(EventAction::Create).generate(); Ok(lvol) }