use crate::{
db::{Db, commit::CommitRowOp, registry::StoreRecoveryCapability},
error::InternalError,
traits::CanisterKind,
};
pub(in crate::db) fn replay_commit_marker_row_ops(
db: &Db<impl CanisterKind>,
row_ops: &[CommitRowOp],
) -> Result<(), InternalError> {
for row_op in row_ops {
match row_op_recovery_capability(db, row_op)? {
StoreRecoveryCapability::StableBasePlusJournalReplay => {
return Err(InternalError::store_unsupported());
}
StoreRecoveryCapability::None => {}
}
}
Ok(())
}
fn row_op_recovery_capability(
db: &Db<impl CanisterKind>,
row_op: &CommitRowOp,
) -> Result<StoreRecoveryCapability, InternalError> {
let hooks = db.runtime_hook_for_entity_path(row_op.entity_path.as_ref())?;
let handle = db.store_handle(hooks.store_path)?;
Ok(handle.storage_capabilities().recovery())
}