diff --git a/bin/reth/src/commands/db/diff.rs b/bin/reth/src/commands/db/diff.rs index b7c46f42bb..9c098a50b5 100644 --- a/bin/reth/src/commands/db/diff.rs +++ b/bin/reth/src/commands/db/diff.rs @@ -21,7 +21,7 @@ use std::{ io::Write, path::{Path, PathBuf}, }; -use tracing::info; +use tracing::{info, warn}; #[derive(Parser, Debug)] /// The arguments for the `reth db diff` command @@ -58,6 +58,7 @@ impl Command { /// The discrepancies and extra elements, along with a brief summary of the diff results are /// then written to a file in the output directory. pub fn execute(self, tool: &DbTool) -> eyre::Result<()> { + warn!("Make sure the node is not running when running `reth db diff`!"); // open second db let second_db_path: PathBuf = self.secondary_datadir.join("db").into(); let second_db = open_db_read_only(&second_db_path, self.second_db.database_args())?; @@ -68,8 +69,13 @@ impl Command { }; for table in tables { - let primary_tx = tool.provider_factory.db_ref().tx()?; - let secondary_tx = second_db.tx()?; + let mut primary_tx = tool.provider_factory.db_ref().tx()?; + let mut secondary_tx = second_db.tx()?; + + // disable long read transaction safety, since this will run for a while and it's + // expected that the node is not running + primary_tx.disable_long_read_transaction_safety(); + secondary_tx.disable_long_read_transaction_safety(); let output_dir = self.output.clone(); match table {