Repository navigation
Update SQLancer to ClickHouse/sqlancer PR #4 (client-v2 driver, 25 oracles) - #108660
Merged
Merged
Conversation
…acles) Bump the SQLancer provider to ClickHouse/sqlancer `main` after PR #4 (ClickHouse/sqlancer#4): the wrong-result oracle suite with 31 oracles, a recursive type system, and the `com.clickhouse:client-v2` (RowBinary) transport replacing `clickhouse-jdbc`. Docker image (`ci/docker/sqlancer-test/Dockerfile`): - Bump the cloned commit to `a62ea509ee53862b5dd37f452e8c2edce8038951`. - The new `pom.xml` targets Java 25, which Ubuntu 22.04 `default-jdk`/`maven` cannot build, so install Temurin JDK 25 (Adoptium) and Maven 3.9.9, and add `-Djacoco.skip=true` to the build (jacoco 0.8.12 rejects Java 25 classfiles). Job script (`ci/jobs/sqlancer_job.sh`): - Apply the provider's server-side config overrides from `.claude/clickhouse-config/` (logger to `warning`, remove `system.trace_log`, TTL the system-log tables, pin `async_insert` off) by starting the server from a directory containing `config.d/`; the embedded default `config.xml` still merges `config.d/*.xml` relative to the server CWD. - Replace the per-oracle loop with a single combined run of all 25 oracles bounded by one wall-clock timeout, matching the upstream `.claude/run-sqlancer.sh` reference, and enable `--random-session-settings`.
Contributor
|
Workflow [PR], commit [8b11e90] Summary: ✅ AI ReviewSummaryThis PR re-enables SQLancer as a dedicated scheduled Praktika workflow, updates the Final VerdictStatus: ✅ Approve |
The SQLancer job definition (`sqlancer_master_jobs`) has been orphaned since PR #105199 ("Remove SQLancer from CI", 2026-05-18) deleted its references from the `master` and `pull_request` workflows, so it ran nowhere. Add a dedicated scheduled workflow `NightlySQLancer`, mirroring `NightlyJepsen`: it builds the `amd_debug` binary (to provide `CH_AMD_DEBUG`) and runs the SQLancer job nightly on `master`, with its own report and CIDB. This keeps the specialized correctness fuzzer isolated from other workflows' reports/alerts, matching how Jepsen, Keeper-faults, and VectorSearchStress are wired.
- The `clickhouse/sqlancer-test` image is built for both arm and amd (`platforms=arm_amd`), but `JAVA_HOME` was hardcoded to the amd64 Temurin path, which would break the arm64 image build (the path is `-arm64` there, and `mvn package` runs during the build). Symlink the arch-specific Temurin dir to a stable `/usr/lib/jvm/temurin-25-jdk` and point `JAVA_HOME` at it. - Correct the config-override comment in the job script: the merged provider ships `system_logs_disabled.xml` (full `remove`, not a TTL) and `alter_mutation_sync.xml`. Verified empirically that with the binary's embedded config (`users_config` == `config.xml`), `<profiles>` overrides in `config.d/` reach the default profile (`async_insert=0`, `alter_sync=2`, `mutations_sync=2`), so all overrides belong in `config.d/` -- the packaged server's `users.d/` split would silently drop the mutation-sync settings.
…random settings Validated end-to-end against `clickhouse/clickhouse-server:head` with the rebuilt image; three issues that broke the run: - `--random-session-settings` was placed before the `clickhouse` subcommand, but it is a provider option (same class as `--oracle`), so JCommander rejected it with `MissingCommandException`. It is also rejected together with the `SEMR`/`SEMRMulti` oracles (which toggle settings themselves). Drop it: those oracles already provide setting-differential coverage. - The hardcoded oracle list was stale (e.g. `RowPolicy` was removed upstream and the curated set grew to 94). Derive it from the provider's own `ALL_ORACLES` (`run-sqlancer.sh`, the `--oracles all` set) so it stays in sync with whatever commit the image pins; fail closed if it cannot be parsed. After the fixes the full curated run executes cleanly (driver connects, configs apply, ~5k queries across the oracle fleet in a short smoke run).
`TextIndexDirectRead` asserts that a text-index `hasToken` lookup with `use_skip_indexes` on matches a full scan, but it currently dominates the all-oracle run with known index-vs-scan divergences across several tokenizers (cf. ClickHouse#107186), which would keep the nightly job perpetually red on the same finding. Filter it out of the derived oracle list (exact-element match, so the sibling `TextIndex*` oracles are kept) until that divergence class is resolved upstream.
Switch the SQLancer job (and its debug-build dependency) from amd to arm: the job now requires `CH_ARM_DEBUG` and runs on `arm-medium`, and NightlySQLancer builds `arm_debug` (on `arm-large`) to provide it. The server binary's architecture must match the runner, so both the build and the run move to ARM together. The `clickhouse/sqlancer-test` image is already multi-arch (`platforms=arm_amd`) and its arm variant builds in CI, and the SQLancer driver (Java) is architecture-independent.
- Increase the sqlancer run to 5h (`TIMEOUT=18000` in sqlancer_job.sh) and raise the job timeout to 5h30m to cover server start/teardown. - Run every 3 days instead of nightly (`cron: 13 6 */3 * *`); a 5h run does not need to fire daily. - Build and test against `arm_ubsan` instead of `arm_debug`: a long fuzzing run is a good place to surface undefined behaviour. The job now requires `CH_ARM_UBSAN` and NightlySQLancer builds `arm_ubsan` (on `arm-large`) to provide it.
ClickHouse ships a combined ASan+UBSan build (`arm_asan_ubsan` -> `CH_ARM_ASAN_UBSAN`) -- the standard sanitizer build used by most test jobs -- and no standalone ASan build. Use it for the SQLancer run so the long fuzzing session surfaces memory errors in addition to undefined behaviour. The job now requires `CH_ARM_ASAN_UBSAN` and NightlySQLancer builds `arm_asan_ubsan` (on `arm-large`) to provide it.
Praktika uploads every path in the job result's `files` array to S3 as a downloadable artifact (`_ResultS3.upload_result_files_to_s3`), and the job attaches `clickhouse-server.log`, its `.err`, and `sqlancer.out`. Over the 5h run `sqlancer.out` grows to several hundred MB (it logs every executed statement), so gzip files larger than 10 MB before listing them. Smaller logs (e.g. the ASan/UBSan sanitizer report on stderr) are left as plain text so the report renders them inline.
Validation only, reverted before merge. Wires the SQLancer job into the PR workflow against the real CH_ARM_ASAN_UBSAN artifact inside the clickhouse/sqlancer-test image (deep-copied so NightlySQLancer is untouched; allow_failure so a finding does not block the PR), with the run shortened to 600s, to prove runtime deps, sanitizer behavior, artifact download, and the embedded-config startup path on a real arm-medium runner -- which the scheduled NightlySQLancer workflow cannot exercise pre-merge. Also makes TIMEOUT overridable via SQLANCER_TIMEOUT_SECONDS (default kept here at 600 for the validation; restored to 18000 on revert).
The temporary wiring served its purpose: SQLancer (arm_asan_ubsan) ran green on a real arm-medium runner against the real CH_ARM_ASAN_UBSAN artifact inside the clickhouse/sqlancer-test image (https://github.com/ClickHouse/ClickHouse/actions/runs/28323944565/job/83911038744) -- server started under ASan+UBSan, the client-v2 driver connected and executed ~60k queries (97-98% successful) with no sanitizer abort or AssertionError, and all three logs were uploaded as artifacts (the >10MB stderr compressed). Remove the validation job from the PR workflow and restore TIMEOUT to 18000 (5h). The SQLANCER_TIMEOUT_SECONDS override is kept for shortened manual runs.
alexey-milovidov
approved these changes
Jun 30, 2026
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…pr4-driver-oracles Update SQLancer to ClickHouse/sqlancer PR #4 (client-v2 driver, 25 oracles)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates and re-enables the SQLancer CI job, which had been orphaned since PR #105199 ("Remove SQLancer from CI", 2026-05-18) deleted its references from the
master/pull_requestworkflows — the job definition was left injob_configs.pybut ran nowhere.This brings the job up to date with the
ClickHouse/sqlancerprovider after PR #4 (merged intomain@a62ea509ee53862b5dd37f452e8c2edce8038951): the wrong-result oracle suite (94 curated oracles), recursive type system, and thecom.clickhouse:client-v2RowBinary transport replacingclickhouse-jdbc.Docker image (
ci/docker/sqlancer-test/Dockerfile)308cb3b7…→a62ea509…, rebuilding the jar against theclient-v2driver.pom.xmltargets Java 25, which Ubuntu 22.04default-jdk/mavencannot build, so install Temurin JDK 25 (Adoptium) and Maven 3.9.9 and add-Djacoco.skip=true.JAVA_HOMEis set via an arch-independent symlink so the image builds for both arm and amd (platforms=arm_amd).Job script (
ci/jobs/sqlancer_job.sh).claude/clickhouse-config/(logger →warning, remove the heavysystem.*_logtables, and pinasync_insert=0/alter_sync=2/mutations_sync=2) by starting the server from a directory containingconfig.d/. With the binary's embedded config (users_config==config.xml),<profiles>overrides inconfig.d/reach the default profile — verified empirically.run-sqlancer.sh --oracles allreference. The oracle list is derived from the provider's ownALL_ORACLESso it stays in sync with the pinned image (fail-closed if it cannot be parsed).Workflow (
ci/workflows/nightly_sqlancer.py+ generated.github/workflows/nightly_sqlancer.yml)NightlySQLancerworkflow (mirrorsNightlyJepsen): buildsamd_debugand runs SQLancer nightly onmaster, with its own report/CIDB andworkflow_dispatch. Keeps the correctness fuzzer isolated from other workflows' reports/alerts.Validation
Dockers Build (amd)and(arm)both pass — the image (JDK 25 + Maven +client-v2) builds for both architectures.clickhouse/clickhouse-server:head: server starts with the configs applied, theclient-v2driver connects, and the full 94-oracle run executes (~5k queries across 78 databases). This caught and fixed three invocation bugs (provider-arg ordering, stale oracle list,--random-session-settings/SEMRincompatibility).Related: ClickHouse/sqlancer#4
Related: #105199
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Version info
26.7.1.312(included in26.7and later)