Skip to content

Commit 459d8aa

Browse files
shba24Isaac
andcommitted
[Build] Explain the test-only server settings of the MySQL and PostgreSQL containers
Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
1 parent 8933077 commit 459d8aa

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎server/src/test/java/io/unitycatalog/server/testdatabase/MySqlDatabases.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ JdbcDatabaseContainer<?> newContainer(String image) {
4040
// The root user may create and drop databases; the default test user may not.
4141
return new MySQLContainer<>(image)
4242
.withUsername("root")
43+
// Test-only speed settings (data is thrown away):
4344
.withCommand(
44-
"--innodb-flush-log-at-trx-commit=0", "--skip-log-bin", "--innodb-doublewrite=OFF");
45+
// Flush the redo log about once a second instead of at every commit.
46+
"--innodb-flush-log-at-trx-commit=0",
47+
// No binary log (no replication or point-in-time recovery needed).
48+
"--skip-log-bin",
49+
// No doublewrite buffer (it only guards against torn pages on a crash).
50+
"--innodb-doublewrite=OFF");
4551
}
4652

4753
@Override

‎server/src/test/java/io/unitycatalog/server/testdatabase/PostgresDatabases.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ static synchronized PostgresDatabases get() {
2525
@Override
2626
JdbcDatabaseContainer<?> newContainer(String image) {
2727
return new PostgreSQLContainer<>(image)
28+
// Test-only speed settings (data is thrown away):
2829
.withCommand(
2930
"postgres",
31+
// Do not wait for writes to reach the disk.
3032
"-c",
3133
"fsync=off",
34+
// Report a commit before its WAL record is on disk.
3235
"-c",
3336
"synchronous_commit=off",
37+
// No full page images in the WAL (they only guard against torn pages on a crash).
3438
"-c",
3539
"full_page_writes=off");
3640
}

0 commit comments

Comments
 (0)