fn maybe_cleanup_failed<P: LockablePartition>(
        &mut self,
        db_name: &DatabaseName<'static>,
        partition: &P,
        now: Instant,
    ) {
        let partition = partition.read();
        for (_, chunk) in LockablePartition::chunks(&partition) {
            let chunk = chunk.read();
            if let Some(lifecycle_action) = chunk.lifecycle_action() {
                if lifecycle_action.is_complete()
                    && now
                        .checked_duration_since(lifecycle_action.start_instant())
                        .map(|x| x >= LIFECYCLE_ACTION_BACKOFF)
                        .unwrap_or(false)
                {
                    info!(%db_name, chunk=%chunk.addr(), action=?lifecycle_action.metadata(), "clearing failed lifecycle action");
                    chunk.upgrade().clear_lifecycle_action();
                }
            }
        }
    }
/// Find failed lifecycle actions to cleanup
///
/// Iterates through the chunks in the database, looking for chunks marked with lifecycle
/// actions that are no longer running.
///
/// As success should clear the action, the fact the action is still present but the job
/// is no longer running, implies the job failed
///
/// Clear any such jobs if they exited more than `LIFECYCLE_ACTION_BACKOFF` seconds ago
///
Find failed lifecycle actions to cleanup
Iterates through the chunks in the database, looking for chunks marked with lifecycle
actions that are no longer running.

As success should clear the action, the fact the action is still present but the job
is no longer running, implies the job failed

Clear any such jobs if they exited more than `LIFECYCLE_ACTION_BACKOFF` seconds ago
Find failed lifecycle actions to cleanup Iterates through the chunks in the database looking for chunks marked with lifecycle actions that are no longer running . As success should clear the action the fact the action is still present but the job is no longer running implies the job failed Clear any such jobs if they exited more than ` LIFECYCLE_ACTION_BACKOFF ` seconds ago
fn maybe_cleanup_failed<P: LockablePartition>(
        &mut self,
        db_name: &DatabaseName<'static>,
        partition: &P,
        now: Instant,
    ) {
        let partition = partition.read();
        for (_, chunk) in LockablePartition::chunks(&partition) {
            let chunk = chunk.read();
            if let Some(lifecycle_action) = chunk.lifecycle_action() {
                if lifecycle_action.is_complete()
                    && now
                        .checked_duration_since(lifecycle_action.start_instant())
                        .map(|x| x >= LIFECYCLE_ACTION_BACKOFF)
                        .unwrap_or(false)
                {
                    info!(%db_name, chunk=%chunk.addr(), action=?lifecycle_action.metadata(), "clearing failed lifecycle action");
                    chunk.upgrade().clear_lifecycle_action();
                }
            }
        }
    }
fn maybe_cleanup_failed < P : LockablePartition > ( & mut self , db_name : & DatabaseName < ' static > , partition : & P , now : Instant , ) { let partition = partition . read ( ) ; for ( _ , chunk ) in LockablePartition :: chunks ( & partition ) { let chunk = chunk . read ( ) ; if let Some ( lifecycle_action ) = chunk . lifecycle_action ( ) { if lifecycle_action . is_complete ( ) && now . checked_duration_since ( lifecycle_action . start_instant ( ) ) . map ( | x | x >= LIFECYCLE_ACTION_BACKOFF ) . unwrap_or ( false ) { info ! ( db_name chunk chunk addr ( ) action lifecycle_action metadata ( ) " " ) ; chunk . upgrade ( ) . clear_lifecycle_action ( ) ; } } } }
Find failed lifecycle actions to cleanup
Iterates through the chunks in the database, looking for chunks marked with lifecycle
actions that are no longer running.
Find failed lifecycle actions to cleanup Iterates through the chunks in the database looking for chunks marked with lifecycle actions that are no longer running .
&mut self
db_name
&DatabaseName<'static>
partition
&P
now
Instant
&mut self
db_name
&DatabaseName<'static>
partition
&P
now
Instant