Repository navigation
Allow cache disk for datalake table engines. - #102017
Conversation
|
cc @scanhex12 |
02ccd04 to
7f59019
Compare
|
Workflow [PR], commit [d3183ec] Summary: ✅
AI ReviewSummaryThis PR lets cache-disk configs containing Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block Minimum required action: make datalake reads actually use the selected cache disk, and add a regression test that would fail if the read path falls back to uncached object-storage reads. |
7f59019 to
f5e7a75
Compare
6344ae6 to
e21cb52
Compare
|
No idea why the CI failed. The test cases work fine on my local machine. In the CI environment, ClickHouse nodes couldn't connect to the Azure Storage service. |
|
The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158 |
|
The flaky check failure is fixed in #102148, let's update the branch. |
|
Picked this up via The C++ changes from this PR are already in master. The same fix — walking past CI failure analysis. The previously-failing tests in Push status. I merged current master locally (resolved conflicts in Suggested next step. Given the C++ part is already merged via #102202 + c39f742, the cleanest path is probably to close this PR and re-land just the test additions in a new small PR. Happy to defer to @scanhex12 / @RinChanNOWWW. |
|
Yes, let's keep only test changes here. |
The cache-unwrap fix in `IObjectStorage::getUnderlying` / `assert_cast` is already in master, so this PR can now be reduced to just the test additions. See: ClickHouse#102017 (comment) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The integration tests for cache-disk-on-datalake (`test_storage_delta_disks`, `test_storage_iceberg_disks`) were flaking on `started_cluster` startup: the clickhouse-server access check on `disk_azure_common` and on the cache wrapper `disk_azure_with_cache` hangs ~4 min on `WriteBufferFromAzureBlobStorage` when Azurite is not yet ready, so the TCP port never opens. Set `<skip_access_check>true</skip_access_check>` on both the underlying Azure disk and the cache wrapper. The cache wrapper has its own access check via `RegisterDiskCache.cpp:125` that writes through to Azure, so the flag must be present on both. This mirrors the fix from ClickHouse#105165.
The tests added by this PR configure `<skip_access_check>true</skip_access_check>`
on the `cache`-wrapped Azure disk (`disk_azure_with_cache`) to avoid the Azurite
access-check stall during cluster startup. However, `FileCacheSettings::loadFromConfig`
calls `BaseSettings::set` for every key under the disk config and throws
`UNKNOWN_SETTING` for any key not in `FileCacheSettingsTraits`, including
`skip_access_check`.
`type`, `disk`, `name`, `data_background_cleanup`, and `thread_pool_size` are
already excluded via `non_cache_keys`. Add `skip_access_check` to that set so
the per-disk flag is consumed by the `IDisk` layer (via `IDisk::startup`)
rather than rejected by the cache settings loader.
Without this fix, the server fails to start in `test_storage_delta_disks` and
`test_storage_iceberg_disks` with:
Code: 115. DB::Exception: Unknown setting 'skip_access_check'.
(UNKNOWN_SETTING)
at src/Interpreters/FileCache/FileCacheSettings.cpp:179
Workflow files in this branch were stale or had been deleted as a workaround for GitHub's workflow-scope check. Restoring them to match `master` so the PR diff no longer contains those unrelated changes.
The fixtures in `test_storage_delta_disks` and `test_storage_iceberg_disks`
generate the disk config at a fixed `./_gen/named_collections.xml` path
shared across all `pytest-xdist` workers. Each worker substitutes its own
`{cluster.instances_dir_name}` (which embeds `PYTEST_XDIST_WORKER` like
`_instances-gw0`) into `disk_local_common`'s path. Concurrent fixture
setup in the flaky check races on the shared file: whichever worker
writes the file last wins, and `shutil.copy` into each instance's
`config.d/` may then pick up the wrong `_instances-gwN` path.
Result: gw1/gw2 workers' ClickHouse servers boot with gw0's disk path
and fail with `InvalidTableLocationError: Invalid table location: Path
does not exist: ".../_instances-gw0/node1/database/user_files/..."` on
the `False-1-local` variant.
Suffix the generated file with `PYTEST_XDIST_WORKER` so each worker
writes to its own `_gen/named_collections_gwN.xml`. Falls back to the
unsuffixed name when not running under xdist.
CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102017&sha=38d2e9e3a127598f03e6bcf72edaee42a24931b3&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20flaky%29
PR: ClickHouse#102017
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The fixtures set up `cluster.default_azure_uploader = AzureUploader(...)`
against a custom container name `mycontainer`, but the cluster helper
only auto-creates `azurite-container` (the default).
Before commit `fa5f56f6246` ("Skip Azure access check in datalake disk
tests"), `disk_azure_common` had `<skip_access_check>false</skip_access_check>`,
so ClickHouse's startup access check write-touched the Azurite endpoint
and side-effected the container into existence. Now that the access
check is skipped (to dodge a 4-minute Azurite warm-up hang), the
container is never created, and uploads via `default_upload_directory`
fail with `ContainerNotFound`.
Match the pattern used in
`tests/integration/test_storage_iceberg_interoperability_azure/conftest.py`:
fetch the container client and call `create_container` when missing.
This mirrors the fix landed in PR ClickHouse#105165 (commit `2ca20dbe1c5`).
CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102017&sha=38d2e9e3a127598f03e6bcf72edaee42a24931b3&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20flaky%29
PR: ClickHouse#102017
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
@groeneai, the 3 failing checks on commit |
|
@alexey-milovidov I tried the retrigger but both paths return 403 from my account (
State on attempt 3 is unchanged: Could you (or another maintainer with admin access) rerun the failed jobs on run 26450452782? Alternative path: a fresh push (even an empty commit) on |
The previous CI run cancelled the `Build (amd_binary)` job at the `Checkout code` step (runner shutdown signal, 3s), which left the two `_excluded_from_llvm` downstream test jobs skipped. An empty push triggers a fresh `pull_request: synchronize` run.
|
Re the
The same The only other red on the public side is |
|
Merged The only CI failure on the previous run was All review threads are resolved and the PR is approved. |
|
Merged the latest The only CI failure was @groeneai, could you take a look at this |
| /// Keys that belong to the disk configuration layer (IDisk), not to the cache layer. | ||
| /// They must be skipped when loading cache settings to avoid UNKNOWN_SETTING errors. | ||
| static const std::set<std::string> non_cache_keys = {"type", "disk", "name", "data_background_cleanup", "thread_pool_size"}; | ||
| static const std::set<std::string> non_cache_keys = {"type", "disk", "name", "data_background_cleanup", "thread_pool_size", "skip_access_check"}; |
There was a problem hiding this comment.
This makes a type=cache disk with skip_access_check parse, but the datalake read path still does not use the disk cache. DataLakeConfiguration::fromDisk keeps disk->getObjectStorage(), then StorageObjectStorageSource calls pipeline.setSource(object_storage, ...); with no filesystem_cache_name, ReadPipeline eventually calls CachedObjectStorage::readObject, and that method explicitly delegates to the wrapped storage without adding a filesystem-cache stage. So SETTINGS disk = 'disk_s3_with_cache' can silently behave like the non-cache disk, and the new tests still pass because they only compare query results.
Please route datalake disk reads through IObjectStorage::prepareRead or otherwise add the CachedObjectStorage cache stage to this pipeline, and extend one of these tests to assert cache usage rather than only successful reads.
|
@alexey-milovidov: opened #106616 ("Allowlist CIDB confirms the signature is benign chronic CI noise, not a code regression — The umbrella tracker for this whole |
…rg::alter PR ClickHouse#106102 (merged 2026-06-05 17:43 UTC) refactored Iceberg::alter to declare last_version and compression_method outside an if/else that assigns them in both branches. Clang-tidy cppcoreguidelines-init-variables flags the bare declarations and Build (arm_tidy) is built with -warnings-as-errors, so the build fails for every PR whose CI ran on master after this commit. CIDB shows 30+ unrelated PRs hitting this in the last 2 days (e.g. ClickHouse#89360, ClickHouse#103540, ClickHouse#106120, ClickHouse#106386, ClickHouse#106404, ClickHouse#106522, ClickHouse#105102, ClickHouse#106590). Initialize both variables to safe defaults at declaration. They are unconditionally overwritten in both if and else branches before use, so behavior is unchanged. The new defaults are only relevant if a future code path skips both assignments, in which case last_version=0 and compression_method=CompressionMethod::None are sane no-op values (the same defaults the old structured-binding form would produce through default-construction of the destructured aggregate). Co-Authored-By: Claude Opus 4.8 <[email protected]> (cherry picked from commit d72cac5)
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 6/6 (100.00%) | Lost baseline coverage: none · Uncovered code |
…utdown noise The upgrade-check post-restart `<Error>` scrub catches a transient lock-timeout emitted by `SystemLog<MetricLogElement>::flushImpl` when the background `MetricLog` flush loop races with shutdown work on `system.metric_log` during the upgrade restart sequence: ``` <Error> void DB::SystemLog<DB::MetricLogElement>::flushImpl(...) [LogElement = DB::MetricLogElement]: Failed to flush system log system.metric_log with N entries up to offset M: Code: 473. DB::Exception: WRITE locking attempt on "system.metric_log" has timed out! (60000ms) Possible deadlock avoided. Client should retry. Owner query ids: . (DEADLOCK_AVOIDED), Stack trace ... ``` Another worker (DROP/RENAME/DETACH on `system.metric_log`, or a parallel mutation/merge) holds the table-level write lock, the flush blocks for the 60s timeout, and then aborts with code 473 (`DEADLOCK_AVOIDED`). The 473 code is the engine's own "gave up to avoid a deadlock, not a crash" signal — losing a few `MetricLogElement` samples during shutdown is harmless; the upgrade-check stage is not asserting on metric continuity. CIDB confirms this is chronic CI noise, not a code regression: 4 hits across 4 distinct PRs in the last 30 days, 0 master, 100% on `Upgrade check (amd_release)`. Reported by @ alexey-milovidov on PR ClickHouse#102017 (cited ClickHouse#106425, ClickHouse#104561, ClickHouse#106202). The added regex requires BOTH the `SystemLog` flush wrapper for `metric_log` AND the `DEADLOCK_AVOIDED` error code together, mirroring the narrowing approach of the existing `rdk:FAIL.*Connect to.*failed: Connection refused` and `StorageKafka2.*Broker transport failure` filters. Real `metric_log` regressions (other flush errors) and unrelated `DEADLOCK_AVOIDED` hits on other system_log tables (`query_log`, `text_log`, etc.) still surface. Related: ClickHouse#102017 Related: ClickHouse#106563 Related: ClickHouse#101576 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Adds integration test coverage for using a `cache`-wrapped disk under the `DeltaLake` and `Iceberg` table engines via `SETTINGS disk = '...'`. The cache-aware path through `IObjectStorage::getUnderlying` before the `assert_cast` to `S3ObjectStorage` / `AzureObjectStorage` is already in master (commit c39f742 and ClickHouse#102202); this PR brings over the tests from ClickHouse#102017 so the path stays covered. Tests parameterize `test_single_log_file` / `test_single_iceberg_file` / `test_many_tables` / `test_cluster_table_function` with `with_cache=[False, True]`. The `with_cache=True` variant is skipped for `local` storage since the `cache` disk only wraps object storages. Original author: @RinChanNOWWW (ClickHouse#102017). Co-Authored-By: RinChanNOW <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
We cannot configure a cache disk for datalake table engines, this PR fix this.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow cache disk for datalake table engines.
Documentation entry for user-facing changes
Note
Medium Risk
Touches disk/cache configuration parsing and broadens supported cache-disk configs; misclassification of config keys could cause cache init failures or silently ignore settings in production deployments.
Overview
Enables using
type=cachedisks with datalake table engines by teachingFileCacheSettingsto ignore the disk-layerskip_access_checkkey when loading cache settings (avoidingUNKNOWN_SETTING).Integration tests for DeltaLake and Iceberg are extended to run against both base object-storage disks and new cache-wrapped disks (S3/Azure), including updated generated configs/allowed disks and a small refactor to consistently compute disk names; local-disk cache cases are explicitly skipped.
Reviewed by Cursor Bugbot for commit 38d2e9e. Bugbot is set up for automated code reviews on this repo. Configure here.
Version info
26.6.1.465