From c6e564caf0afdef474c83f0f1a2bd00e5f01548c Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Sat, 12 Sep 2026 10:34:58 +0000 Subject: [PATCH] [management] Keep per-table tablespaces in the MySQL test container With innodb_file_per_table off, the packages that create hundreds of databases per run got slower, not faster, while the small ones sped up: dropped databases leave the shared system tablespace to grow and fragment, so every later CREATE and DROP pays for it. Keep the default per-table files and only skip the redo, binary log and doublewrite fsyncs. The temporary timing workflow also prints a short disk and CPU calibration so a slow runner can be told apart from a slow change. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01EsVtbd7MxMVsS9vP1H6KPS --- .github/workflows/tmp-management-timing.yml | 8 ++++++++ management/server/testutil/store.go | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tmp-management-timing.yml b/.github/workflows/tmp-management-timing.yml index 46bc4f2e7..4e6237356 100644 --- a/.github/workflows/tmp-management-timing.yml +++ b/.github/workflows/tmp-management-timing.yml @@ -68,6 +68,14 @@ jobs: docker pull mlsmaycon/warmed-mysql:8 docker image inspect mlsmaycon/warmed-mysql:8 --format 'entrypoint={{json .Config.Entrypoint}} cmd={{json .Config.Cmd}} env={{json .Config.Env}}' + - name: Runner calibration + run: | + nproc + grep -m1 "model name" /proc/cpuinfo + time dd if=/dev/zero of=/tmp/calib bs=1M count=256 conv=fsync + time sh -c 'for i in $(seq 1 200); do dd if=/dev/zero of=/tmp/calib-$i bs=4k count=1 conv=fsync 2>/dev/null; done' + rm -f /tmp/calib* + - name: Build test summarizer run: go build -o /tmp/gotestsummary ./tools/gotestsummary diff --git a/management/server/testutil/store.go b/management/server/testutil/store.go index aac60f7e8..3854c1173 100644 --- a/management/server/testutil/store.go +++ b/management/server/testutil/store.go @@ -39,11 +39,12 @@ func CreateMysqlTestContainer() (func(), string, error) { mysql.WithPassword("testing"), // Every test creates and drops a database with about 40 tables, so with // the server defaults the run is dominated by durability work: each - // CREATE TABLE creates and fsyncs its own tablespace file and fsyncs the - // redo and binary logs. None of it protects anything in a container that - // is discarded after the run. + // CREATE TABLE fsyncs the redo log, the binary log and the doublewrite + // buffer. None of it protects anything in a container that is discarded + // after the run. Tables stay in per-table files on purpose: in the shared + // system tablespace the cost of every CREATE and DROP grew with the number + // of databases the run had already created. testcontainers.WithCmd("mysqld", - "--innodb-file-per-table=OFF", "--innodb-flush-log-at-trx-commit=0", "--innodb-doublewrite=OFF", "--skip-log-bin",