Skip to content
Draft
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
24 changes: 0 additions & 24 deletions nexus/db-queries/src/db/datastore/db_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
15 changes: 0 additions & 15 deletions test-utils/src/dev/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
Expand Down
2 changes: 0 additions & 2 deletions test-utils/src/dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading