add some logging for undo

This commit is contained in:
Dustin J. Mitchell 2021-12-21 01:12:30 +00:00
parent e328b86d97
commit 5fb3f700c0

View file

@ -1,5 +1,6 @@
use super::apply;
use crate::storage::{ReplicaOp, StorageTxn};
use log::{debug, trace};
/// Undo local operations until an UndoPoint.
pub(super) fn undo(txn: &mut dyn StorageTxn) -> anyhow::Result<bool> {
@ -12,8 +13,10 @@ pub(super) fn undo(txn: &mut dyn StorageTxn) -> anyhow::Result<bool> {
if op == ReplicaOp::UndoPoint {
break;
}
debug!("Reversing operation {:?}", op);
let rev_ops = op.reverse_ops();
for op in rev_ops {
trace!("Applying reversed operation {:?}", op);
apply::apply_op(txn, &op)?;
applied = true;
}