Skip to content
Open
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
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()
};
Comment on lines -176 to -184
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are removing the read replica functionality from autopilot (since it was pretty much just for the db metrics), let's also remove the command line arguments for it. It can be done by changing the deployment (to not configure --db-read-url) and then deploying this PR I presume.

The rolling update strategy has to be taken into consideration.


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
Loading