Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stats/lock): sync calls with pool service #1607

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading