diff --git a/agent/src/datafile.rs b/agent/src/datafile.rs index 15c1df932..d9dca74c9 100644 --- a/agent/src/datafile.rs +++ b/agent/src/datafile.rs @@ -682,7 +682,7 @@ impl DataFile { * - Already destroyed; no more work to do. */ } - State::Requested | State::Created => { + State::Requested | State::Created | State::Failed => { /* * Schedule the destruction of this region. */ @@ -697,17 +697,6 @@ impl DataFile { self.bell.notify_all(); self.store(inner); } - State::Failed => { - /* - * For now, this terminal state will preserve evidence for - * investigation. - */ - bail!( - "region {} failed to provision and cannot be \ - destroyed", - r.id.0 - ); - } } Ok(()) @@ -773,7 +762,10 @@ impl DataFile { let region = region.unwrap(); match region.state { - State::Requested | State::Destroyed | State::Tombstoned => { + State::Requested + | State::Destroyed + | State::Tombstoned + | State::Failed => { // Either the region hasn't been created yet, or it has been // destroyed or marked to be destroyed (both of which require // that no snapshots exist). Return an empty list. @@ -783,10 +775,6 @@ impl DataFile { State::Created => { // proceed to next section } - - State::Failed => { - bail!("region.state is failed!"); - } } let mut path = self.base_path.to_path_buf(); diff --git a/agent/src/main.rs b/agent/src/main.rs index 8be2507ae..879c4ca3b 100644 --- a/agent/src/main.rs +++ b/agent/src/main.rs @@ -206,7 +206,7 @@ impl ZFSDataset { if i == 4 { bail!( - "zfs list mountpoint failed! out:{} err:{}", + "zfs destroy dataset failed! out:{} err:{}", out, err ); @@ -1589,15 +1589,7 @@ fn worker( &r.id.0, e, ); - if let Err(e) = df.destroyed(&r.id) { - error!( - log, - "Dataset {} destruction failed: {}", - &r.id.0, - e, - ); - df.fail(&r.id); - } + df.fail(&r.id); break 'requested; } }; @@ -1699,7 +1691,7 @@ fn worker( r.id.0, e, ); - df.fail(&r.id); + let _ = df.destroyed(&r.id); break 'tombstoned; } };