Repository navigation
Store minio audit/server log tables on local disk, not S3 - #110333
Merged
Merged
Conversation
The `Scraping system tables` step of stateless jobs fails on amd_tsan + s3
storage runs with `Failed to dump system table: minio_audit_logs / timed out
after 600s`. `system.minio_audit_logs` and `system.minio_server_logs` capture
the MinIO audit/server webhook stream, but they are plain `ENGINE = MergeTree`
tables, so on s3 storage runs they inherit the overridden default merge_tree
policy (`s3_storage_policy_for_merge_tree_by_default.xml` sets
`<merge_tree><storage_policy>s3</storage_policy>`) and live on S3.
That is doubly bad for tables that record S3 activity:
* every audit-event insert writes parts to S3, which itself generates more
audit events - a feedback loop that inflates the table, and
* the post-run `select * ... into outfile` dump in `dump_system_tables` reads
it all back from S3. On amd_tsan the `JSON`-typed audit table grew to ~700k
rows / ~1.5 GB and the dump blew past the `DUMP_SYSTEM_TABLE_TIMEOUT` (600s)
cap, so the bounded dump was killed and `Scraping system tables` went red.
On master this only ever fired on runs that already had another failing test
(the failure-reproduction/minimization storm hammers S3, tipping the table over
the cap), so it never turned a green run red - but it added a confusing extra
`FAIL` and wasted up to ~20 min per affected run.
Pin both tables to the local `default` storage policy with an explicit
`SETTINGS storage_policy = 'default'`. The dump then reads locally and the audit
insert path no longer feeds itself over S3. These are diagnostics about S3
activity; there is no reason to store them on S3. `default` is a local policy on
every stateless config (nothing remaps it), so this is a no-op on non-s3 runs.
Verified with `clickhouse local`: with the default merge_tree policy overridden,
a plain CREATE lands on the override while `storage_policy = 'default'` lands on
local storage.
CI report (one of several, amd_tsan s3 storage sequential 2/2 on master):
https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=961ded3e6c262b07d1b0b33e74ce60b9fad99682&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20sequential%2C%202%2F2%29
Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
|
Workflow [PR], commit [e512951] Summary: ✅ AI ReviewSummaryThis PR pins Final Verdict
|
Algunenano
reviewed
Jul 14, 2026
| ( | ||
| "create system.minio_audit_logs table", | ||
| 'clickhouse-client --enable_json_type=1 --query "CREATE TABLE system.minio_audit_logs (log JSON(time DateTime64(9))) ENGINE = MergeTree ORDER BY tuple()"', | ||
| 'clickhouse-client --enable_json_type=1 --query "CREATE TABLE system.minio_audit_logs (log JSON(time DateTime64(9))) ENGINE = MergeTree ORDER BY tuple() SETTINGS storage_policy = \'default\'"', |
Member
There was a problem hiding this comment.
This is not enough. In private default is cloud based and it's an issue there too
Member
Author
|
Let's merge this, and then do a follow-up applicable for the private repo. |
Merged
1 task
alexey-milovidov
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Jul 15, 2026
Master's ClickHouse#110333 added ci/tests/test_minio_log_tables_local_storage.py, which asserts that both `system.minio_audit_logs` and `system.minio_server_logs` are created with `storage_policy = 'default'`. This PR drops the audit table entirely, so the guard now expects a single CREATE statement, verifies it is `system.minio_server_logs`, and still requires the local storage pin. Co-Authored-By: Claude Fable 5 <[email protected]>
alexey-milovidov
added a commit
to raimannma/ClickHouse
that referenced
this pull request
Jul 17, 2026
Follow-up to the review of the initial fix: pinning `system.minio_audit_logs` / `system.minio_server_logs` to `SETTINGS storage_policy = 'default'` is not enough. In the public repo `default` is a local policy, but in the private/cloud repo `default` is cloud-based (object storage), so pinning to it would still put these tables on S3 - the audit-log feedback loop and the slow post-run dump that reads them back from S3 both persist there. Pin each table to a dedicated local disk instead, with an explicit `SETTINGS disk = disk(type = 'local', path = '/var/lib/clickhouse/disks/...')`. That path is inside `custom_local_disks_base_directory` (`/var/lib/clickhouse/disks/`, set by `custom_disks_base_path.xml`, which `install.sh` always installs), so the disk is created locally regardless of what `default` resolves to - correct in both the public and the private/cloud repo. Each table uses its own path so it gets its own disk. Update the guard test to require the explicit local-disk pin and reject a regression back to `storage_policy = 'default'`. Verified with `clickhouse local`: with the default `merge_tree` policy overridden to a non-local policy, a plain `CREATE` lands on the override while the `disk = disk(type = 'local', ...)` pin lands on a dedicated local disk, bypassing the override. ClickHouse#110333 (comment) Co-Authored-By: Claude Fable 5 <[email protected]>
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…bles-local-storage Store minio audit/server log tables on local disk, not S3
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
Follow-up to the review of the initial fix: pinning `system.minio_audit_logs` / `system.minio_server_logs` to `SETTINGS storage_policy = 'default'` is not enough. In the public repo `default` is a local policy, but in the private/cloud repo `default` is cloud-based (object storage), so pinning to it would still put these tables on S3 - the audit-log feedback loop and the slow post-run dump that reads them back from S3 both persist there. Pin each table to a dedicated local disk instead, with an explicit `SETTINGS disk = disk(type = 'local', path = '/var/lib/clickhouse/disks/...')`. That path is inside `custom_local_disks_base_directory` (`/var/lib/clickhouse/disks/`, set by `custom_disks_base_path.xml`, which `install.sh` always installs), so the disk is created locally regardless of what `default` resolves to - correct in both the public and the private/cloud repo. Each table uses its own path so it gets its own disk. Update the guard test to require the explicit local-disk pin and reject a regression back to `storage_policy = 'default'`. Verified with `clickhouse local`: with the default `merge_tree` policy overridden to a non-local policy, a plain `CREATE` lands on the override while the `disk = disk(type = 'local', ...)` pin lands on a dedicated local disk, bypassing the override. ClickHouse#110333 (comment) Co-Authored-By: Claude Fable 5 <[email protected]>
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
Master's ClickHouse#110333 added ci/tests/test_minio_log_tables_local_storage.py, which asserts that both `system.minio_audit_logs` and `system.minio_server_logs` are created with `storage_policy = 'default'`. This PR drops the audit table entirely, so the guard now expects a single CREATE statement, verifies it is `system.minio_server_logs`, and still requires the local storage pin. Co-Authored-By: Claude Fable 5 <[email protected]>
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.
The
Scraping system tablesstep of stateless jobs fails on amd_tsan + s3 storage runs with:system.minio_audit_logsandsystem.minio_server_logscapture the MinIO audit/server webhook stream, but they are plainENGINE = MergeTreetables, so on s3 storage runs they inherit the overridden default merge_tree policy (s3_storage_policy_for_merge_tree_by_default.xmlsets<merge_tree><storage_policy>s3</storage_policy>) and live on S3. That is doubly bad for tables that record S3 activity:select * ... into outfiledump indump_system_tablesreads it all back from S3. On amd_tsan theJSON-typed audit table grew to ~700k rows / ~1.5 GB and the dump blew past theDUMP_SYSTEM_TABLE_TIMEOUT(600s) cap, so the bounded dump was killed andScraping system tableswent red.On master this only ever fired on runs that already had another failing test (the failure-reproduction/minimization storm hammers S3, tipping the table over the cap), so it never turned a green run red — but it added a confusing extra
FAILand wasted up to ~20 min per affected run.Fix: pin both tables to the local
defaultstorage policy with an explicitSETTINGS storage_policy = 'default'. The dump then reads locally and the audit insert path no longer feeds itself over S3. These are diagnostics about S3 activity; there is no reason to store them on S3.defaultis a local policy on every stateless config (nothing remaps it), so this is a no-op on non-s3 runs.Verified with
clickhouse local: with the default merge_tree policy overridden to a non-default policy, a plainCREATElands on the override whileSETTINGS storage_policy = 'default'lands on local storage. A guard test (ci/tests/test_minio_log_tables_local_storage.py) prevents a future edit from silently putting the tables back on S3.CI report (one of several; amd_tsan s3 storage sequential 2/2 on master):
https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=961ded3e6c262b07d1b0b33e74ce60b9fad99682&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20sequential%2C%202%2F2%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not for changelog.
Documentation entry for user-facing changes
🤖 Generated with Claude Code