Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions crates/autopilot/src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ pub struct Arguments {
#[clap(long, env, default_value = "postgresql://")]
pub db_write_url: Url,

/// Url of the Postgres database replica. By default it's the same as
/// db_write_url
#[clap(long, env)]
pub db_read_url: Option<Url>,

/// The number of order events to insert in a single batch.
#[clap(long, env, default_value = "500")]
pub insert_batch_size: NonZeroUsize,
Expand Down Expand Up @@ -389,7 +384,6 @@ impl std::fmt::Display for Arguments {
order_events_cleanup_interval,
order_events_cleanup_threshold,
db_write_url,
db_read_url,
insert_batch_size,
native_price_estimation_results_required,
max_settlement_transaction_wait,
Expand Down Expand Up @@ -417,7 +411,6 @@ impl std::fmt::Display for Arguments {
writeln!(f, "ethflow_indexing_start: {ethflow_indexing_start:?}")?;
writeln!(f, "metrics_address: {metrics_address}")?;
display_secret_option(f, "db_write_url", Some(&db_write_url))?;
display_secret_option(f, "db_read_url", db_read_url.as_ref())?;
writeln!(f, "skip_event_sync: {skip_event_sync}")?;
writeln!(f, "allowed_tokens: {allowed_tokens:?}")?;
writeln!(f, "unsupported_tokens: {unsupported_tokens:?}")?;
Expand Down
1 change: 0 additions & 1 deletion crates/autopilot/src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ pub fn run_database_metrics_work(db: Postgres) {
let span = tracing::info_span!("database_metrics");
// Spawn the task for updating large table statistics
tokio::spawn(update_large_tables_stats(db.clone()).instrument(span.clone()));

// Spawn the task for database metrics
tokio::task::spawn(database_metrics(db).instrument(span));
}
Expand Down
14 changes: 3 additions & 11 deletions crates/autopilot/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,9 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) {
.await
.unwrap();

let db_read = if let Some(db_read_url) = args.db_read_url
&& args.db_write_url != db_read_url
{
Postgres::new(db_read_url.as_str(), args.insert_batch_size)
.await
.expect("failed to create read replica database")
} else {
db_write.clone()
};

crate::database::run_database_metrics_work(db_read.clone());
// If the DB is in read-only mode, running ANALYZE is not possible and will
// trigger and error https://www.postgresql.org/docs/current/hot-standby.html
crate::database::run_database_metrics_work(db_write.clone());

let http_factory = HttpClientFactory::new(&args.http_client);
let web3 = shared::ethrpc::web3(
Expand Down
4 changes: 2 additions & 2 deletions crates/e2e/src/setup/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ impl<'a> Services<'a> {
"--hooks-contract-address={:?}",
self.contracts.hooks.address()
),
"--db-read-url".to_string(),
LOCAL_READ_ONLY_DB_URL.clone(),
]
.into_iter()
}
Expand Down Expand Up @@ -236,6 +234,8 @@ impl<'a> Services<'a> {
"orderbook".to_string(),
"--quote-timeout=10s".to_string(),
"--quote-verification=enforce-when-possible".to_string(),
"--db-read-url".to_string(),
LOCAL_READ_ONLY_DB_URL.clone(),
]
.into_iter()
.chain(self.api_autopilot_solver_arguments())
Expand Down
Loading