Skip to content

Use a designated directory in the home for clickhouse-local data by default - #116042

Merged
alexey-milovidov merged 52 commits into
masterfrom
clickhouse-local-default-path-home
Oct 28, 2026
Merged

alexey-milovidov merged 52 commits into
masterfrom
clickhouse-local-default-path-home

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

By default (when --path is not specified), clickhouse-local now works with a designated directory for application data inside the home directory, which is typical for applications on Linux and macOS, so tables and other data survive between runs:

  • Linux and other systems: $XDG_DATA_HOME/clickhouse-local or ~/.local/share/clickhouse-local;
  • macOS: ~/Library/Application Support/clickhouse-local.

The directory is created with owner-only permissions, and it engages the same persistent behaviors as an explicit --path: loading of the metadata, the persistent storage for access entities, and the status file lock.

The previous behavior (a unique temporary directory, removed on exit) is available with the new --tmp option. An explicit --path takes precedence over --tmp, so wrappers can pass --tmp as a baseline while individual invocations still redirect the data to an explicit location. When a second instance runs concurrently on the same directory (the default one or an explicit --path), the "another server instance in same directory is already running" error now suggests the ways out: the --tmp and --path options, or turning the already running instance into a server with SYSTEM START LISTEN TCP (connect with clickhouse-client) or SYSTEM START LISTEN HTTP (open http://localhost:8123/play in a web browser).

The test wrappers ($CLICKHOUSE_LOCAL in tests/queries/shell_config.sh, the ASan detection in clickhouse-test), the report-building invocations of clickhouse-local in the performance comparison scripts, and the compatibility check pass --tmp, because they run in parallel (or must stay independent of HOME) and must not share and lock the default designated directory.

Changelog category (leave one):

  • Backward Incompatible Change

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

By default (when --path is not specified), clickhouse-local now stores its data in a designated directory inside the home directory ($XDG_DATA_HOME/clickhouse-local or ~/.local/share/clickhouse-local on Linux, ~/Library/Application Support/clickhouse-local on macOS), so the data survives between runs. The previous behavior of using a unique temporary directory that is removed on exit is available with the new --tmp option. Only one instance can work with the same directory at a time: for concurrent instances, use --tmp or --path.


Workflow [PR]
Sync PR [sync-upstream/pr/116042]

Version info

  • Merged into: 26.11.1.866-master (included in 26.11 and later)

alexey-milovidov and others added 2 commits August 24, 2026 02:39
…efault

Previously, `clickhouse-local` used a unique temporary directory when
`--path` was not specified, so the data did not survive between runs.
Now it works with a designated directory for application data in the
home directory by default (`$XDG_DATA_HOME/clickhouse-local` or
`~/.local/share/clickhouse-local` on Linux, `~/Library/Application
Support/clickhouse-local` on macOS), like a usual desktop application,
and the data is persistent. The previous behavior is available with the
new `--tmp` option. An explicit `--path` takes precedence over
`--tmp`, so wrappers can pass `--tmp` as a baseline while individual
invocations still redirect the data to an explicit location.

Test wrappers and the report-building invocations of `clickhouse-local`
in the performance comparison scripts pass `--tmp`, because they run in
parallel and must not share (and lock) the default designated directory.

Co-Authored-By: Claude Fable 5 <[email protected]>
The check runs the binary in ancient distribution containers only as a
smoke test, so keep it independent of the HOME environment variable and
of the new default designated data directory.

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5536a1f]

Summary: ✅


AI Review

Summary

PR #116042 makes clickhouse-local persist data in a designated home directory by default, adds --tmp to restore temporary storage, and adapts asynchronous table loading, shutdown, and helper invocations. No actionable findings remain at commit 5536a1f87e1bff40765bd1eeb11305d0ca2917c1; prior findings are addressed or reflect accepted engineering decisions.

Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-backward-incompatible Pull request with backwards incompatible changes label Aug 24, 2026
alexey-milovidov and others added 3 commits August 24, 2026 03:26
When another instance already works with the same directory (the
default designated directory in the home or an explicit `--path`),
the error now suggests the `--tmp` and `--path` options, and also
turning the already running instance into a server with `SYSTEM START
LISTEN TCP` (connect with `clickhouse-client`) or `SYSTEM START
LISTEN HTTP` (open `http://localhost:8123/play` in a web browser).

Co-Authored-By: Claude Fable 5 <[email protected]>
…lt directory

`$CLICKHOUSE_LOCAL` now expands to more than one word, so the tests that
invoked it as `"$CLICKHOUSE_LOCAL"` tried to execute a file whose name
contained the `--tmp` argument. Unquote those invocations.

The `clickhouse-local` invocations that do not go through the test wrapper
(the two `expect` tests, the DWARF query of `find_symbols.py`, and the
WebAssembly smoke test) now pass `--tmp` explicitly, so that they keep using
their own directory instead of sharing (and locking) the default designated
directory in the home directory.

Document the new default directory and the `--tmp` option.
Comment thread ci/jobs/performance_tests.py Resolved
@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 5536a1f87 with master 2f0acc89f (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of c0e5c9ad4; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

11 translation units recompiled, 41 s compile time in total, 11 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×1.09 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +3.8 s (+10%) in total before that adjustment.

Job report

@mintlify

mintlify Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
ClickHouse-docs 🟢 Ready View Preview Oct 25, 2026, 7:29 PM

alexey-milovidov and others added 2 commits August 30, 2026 04:10
…ell benchmarks

`shell_env_for` in `tests/performance/scripts/perf.py` exported a bare
`clickhouse local` to `<query type="shell">` benchmarks. With the new
default data directory in the home, a benchmark that starts several
`clickhouse-local` processes at once (`insert_direct_parallel.xml`) would
fail with `Another server instance in same directory is already running`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread tests/queries/shell_config.sh Resolved
…rapper

Integration tests, the Docker image smoke tests and the system-table docs
generator execute `clickhouse local` directly, so they now use the persistent
designated directory in the home. `test_distributed_format` broke because of
that: it runs `create table t ... engine = File('Distributed', ...)` inside
`clickhouse local`, the table survived the invocation, and every later
`clickhouse local` in the same container failed to attach it once the
underlying file was gone:

    Code: 722. DB::Exception: Waited job failed: Code: 695. DB::Exception:
    Load job 'load table default.t' failed: Code: 107. DB::ErrnoException:
    Cannot open file .../shard1_all_replicas/1.bin ... (FILE_DOESNT_EXIST)

All of these invocations want a throwaway instance, so give them `--tmp`.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CI status after this push:

  • Integration tests (amd_asan_ubsan, db disk, old analyzer, 1/6) - test_distributed_format: a real regression of this pull request, fixed. The test runs create table t (...) engine = File('Distributed', '<path>/1.bin') inside clickhouse local in the container; with the new persistent default directory the table survived the invocation, and once the referenced .bin file was gone, every later clickhouse local invocation in that container failed while loading the metadata:

    Code: 722. DB::Exception: Waited job failed: Code: 695. DB::Exception: Load job 'load table default.t' failed:
    Code: 107. DB::ErrnoException: Cannot open file .../shard1_all_replicas/1.bin: errno: 2 ... (FILE_DOESNT_EXIST)
    

    All the invocations that bypass tests/queries/shell_config.sh and want a throwaway instance now pass --tmp: the clickhouse local calls in test_distributed_format, test_cgroup_limit, test_jemalloc_percpu_arena, test_native_incorrect_data_deserialization, test_input_format_parallel_parsing_memory_tracking, the image smoke tests in docker/server/Dockerfile.ubuntu, docker/server/Dockerfile.distroless and docker/keeper/Dockerfile.distroless, and utils/generate-system-tables-docs.

  • Integration tests (amd_asan_ubsan, db disk, old analyzer, 6/6) - test_userspace_page_cache/test.py::test_size_adjustment: a long-known flaky test, unrelated (Flaky test: test_userspace_page_cache/test.py::test_size_adjustment #92761, Flaky test: test_userspace_page_cache/test.py::test_size_adjustment #93260, Test test_userspace_page_cache/test.py::test_size_adjustment is flaky #87244).

  • The tests/queries/shell_config.sh review finding is a false positive; refuted with a reproducer in the thread.

master is merged in.

One thing that is worth a decision rather than a silent change: LocalServer::processConfig does waitLoad(loadMetadata(global_context)), so a single table that fails to attach makes every query fail, even a query that does not touch that table. That was already true for --path, but with a persistent default directory it becomes easy to hit - clickhouse local -q "CREATE TABLE t ENGINE = File(CSV, '/tmp/x.csv')", then delete /tmp/x.csv, and clickhouse-local refuses to run anything until the metadata is removed by hand. A server tolerates this (the tables load asynchronously and only a query against the broken table fails). Should clickhouse-local behave the same way here?

Comment thread programs/local/LocalServer.cpp Resolved
Comment thread tests/clickhouse-test Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-local clickhouse-local / embedded modes (incl. local file processing). label Sep 4, 2026
The default working directory sets `path` in the configuration so that the rest of the
startup treats it exactly like an explicit `--path`, but `processConfig` also branched on
`has("path")` to decide whether to attach the system tables, and the `no-system-tables`
check lived only in the `else if` branch. As a result a plain
`clickhouse-local --no-system-tables` silently ignored the option unless the caller also
passed `--tmp`.

Both branches now honor `no-system-tables`: neither the `system` database nor
`INFORMATION_SCHEMA` is attached, while the user's persisted tables are still loaded
(`loadMetadata` skips the system databases). The background tasks needed by DDL operations
like `DROP VIEW SYNC` are also created when there was no metadata to load yet, which is the
usual case on the first run in the default directory.

Test `05153_no_system_tables_with_default_local_path` covers the option in the default mode
with a private `HOME`.
…default directory

`tests/config/install.sh` and `tests/docker_scripts/upgrade_runner.sh` probe
`system.build_options` / `system.settings` with bare `clickhouse local` invocations. With the
persistent default directory these first lock and load
`~/.local/share/clickhouse-local`, so a table persisted there by an unrelated invocation, or
a concurrent instance holding the directory, can make the probe fail instead of answering.

Both scripts now ask for a throwaway directory with `--tmp`. The option does not exist in the
previous-release binary of the upgrade check - which defaults to a temporary directory anyway
- so `install.sh` asks the binary at hand whether it supports the option, and
`upgrade_runner.sh` starts adding it only after the new packages are installed.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Addressed both remaining review findings and merged master.

  • --no-system-tables in the default mode (c9b3fde): the finding was right - writing the default directory into path made processConfig take the has("path") branch, where the no-system-tables check did not exist, so the option was silently ignored. Both branches honor it now (this also fixes the pre-existing case of --path --no-system-tables), the persisted user tables still load because loadMetadata skips the system databases, and the background tasks needed by DROP VIEW SYNC are created even when there is no metadata yet - the first run in the default directory. New test 05153_no_system_tables_with_default_local_path asserts UNKNOWN_DATABASE for system.tables and information_schema.tables under a private HOME; it fails without the fix. Verified locally together with 05038_clickhouse_local_default_path.
  • Remaining pure-query helpers (c637dfc): tests/config/install.sh and tests/docker_scripts/upgrade_runner.sh now use a throwaway directory. A blanket --tmp would have broken the upgrade check, because both scripts also run against the previous-release binary (configure --previous-release runs install.sh with the old packages installed, and the old settings are collected before the upgrade), so install.sh probes the binary for the option and upgrade_runner.sh starts passing it only after the new packages are installed.

CI on the previous push: test_userspace_page_cache/test.py::test_size_adjustment (assert 10000000 > 60000000.0, i.e. the page cache fell back to its 10 MiB minimum) and Container memory budget exceeded (/docker) in the same job - both memory-pressure failures of that runner, unrelated to clickhouse-local. The test has 0 failures in 3086 master runs over the last 14 days.

@groeneai, please investigate the flaky test_userspace_page_cache/test.py::test_size_adjustment: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116042&sha=54241d9caedece7a79ae0f388b07a10829ecd9cf&name_0=PR&name_1=Integration%20tests%20(amd_asan_ubsan%2C%20targeted) and provide a fix in a separate PR; if a fix is already in progress, link it here. Previous reports of it (#87244, #92761, #93260) were all closed, and it now only fails in the ASan+UBSan jobs, seemingly when the container is under memory pressure.

The design question from my previous comment still stands: LocalServer::processConfig does waitLoad(loadMetadata(global_context)), so one unloadable table makes every query fail, which a persistent default directory makes easy to hit. A server tolerates it. Left unchanged.

Comment thread programs/local/LocalServer.cpp Resolved
@groeneai

groeneai commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Investigated. This is not runner memory pressure: the sanitizer skip-probe in that test file inverts on this branch, and both failures in that job follow from it.

test_userspace_page_cache/test.py derives everything from one probe (lines 19 to 33):

result = subprocess.run([binary, "local", "--query",
    "SELECT value FROM system.build_options WHERE name = 'CXX_FLAGS'"], ...)
return "-fsanitize=" in result.stdout
except Exception:
    return False

is_sanitizer gates two things: the creation of node_smol (line 52) and the test_size_adjustment skip (line 283). That clickhouse local call is not adapted to the new default mode, which requires a usable home directory and throws when it cannot determine one, and the probe captures any such failure as an empty stdout. So the probe answers False on an ASan+UBSan build, and both reported failures follow:

  • test_size_adjustment stops skipping and runs under ASan, where the page cache falls back to its 10 MiB floor: assert 10000000 > 60000000.0 at line 327.
  • node_smol is created as well (if not is_sanitizer:), adding a second mem_limit="20g" instance to the module, which is consistent with the Container memory budget exceeded (/docker) in the same job.

Measurements (CIDB, matched on test_context_raw, so the unrelated started_cluster failure carrying the same test_name on #100185 is excluded):

  • The assert ... > 60000000.0 signature has 4 rows in 90 days: all 4 on this PR, none on master, none on any other PR.
  • Under amd_asan_ubsan the test is SKIPPED on master over the last 30 days (841 rows, no OK, no FAIL), and SKIPPED across 3154 other PRs (10312 rows). On this PR it is FAIL on 4 of 4 runs, never SKIPPED.

The probe therefore answers True on master and False here, on identical test code: that file is byte-identical between master and 54241d9ca.

The fix is what this PR already does at every other call site. All 13 clickhouse local invocations in the 5 integration tests it touches gained --tmp, including the closely analogous build-options skip probe skip_if_jemalloc_disabled() in test_jemalloc_percpu_arena/test.py. The same one line is missing in _is_sanitizer_build():

            [
                binary,
                "local",
                "--tmp",
                "--query",

On the separate PR: --tmp does not exist on master (this PR adds it, LocalServer.cpp line 2037), and on master the probe works and the test skips correctly, so a PR against master has neither a defect to fix nor the option to use. The change only has meaning on this branch. I am glad to open it against master right after this merges if you would rather keep it out of here; otherwise the one line above is the whole fix.

One optional point, your call: the probe turns any failure into return False, so a probe that cannot answer chooses to run the expensive test under sanitizers instead of skipping it. Inverting that fallback to True would make this class of breakage skip rather than fail. I have not touched it, since nothing fails on master today.

alexey-milovidov and others added 2 commits September 17, 2026 13:30
…fault-path-home

# Conflicts:
#	docker/keeper/Dockerfile.distroless
#	docker/server/Dockerfile.distroless
#	docker/server/Dockerfile.ubuntu
#	tests/config/install.sh
#	tests/integration/test_input_format_parallel_parsing_memory_tracking/test.py
…fault mode

The skip probe runs `clickhouse local` without `--tmp`, so with the
persistent default directory it failed inside the container and answered
"not a sanitizer build". Under ASan the test then ran instead of being
skipped, the page cache fell back to its 10 MiB floor and the assertion
failed, and the second 20 GiB instance pushed the job over its memory
budget. Pass `--tmp` like every other probe touched by this branch.

Found by @groeneai on #116042
after https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116042&sha=c637dfc60e051bc7ce9d9c4507299f5ee3ec9bfd&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20targeted%29

Co-Authored-By: Claude Fable 5.1 <[email protected]>
alexey-milovidov and others added 2 commits October 24, 2026 14:42
…on drop

`clickhouse-local` now loads the persisted tables asynchronously, and the
dependencies of a table on named collections (`NamedCollectionFactory`) and
on definers (`DefinerDependencies`) are registered only when the table is
constructed in its load job. `DROP NAMED COLLECTION` and `DROP USER` consult
only these registries, so as the first statement of a new process they could
drop an object that a persisted table or view still needs.

Wait for the startup of all databases before checking the dependencies. The
startup of a database ignores the failures of its tables, so a broken table
does not prevent the drop. The same applies to the server with
`async_load_databases`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Merged master to pick up the reverted default of use_query_condition_cache_for_time_conditions (back to false on master), which was the only failure: Upgrade check (amd_release) reported it as a changed setting missing from the settings changes history. Unrelated to this PR.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 All public CI checks are green. The only red check is CH Inc sync (tests failed). Its failures are unrelated to this PR: an Iceberg compaction integration test that exists only in the private repository, 01174_select_insert_isolation under TSan, and MSan timeouts of 05441_iceberg_more_manifests_than_read_ahead and 04411_deep_nested_field_to_type. None of these use clickhouse-local. I asked for an investigation on the sync PR. There are no unresolved review threads.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 28, 2026
Merged via the queue into master with commit 1f612cb Oct 28, 2026
178 checks passed
@alexey-milovidov
alexey-milovidov deleted the clickhouse-local-default-path-home branch October 28, 2026 17:35
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 28, 2026
@clickgapai

Copy link
Copy Markdown
Contributor

@alexey-milovidov — ClickGap found the following in this PR:

Close anything that's wrong or already addressed.

@groeneai

Copy link
Copy Markdown
Collaborator

I have a fix in #128088. This is not really flaky: since the test was added it failed in every Fast test (arm_darwin) run (127 failures on 120 PRs, nothing on master or in any other check), because it holds the lock with flock(1), which macOS does not have. #128088 holds the lock with fcntl.flock from python3 instead; on that PR Fast test (arm_darwin) passes (the only darwin pass of this test so far) and the test passed 50/50 in each flaky check. It is waiting for a review.

UnamedRus pushed a commit to UnamedRus/ClickHouse that referenced this pull request Oct 29, 2026
…n with --tmp

Since ClickHouse#116042, clickhouse local without --tmp or --path creates its data
directory under $HOME/.local/share. praktika runs the performance comparison
container as --user <uid>, which has no passwd entry in the image, so HOME=/
and creating /.local fails with "Code: 1001 ... Permission denied". ClickHouse#116042
converted most calls of the harness to --tmp but missed four:

- s3_service.seed_catalog fails prepare_s3, so the nightly shard holding
  iceberg_rest_catalog.xml (Performance Comparison (arm_release,
  master_head, nightly, 4/4)) runs no tests since 2026-10-29.
- The two reference GIT_HASH lookups in performance_tests.py (after
  Install Reference and in Build Report) return "" through the non-strict
  Shell.get_output, so PR perf results are uploaded with an empty old_sha.
- compare.sh match_reference_debug_info gets empty line counts; its Python
  twin, which ClickHouse#116042 fixed, decides first, so this has no effect today.

All four now use the existing --help probe: local_command() in Python and an
equivalent local_tmp_option helper in compare.sh. --tmp is passed only when
the binary lists it, because a reference build older than the option rejects
it as an unrecognized argument. In compare.sh the probe reads --help through a
process substitution: a pipeline would turn grep -q's early exit into a
failure under pipefail, and an assignment would make set -x print the whole
--help text into the log.

--tmp keeps one throw-away directory per call, as before ClickHouse#116042. A writable
HOME instead would share one persistent directory between calls; seed_catalog
then fails on a re-run with DATABASE_ALREADY_EXISTS for database c.

Validated in clickhouse/performance-comparison:8109f2886addf0c0b83f_amd run as
CI runs it (--user, HOME=/), with master release builds from before and after
ClickHouse#116042: the seed fails with the CI error before and passes twice after; the
GIT_HASH lookup returns the commit after the change for both builds; the
compare.sh probe returns line counts after the change, with --tmp only for the
newer build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Oct 30, 2026
The test writes a script whose first line is
`#!<path>/clickhouse-local --queries-file` and executes it. That run has
no `--tmp` and no `--path`, so since ClickHouse#116042 it uses the default data
directory in the home (`~/.local/share/clickhouse-local`, or
`$XDG_DATA_HOME/clickhouse-local`) and holds the `status` lock there.
Any other run using the same directory at that moment makes one of them
fail with `Code: 76 ... Cannot lock file .../status` (CANNOT_OPEN_FILE).
Seen on master in `Stateless tests (amd_tsan, parallel)`.

`--tmp` cannot be added to the shebang line: Linux passes everything
after the interpreter path as a single argument. The environment is the
only channel into that process, so the test gets a private HOME and an
empty XDG_DATA_HOME, the same block ClickHouse#128197 added to 03134 and 03536.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jh0x pushed a commit to jh0x/ClickHouse that referenced this pull request Nov 6, 2026
…log_remove_part_on_retried_drop_table

Since ClickHouse#116042 clickhouse-local loads persisted tables asynchronously, and a
query waits only for the tables it uses. The second clickhouse-local of the
test arms the ONCE failpoint disk_object_storage_fail_commit_metadata_transaction
as its first statement, which does not use d.t. When the background job
'load table d.t' runs after the arm, the attach commits a metadata transaction
on the local_blob_storage disk (DiskObjectStorage::createDirectories), consumes
the failpoint and fails with FAULT_INJECTED; DROP TABLE d.t SYNC then waits on
the failed load and throws ASYNC_LOAD_WAIT_FAILED (seen twice in
Stateless tests (arm_binary, parallel), PRs 125006 and 129676).

SYSTEM WAIT LOADING PARTS d.t resolves the table through
DatabaseCatalog::getTable -> waitTableStarted, which waits for the load and
startup jobs, so the DROP's part removal is again the first metadata commit
after the arm. It prints nothing; the reference is unchanged.

Validation on a master debug binary: with 3000 filler tables and
tables_loader_background_pool_size = 1 the old test fails 9/10 (load still
PENDING at the arm in every failing run), the fixed one passes 10/10;
tests/clickhouse-test with random settings: 16/50 fail before, 50/50 and
300/300 pass after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov added a commit to Dtenwolde/ClickBench that referenced this pull request Nov 10, 2026
Since ClickHouse 26.11 (PR ClickHouse/ClickHouse#116042), clickhouse-local
keeps its databases in ~/.local/share/clickhouse-local by default, so the
CREATE TABLE that ./query runs before every query fails with
TABLE_ALREADY_EXISTS from the second query on. --tmp restores a temporary
directory per run. It does not exist before 26.11, so merge this when 26.11
is released.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
zoomxi pushed a commit to zoomxi/ClickHouse that referenced this pull request Nov 19, 2026
…a home of their own

Since ClickHouse#116042, clickhouse-local without --tmp or --path works in a
designated directory in the home ($XDG_DATA_HOME/clickhouse-local or
~/.local/share/clickhouse-local; ~/Library/Application Support on macOS)
and holds a lock on its `status` file for the whole run. That change gave
$CLICKHOUSE_LOCAL a --tmp, but these three tests start clickhouse-local
through the bare ${CLICKHOUSE_BINARY}, so all their local-mode runs in a
CI job share the job's one default directory. When two of them overlap
(two of these tests at the same time in a parallel job, or two copies of
one test in the flaky check), the second fails with
"Code: 76 ... Cannot lock file .../clickhouse-local/status".
Seen on PR ClickHouse#124882 (03267, Stateless tests (amd_debug, parallel)) and
PR ClickHouse#127774 (03536, Fast test).

Prefix each local-mode line with a per-test HOME under CLICKHOUSE_TMP and
an empty XDG_DATA_HOME (an absolute one wins over HOME on Linux), the same
form ClickHouse#116042 uses in its own default-directory tests. The argv of every
invocation is unchanged, so the dispatch rules of programs/main.cpp that
these tests pin stay covered, including the no-argument rule that only
03267 exercises (`clickhouse < file`); --tmp would have turned that line
into the dash-option rule. Client-mode lines and $CLICKHOUSE_LOCAL lines
are untouched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

1 active deployment
staging - docs — 5536a1f8 Deployed Oct 25, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-local clickhouse-local / embedded modes (incl. local file processing). pr-backward-incompatible Pull request with backwards incompatible changes pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants