mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-10 07:48:19 -05:00
feat(storage): log debug commit message only on commit (#6918)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -5941,7 +5941,6 @@ dependencies = [
|
||||
"iai",
|
||||
"metrics",
|
||||
"modular-bitfield",
|
||||
"once_cell",
|
||||
"page_size",
|
||||
"parity-scale-codec",
|
||||
"paste",
|
||||
|
||||
@@ -123,12 +123,15 @@ impl<K: TransactionKind> Tx<K> {
|
||||
let (result, commit_latency) = f(tx);
|
||||
let total_duration = start.elapsed();
|
||||
|
||||
debug!(
|
||||
target: "storage::db::mdbx",
|
||||
?total_duration,
|
||||
?commit_latency,
|
||||
"Commit"
|
||||
);
|
||||
if outcome.is_commit() {
|
||||
debug!(
|
||||
target: "storage::db::mdbx",
|
||||
?total_duration,
|
||||
?commit_latency,
|
||||
is_read_only = K::IS_READ_ONLY,
|
||||
"Commit"
|
||||
);
|
||||
}
|
||||
|
||||
(result, commit_latency, total_duration)
|
||||
};
|
||||
|
||||
@@ -187,6 +187,11 @@ impl TransactionOutcome {
|
||||
TransactionOutcome::Drop => "drop",
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the transaction outcome is a commit.
|
||||
pub(crate) const fn is_commit(&self) -> bool {
|
||||
matches!(self, TransactionOutcome::Commit)
|
||||
}
|
||||
}
|
||||
|
||||
/// Types of operations conducted on the database: get, put, delete, and various cursor operations.
|
||||
|
||||
Reference in New Issue
Block a user