Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions engine/packages/gasoline/src/db/kv/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use crate::{
};

const EARLY_TXN_TIMEOUT: Duration = Duration::from_secs(3);
const MAX_PRUNES_PER_TXN: usize = 1000;

impl DatabaseKv {
#[tracing::instrument(skip_all)]
Expand Down Expand Up @@ -1377,6 +1378,10 @@ impl DatabaseDebug for DatabaseKv {

prune_count += 1;
new_last_key = [entry.key(), &[0xff]].concat();

if prune_count >= MAX_PRUNES_PER_TXN {
break;
}
}

Ok((prune_count, inserter, new_last_key))
Expand Down
Loading