From f9f3d6fdc58ad29ef8b040298808db890dc00c27 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 23 Sep 2026 02:07:08 +0000 Subject: [PATCH] ci: run the ClickHouse DBMS tests with synchronous mutations The `DBMS Tests (ClickHouse)` job started `clickhouse/clickhouse-server:head` with no overrides, so `ALTER ... DELETE` / `UPDATE` ran asynchronously. When such a mutation finishes between the two reads of one TLP check, the oracle reports a mismatch that is only a race, e.g. `SELECT * FROM t1, t0` returns 132 rows and the partitioned query returns 0 after `ALTER TABLE t0 DELETE WHERE (-773830143) AND (2147483648)`. This made the job red on `main` on 2026-08-17, 08-27, 08-28 and 09-02 and on https://github.com/ClickHouse/sqlancer/pull/18 (twice, every reproducer ending with an asynchronous `ALTER ... DELETE`). Mount the provider's own `.claude/clickhouse-config/*.xml` into the container, the same overrides the ClickHouse nightly job uses: the files with `` (`mutations_sync = 2`, `alter_sync = 2`, `async_insert = 0`) into `users.d`, the rest into `config.d`. The step now also checks that the settings took effect, so a broken mount fails setup instead of producing flaky oracles. https://github.com/ClickHouse/sqlancer/actions/runs/35804199348 Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/main.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63632be3a..5e7d45efc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,10 +64,31 @@ jobs: # Surface symptom: every test fails with "Code: 194 REQUIRED_PASSWORD". Setting # CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 + CLICKHOUSE_SKIP_USER_SETUP=1 keeps the # default-user-passwordless path open without baking a credential into the workflow. + # Use the same server overrides as the ClickHouse nightly job (`.claude/clickhouse-config/`). + # Without `mutations_sync = 2` an `ALTER ... DELETE` can finish between the two reads of one + # oracle check, which then reports a mismatch that is only a race (e.g. 132 rows vs 0 rows + # after `ALTER TABLE t0 DELETE WHERE `). The files with `` go to + # `users.d`, the rest to `config.d`. Each file is mounted separately, so the directories that + # the entrypoint writes to stay writable. + CONFIG_DIR="$PWD/.claude/clickhouse-config" + MOUNTS=() + for f in "$CONFIG_DIR"/*.xml; do + if grep -q '' "$f"; then + MOUNTS+=(-v "$f:/etc/clickhouse-server/users.d/$(basename "$f"):ro") + else + MOUNTS+=(-v "$f:/etc/clickhouse-server/config.d/$(basename "$f"):ro") + fi + done docker run --ulimit nofile=262144:262144 --name clickhouse-server -p8123:8123 -d \ -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_SKIP_USER_SETUP=1 \ + "${MOUNTS[@]}" \ clickhouse/clickhouse-server:head until curl -sf http://127.0.0.1:8123/ping 2>/dev/null; do sleep 1; done + # Fail here rather than in a flaky oracle if the overrides did not take effect. + SETTINGS=$(curl -sf http://127.0.0.1:8123/ --data-binary \ + "SELECT getSetting('mutations_sync'), getSetting('alter_sync'), getSetting('async_insert') FORMAT TSV") + echo "mutations_sync, alter_sync, async_insert: $SETTINGS" + test "$SETTINGS" = "$(printf '2\t2\tfalse')" - name: Run Tests run: CLICKHOUSE_AVAILABLE=true mvn -Djacoco.skip=true -Dtest=ClickHouseBinaryComparisonOperationTest,TestClickHouse,ClickHouseOperatorsVisitorTest,ClickHouseToStringVisitorTest,ClickHouseTypeTest,ClickHouseTypeParserTest,ClickHouseTypeGenerationTest,ClickHouseCastExtensionTest,ClickHouseCODDTestFilterTest,ClickHouseCERTGeneratorTest,ClickHouseTableGeneratorTest test - name: Show fatal errors