Skip to content

Commit

Permalink
Merge #1607
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mayastor-bors and tiagolobocastro committed Mar 18, 2024
2 parents 39922ac + 679dd07 commit 1c36405
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion io-engine/src/grpc/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
20 changes: 14 additions & 6 deletions io-engine/src/lvs/lvs_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down

0 comments on commit 1c36405

Please sign in to comment.