Skip to content

Commit 1c36405

Browse files
mayastor-borstiagolobocastro
mayastor-bors
andcommitted
Merge #1607
1607: fix(stats/lock): sync calls with pool service r=tiagolobocastro a=tiagolobocastro A new service was being used for the pool, so no sync was in place... Co-authored-by: Tiago Castro <tiagolobocastro@gmail.com>
2 parents 39922ac + 679dd07 commit 1c36405

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

io-engine/src/grpc/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl MayastorGrpcServer {
9090
}))
9191
.add_optional_service(
9292
enable_v1
93-
.map(|_| v1::pool::PoolRpcServer::new(PoolService::new())),
93+
.map(|_| v1::pool::PoolRpcServer::new(pool_v1.clone())),
9494
)
9595
.add_optional_service(enable_v1.map(|_| {
9696
v1::replica::ReplicaRpcServer::new(replica_v1.clone())

io-engine/src/lvs/lvs_store.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,20 @@ impl Lvs {
863863
.map(Lvol::from_inner_ptr)?;
864864

865865
if let Some(id) = entity_id {
866-
let mut lvol_mut = Pin::new(&mut lvol);
867-
lvol_mut.as_mut().set(PropValue::EntityId(id)).await?;
866+
if let Err(error) =
867+
Pin::new(&mut lvol).set(PropValue::EntityId(id)).await
868+
{
869+
let lvol_uuid = lvol.uuid();
870+
if let Err(error) = lvol.destroy().await {
871+
warn!(
872+
"uuid/{lvol_uuid}: failed to destroy lvol after failing to set entity id: {error:?}",
873+
);
874+
}
875+
return Err(error);
876+
}
868877
}
869878

870-
info!("{:?}: wiping super", lvol);
879+
info!("{lvol:?}: wiping super");
871880

872881
if let Err(error) = lvol.wipe_super().await {
873882
// If we fail to destroy it hopefully the control-plane will clean
@@ -876,14 +885,13 @@ impl Lvs {
876885
let lvol_uuid = lvol.uuid();
877886
if let Err(error) = lvol.destroy().await {
878887
warn!(
879-
"uuid/{}: failed to destroy lvol after failing to wipe super: {:?}",
880-
lvol_uuid, error
888+
"uuid/{lvol_uuid}: failed to destroy lvol after failing to wipe super: {error:?}",
881889
);
882890
}
883891
return Err(error);
884892
}
885893

886-
info!("{:?}: created", lvol);
894+
info!("{lvol:?}: created");
887895
lvol.event(EventAction::Create).generate();
888896
Ok(lvol)
889897
}

0 commit comments

Comments
 (0)