Skip to content

Commit

Permalink
Merge #1389
Browse files Browse the repository at this point in the history
1389: fix(retire/rebuild): schedule rebuild termination async r=tiagolobocastro a=tiagolobocastro

When retiring don't wait for rebuild to terminate as it may get stuck if the device is not fully retired. It seems that IOs get stuck? For now we simply defer terminate to master reactor.

Co-authored-by: Tiago Castro <[email protected]>
  • Loading branch information
mayastor-bors and tiagolobocastro committed May 24, 2023
2 parents 33faf7a + c968e62 commit d7198e8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "rpc/mayastor-api"]
path = rpc/mayastor-api
url = https://github.com/openebs/mayastor-api
branch = develop
branch = release/2.2
[submodule "spdk-rs"]
path = spdk-rs
url = https://github.com/openebs/spdk-rs
branch = develop
branch = release/2.2
[submodule "utils/io-engine-dependencies"]
path = utils/io-engine-dependencies
url = https://github.com/openebs/mayastor-dependencies.git
branch = develop
branch = release/2.2
6 changes: 4 additions & 2 deletions io-engine/src/bdev/nexus/nexus_bdev_children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,10 @@ impl<'n> Nexus<'n> {
// Cancel rebuild job for this child, if any.
if let Some(job) = child.rebuild_job() {
debug!("{self:?}: retire: stopping rebuild job...");
job.terminate().await.ok();
debug!("{self:?}: retire: rebuild job stopped");
let terminated = job.terminate();
Reactors::master().send_future(async move {
terminated.await.ok();
});
}

let uri = child.uri();
Expand Down
5 changes: 2 additions & 3 deletions io-engine/src/grpc/v0/nexus_grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ fn map_child_state(child: &NexusChild) -> (ChildState, ChildStateReason) {
ChildStateClient::Closed => (Degraded, Closed),
ChildStateClient::Faulted(r) => (
match r {
FaultReason::AdminCommandFailed => Faulted,
FaultReason::IoError => Faulted,
s if s.is_recoverable() => Degraded,
FaultReason::NoSpace => Degraded,
FaultReason::Offline => Degraded,
_ => Faulted,
},
map_fault_reason(r),
Expand Down
5 changes: 2 additions & 3 deletions io-engine/src/grpc/v1/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ fn map_child_state(child: &NexusChild) -> (ChildState, ChildStateReason) {
ChildStateClient::Closed => (Degraded, Closed),
ChildStateClient::Faulted(r) => (
match r {
FaultReason::AdminCommandFailed => Faulted,
FaultReason::IoError => Faulted,
s if s.is_recoverable() => Degraded,
FaultReason::NoSpace => Degraded,
FaultReason::Offline => Degraded,
_ => Faulted,
},
map_fault_reason(r),
Expand Down

0 comments on commit d7198e8

Please sign in to comment.