From fe850496ee861ae58a5f5dd07185474a5833d93a Mon Sep 17 00:00:00 2001 From: Sean Klein Date: Wed, 18 Mar 2026 14:40:48 -0700 Subject: [PATCH] Undo disabling synchronous writeback --- .../src/db/datastore/db_metadata.rs | 24 ------------------- test-utils/src/dev/db.rs | 15 ------------ test-utils/src/dev/mod.rs | 2 -- 3 files changed, 41 deletions(-) diff --git a/nexus/db-queries/src/db/datastore/db_metadata.rs b/nexus/db-queries/src/db/datastore/db_metadata.rs index 487bc774fdf..e431be668d7 100644 --- a/nexus/db-queries/src/db/datastore/db_metadata.rs +++ b/nexus/db-queries/src/db/datastore/db_metadata.rs @@ -2698,10 +2698,6 @@ mod test { .max_sql_memory_mib(32); let starter = builder.build().expect("Failed to build CRDB starter"); let mut instance = starter.start().await.expect("Failed to start CRDB"); - instance - .disable_synchronization() - .await - .expect("Failed to disable synchronization"); let client = instance.connect().await.expect("Failed to connect to CRDB"); @@ -2881,10 +2877,6 @@ mod test { .max_sql_memory_mib(32); let starter = builder.build().expect("Failed to build CRDB starter"); let mut instance = starter.start().await.expect("Failed to start CRDB"); - instance - .disable_synchronization() - .await - .expect("Failed to disable synchronization"); let client = instance.connect().await.expect("Failed to connect to CRDB"); @@ -3025,10 +3017,6 @@ mod test { .max_sql_memory_mib(32); let starter = builder.build().expect("Failed to build CRDB starter"); let mut instance = starter.start().await.expect("Failed to start CRDB"); - instance - .disable_synchronization() - .await - .expect("Failed to disable synchronization"); let client = instance.connect().await.expect("Failed to connect to CRDB"); @@ -3165,10 +3153,6 @@ mod test { .max_sql_memory_mib(32); let starter = builder.build().expect("Failed to build CRDB starter"); let mut instance = starter.start().await.expect("Failed to start CRDB"); - instance - .disable_synchronization() - .await - .expect("Failed to disable synchronization"); let client = instance.connect().await.expect("Failed to connect to CRDB"); @@ -3322,10 +3306,6 @@ mod test { .max_sql_memory_mib(32); let starter = builder.build().expect("Failed to build CRDB starter"); let mut instance = starter.start().await.expect("Failed to start CRDB"); - instance - .disable_synchronization() - .await - .expect("Failed to disable synchronization"); let client = instance.connect().await.expect("Failed to connect to CRDB"); @@ -3467,10 +3447,6 @@ mod test { .max_sql_memory_mib(32); let starter = builder.build().expect("Failed to build CRDB starter"); let mut instance = starter.start().await.expect("Failed to start CRDB"); - instance - .disable_synchronization() - .await - .expect("Failed to disable synchronization"); let client = instance.connect().await.expect("Failed to connect to CRDB"); diff --git a/test-utils/src/dev/db.rs b/test-utils/src/dev/db.rs index 1e71888637f..7145d1e664b 100644 --- a/test-utils/src/dev/db.rs +++ b/test-utils/src/dev/db.rs @@ -643,21 +643,6 @@ impl CockroachInstance { client.cleanup().await.context("cleaning up after wipe") } - /// Disables fsync synchronization for the underlying storage layer. - /// - /// This is not a recommended operation in production, but it can - /// drastically improve the performance of test databases. - pub async fn disable_synchronization(&self) -> Result<(), anyhow::Error> { - let client = self.connect().await.context("connect")?; - client.batch_execute( - "SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = true" - ).await.context("disabling database synchronization")?; - client - .cleanup() - .await - .context("cleaning up after changing cluster settings") - } - /// Wrapper around [`populate()`] using a connection to this database. pub async fn populate(&self) -> Result<(), anyhow::Error> { let client = self.connect().await.context("connect")?; diff --git a/test-utils/src/dev/mod.rs b/test-utils/src/dev/mod.rs index 5a37ac2549e..6c56eee6af3 100644 --- a/test-utils/src/dev/mod.rs +++ b/test-utils/src/dev/mod.rs @@ -132,8 +132,6 @@ async fn setup_database( let db_url = database.pg_config(); info!(&log, "cockroach listen URL: {}", db_url); - database.disable_synchronization().await.expect("Failed to disable fsync"); - // If we populate the storage directory by importing the '.sql' // file, we must do so after the DB has started. match &storage_source {