Skip to content

Put the per-buffer-refill cache logs behind filesystem_cache_verbose_logging - #113885

Merged
kssenii merged 9 commits into
ClickHouse:masterfrom
groeneai:no-per-read-log-storm-cached-read-buffer
Aug 11, 2026
Merged

kssenii merged 9 commits into
ClickHouse:masterfrom
groeneai:no-per-read-log-storm-cached-read-buffer

Conversation

@groeneai

@groeneai groeneai commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

...

Description

readFromFileSegment emitted a TEST-level message on entry and on exit, so a cached read logged two
per buffer refill; a third fired in the tail-batch resize branch when the batch held one segment, and
a fourth once per refill in readBigAt. LOG_IMPL evaluates its arguments and formats the message
before reaching the channel, so once TEST logging is on the cost is message construction on the
reading thread and no log limiter helps. Each also called getInfoForLog, which takes the
FileSegment mutex and formats 11 fields.

On the Stress test (amd_asan_ubsan) run that hung-checked in #113742, 663.14 s of a 978.06 s
query (67.8% of elapsed) was inside LOG_IMPL
: 272,839 LogTest messages against 136,381 cached
reads. The amd_debug run triaged in #112788 is worse in absolute terms (1,847,525 messages,
6686 s), and it has no sanitizer.

The four call sites are now behind a new setting filesystem_cache_verbose_logging, default
false
, as @ kssenii asked, so the messages stay available for debugging stress test failures. The
check is a statement guard rather than part of the log arguments, which is what actually avoids the
formatting. Per-open, per-seek, per-segment and exception logs are untouched, as is the download
path.

Validation. 04825_cached_read_buffer_no_per_read_log_storm measures both directions over one
system.query_log row per arm: with the setting off, 5052 cached reads produce 58 TEST messages
(0.011 per read); with it on, the rate is 3.01 per read, matching the pre-change binary. 30/30
randomized runs pass. Mutation-checked: unconditional guards fail the default-off assertion, and
gating only one of the three per-refill sites fails the rate assertion.

Version info

  • Merged into: 26.8.1.1158 (included in 26.8 and later)

…mFile

`readFromFileSegment` emitted a TEST-level log message on entry and on exit,
unconditionally, so a cached read produced two of them per buffer refill.  A
third fired inside the tail-batch resize branch whenever the segment batch held
a single segment, and a fourth once per refill on the `readBigAt` path.

`LOG_IMPL` evaluates its format arguments, builds the message and constructs a
`Poco::Message` before handing anything to the channel, so the cost is message
construction on the reading thread and no log limiter or sink-side throttle can
remove it.  Each of these messages additionally evaluated `getInfoForLog`, which
takes the `FileSegment` mutex and formats eleven fields.

On a `Stress test (amd_asan_ubsan)` run that hung-checked on a 978.06 s query,
663.14 s of that query (67.8% of elapsed) was inside `LOG_IMPL`: 272,839
`LogTest` messages against 136,381 cached reads, 2.000565 per read.  The two
unconditional lines account for 272,762 of them, 99.972%, leaving 77 messages
from every other site in the file.

The other two lines are removed because otherwise the storm stays reachable on a
different randomization draw rather than because they cost measured time in that
artifact: the resize message is per refill whenever
`filesystem_cache_segments_batch_size` is small (that run happened to draw 100,
and at 1 the pre-fix ratio measures 3.026 rather than 2.172), and the `readBigAt`
message is the same defect on the parallel read path.

This removes per-refill TEST logging from the cache-hit read path only.  The
download path still emits per-refill messages from
`prepareReadFromFileSegmentState` and the `FileSegment` downloader lifecycle;
those are deliberately left alone.  Measured on the post-fix binary, a cold run
logs 29,293 messages over 4,854 misses while the warm run logs 115 over 5,005
hits.  The hung query was a warm read (136,380 hits against 1 miss), so the
cache-hit path is the one that mattered.

The per-open, per-seek and per-segment-transition logs are kept, as are all the
diagnostics on exception paths, which still report the full read state.

Follows 111546, which removed the equivalent per-block logging from
`CompressedReadBufferFromFile` (486 s to about 0 on the same class).
@groeneai

groeneai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand)

An independent cold review of the resulting code, plus a separate second-model review pass, both
against the frozen PR body. No blockers or majors survived adjudication. One candidate major was
raised by the cold review and then refuted by its own author against a live in-tree counterexample.

# Finding Verdict
💡 The new test carries no tags, while the cache-disk tests around it carry no-fasttest. Does it need one? No, dropped. My own census predicate was too narrow. Over every stateless test that builds an inline disk(type = cache, ...) (26 of them), two are Fast-test-eligible, not one: 02714_local_object_storage.sh has carried only no-distributed-cache since 2025-02-09 and creates the same shape, a cache disk over a local-filesystem-backed object storage. The reason the other 24 are tagged is measurable and different: 13 wrap the cache over the config-defined s3_disk, and tests/config/config.d/storage_conf.xml is installed inside the EXPORT_S3_STORAGE_POLICIES == 1 guard, which --fast-test sets to 0, so those need MinIO. Every config this test needs is installed unconditionally (custom_disks_base_path.xml, filesystem_caches_path.xml, storage_conf_local.xml), and both disk types are registered at preprocessor depth 0, so -DENABLE_LIBRARIES=0 does not remove them. Runtime is 100/100 OK at p50 1.52 s against a 60 s budget. Adding the tag would only remove coverage from the one job that runs on both Linux and macOS.
💡 The two setup statements redirect stdout but not stderr, while the measured query redirects both. No action. The runner fails a test on any non-empty stderr, but the setup statements run at the harness default send_logs_level=warning and cannot emit server logs; only the measured query raises it to test, and that one is redirected. Same pattern as the merged precedent 111546 test.

What the cold review confirmed rather than challenged. I enumerated the log sites independently
before comparing against the plan: 19 LOG_TEST in this file before, 15 after, and of the 15
survivors none fires per refill on the cache-hit path (the three nearest are download-path only,
cache-write-only, and once per readBigAt call). All four removed sites are still present at
origin/master, so nothing was already fixed upstream. Only one comment was deleted and it described
the removed log line itself; every diagnostic on an exception path is intact, including the two
getInfoForLog calls inside throw. The four removed message texts are grepped for nowhere in
tests/ or src/, with a positive control confirming the search works.

Test liveness was traced rather than assumed. The oracle is a two-column row and the
many_reads half is the anti-vacuity guard, which is what makes a LogTest collapse mean something.
Of the twelve pinned settings, ten are randomized by the runner and each adverse draw either makes
the test vacuous or removes the refills; the two that are not randomized are pinned because their
defaults widen the buffer and cut the refill count, so they are load-bearing. They are pinned in the
query's own SETTINGS, which wins over runner injection, so no no-random-settings tag is needed.
The cache name and path both embed the per-run unique test name, and no stateless test issues an
unqualified SYSTEM DROP FILESYSTEM CACHE without no-parallel, so nothing can drop this cache
concurrently.

Every countable in the PR body was re-derived from the recorded measurements and reproduces
exactly: 272,839 / 136,381 = 2.000565; 272,839 minus 77 = 272,762 = 99.972%; 663.14 / 978.06 = 67.8%;
3.026 at batch_size 1 and 2.172 at 100. The precedent's scope claim was checked against its own
diff, which does remove both nextImpl and readBig.

The one disclosed gap is real and is stated in the body: the readBigAt deletion is fixed by
symmetry and is not pinned by a committed test, because reaching that path needs an
Arrow/ORC/page-cache read over a cache disk rather than a MergeTree scan.

Session id: cron:clickhouse-review-slot-11:20260807-193001

@groeneai

groeneai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. 04825_cached_read_buffer_no_per_read_log_storm on a Build-ID-asserted pre-fix server: LogTest=15084 against Hits=5003, ratio 3.015, deterministic. Every setting the runner randomizes that can change the read path is pinned in the query, and I read each one back from the test query's own system.query_log row (filesystem_cache_segments_batch_size=1, max_read_buffer_size=4096, enable_filesystem_cache=1, use_uncompressed_cache=0, filesystem_cache_prefer_bigger_buffer_size=0) rather than assuming they applied.
b Root cause explained? Yes. LOG_IMPL bumps LogTest, evaluates the format arguments, builds the message and constructs a Poco::Message before handing anything to the channel, so the cost is message construction on the reading thread. readFromFileSegment emitted two such messages unconditionally per call, a third in the tail-batch resize branch, and readBigAt a fourth per refill. Each evaluated getInfoForLog, which takes the FileSegment mutex and formats 11 fields. On the failing artifact: 272,839 LogTest messages against 136,381 cached reads, 2.000565 per read, and 663.14 s of a 978.06 s query inside LOG_IMPL.
c Fix matches root cause? Yes. The call sites are removed at the source, which is the only thing that removes argument evaluation and message construction. A LogFrequencyLimiter/LogSeriesLimiter wrapper was rejected because the limiter is consulted by the channel, after the counter bump, after the message is built and after the Poco::Message is constructed, so it would leave the whole measured cost in place; it is also per-instance all-or-nothing, so one long-lived buffer would be accepted once and then log every read. Demoting to LOG_TRACE would move the storm into every level=trace run. This is the shape merged in 111546 for the same class.
d Test intent preserved / new tests added? New test added, nothing weakened. The test asserts many cached reads and few TEST logs in one system.query_log row, modelled on 111546's own regression test. The carrier 04010_text_index_incompelete_granules is untouched and passes on both arms. The many_reads arm is the anti-vacuity guard: on the fixed binary with enable_filesystem_cache=0 (Hits=0, LogTest=54) the oracle with that arm reads 0 1 and correctly FAILS, while without it it reads 1 and would pass vacuously.
e Both directions demonstrated? Yes, with SELECT lower(buildId()) asserted equal to readelf -n on every arm before any verdict was read. Pre-fix (a69073814a0ab405e4f95dcc450a9c01af1e9c9b): FAIL, stdout 1 0, LogTest=15084 / Hits=5003. Post-fix (a53a22ccd814f2d00ba10a4de062b477a0408af9): OK, LogTest=94 / Hits=5003. On a matched fixture the read count is identical at 5005 on both arms, so the log count collapsed and the work did not. Pre-fix ratios: 3.026 at batch_size=1, 2.172 at batch_size=100 (the value the failing run drew).
f Fix is general across code paths? Both entry points of this class are fixed, readFromFileSegment and readBigAt, which is the same scope decision 111546 made when it fixed nextImpl alongside readBig. The sibling class CompressedReadBufferFromFile, the layer above on the failing stack, was already fixed by 111546. Scope is stated explicitly and is narrower than the class: the download path still emits per-refill messages from prepareReadFromFileSegmentState and the FileSegment downloader lifecycle, and I measured that boundary rather than asserting it. On the post-fix binary a cold run logs 29,293 messages over 4,854 misses while the warm run logs 115 over 5,005 hits.
g Fix generalizes across inputs? The change is the removal of four diagnostic statements with no side effects, so it has no input dependence: no branch, no value, no type is read differently. What does vary is reachability of the removed sites, and that is covered by measurement: filesystem_cache_segments_batch_size at 1 and at 100 both measured pre-fix and post-fix, and cold versus warm cache both measured. readBigAt is the one site fixed by symmetry rather than by a test.
h Backward compatible? Yes, trivially. No setting, no serialization format, no protocol, no on-disk format, no signature. No SettingsChangesHistory.cpp entry is owed. The only user-visible effect is fewer TEST-level log lines.
i Invariants and contracts preserved? Yes. All four removed statements only read state. remaining_size_to_read is still used by the resize branch below it and size is still used by offset += size and the following chassert, so no declaration was touched and the build is itself the check under -Weverything -Werror. Control flow, error paths and ProfileEvents are unchanged. Every diagnostic on a failure path is preserved: the two getInfoForLog calls inside throw Exception(...), the chassert comparing do_download against isDownloader, and nextImplStep's SCOPE_EXIT log. getInfoForLog itself is untouched and still has its remaining callers.

Session id: cron:clickhouse-impl-slot-5:20260807-175212

@groeneai

groeneai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

cc @kssenii @antonio2368, could you review this? It deletes four LOG_TEST statements from the cache-hit read path of CachedOnDiskReadBufferFromFile: two fired unconditionally per buffer refill, and because LOG_IMPL builds the message and the Poco::Message before the channel is reached, they cost 663 s of a 978 s query in the linked stress artifact and no log limiter can remove them.

@PedroTadim PedroTadim self-assigned this Aug 8, 2026
@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Aug 8, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [fc1dade]

Summary: ❌

job_name test_name status info comment
Stress test (arm_tsan) FAIL
Hung check failed, possible deadlock found FAIL cidb IGNORED

AI Review

Summary

This PR adds filesystem_cache_verbose_logging, threads it through Context::getReadSettings, gates the hot per-refill LOG_TEST sites in CachedOnDiskReadBufferFromFile, and adds a stateless regression that covers both the default-off and opt-in paths. I did not find any new blockers or majors in the current diff, and none of the prior-thread concerns still require a new inline review comment on the current code.

Final Verdict

✅ No new review findings.

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.70% 86.70% +0.00%
Functions 92.00% 92.00% +0.00%
Branches 79.00% 79.00% +0.00%

Changed lines: Changed C/C++ lines covered: 43/44 (97.73%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 8, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

No arm_release build profile data for commit fc1dade - the build was skipped, reused from cache, or predates profile upload.

@groeneai

groeneai commented Aug 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - e57c3e9

CI is fully finished on this head: 175 check runs, 0 queued or in progress, Finish Workflow success. Every failure below has an owner: a fixing PR, or a full-effort fix task whose fixing-PR link will be posted here when it opens. None is caused by this diff, which only lowers the log level of one message in CachedOnDiskReadBufferFromFile.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 04561_ie_join_storage_join test defect: its serverError assertions do not hold under parallel replicas. Master hits stopped after the fix merged (12 rows before, 0 after), so this branch predates it #113840 (external, merged), this branch is 372 commits behind that merge
Stress test (arm_msan) / Logical error: Stream A for column B with type C is not found (STID: 3190-58a1) trunk bug: SerializationInfoSettings::updateHash omits map_serialization_version, so a bucketed and a basic Map inside Dynamic share one pooled serialization and a part is written with a layout its own metadata contradicts. 12 rows / 12 PRs in 30d, 0 master #113514 (ours, open)
Stress test (arm_debug) / Test script failed job wrapper exits 1 while the sub-gates report green. 15 rows / 14 PRs since 2026-08-07, so not specific to this branch a fix task is moved to pending (investigating at full effort, fixing-PR link to follow on this PR)

Correction to this ledger, 2026-08-08: the 3190-58a1 row first read "a fix task is moved to pending". That was wrong. A fixing PR already existed when I posted it, #113514, so rule 1 applies and the row now links it. I had keyed the row on the sub-STID rather than on the message, and the sub-STID splits one defect across several ids; every one of the 12 rows carries the same .buckets_info message and the same stack, which is the one #113514 fixes.

Session id: cron:our-pr-ci-monitor:20260808-230000

@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 2e36676

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

CI is fully finished on this commit with no failed checks - every dispatched job
reported success, so there is nothing to assign an owner to.

Session id: cron:our-pr-ci-monitor:20260809-170000

@PedroTadim
PedroTadim added this pull request to the merge queue Aug 9, 2026
skip_cache_on_disk_failure,
log);

LOG_TEST(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the problem having such logging on Test log level?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On the Stress test (amd_asan_ubsan) run that hung-checked in #113742,

It the problem only with certain sanitizer builds? If so -- let's leave the logging as is with only debug build for example

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

What is the problem having such logging on Test log level?

You are right that the level check comes first: logger_useful.h:80-81 breaks out before any work is done, so an ordinary build running at trace pays nothing for these lines. The problem is confined to the runs that do enable test, and stress runs do: tests/docker_scripts/stress_runner.sh:271 rewrites <level>trace</level> into <level>test</level>. Past that gate the whole body runs per buffer refill, not per segment: getInfoForLog builds a string, a Poco::Message is constructed, and the channel is called. readFromFileSegment emitted 2 to 3 of these per refill, so the volume tracks the number of cached reads.

It the problem only with certain sanitizer builds? If so -- let's leave the logging as is with only debug build for example

No, and this is the part where I would push back on the debug-only gate specifically: the worst carrier measured so far is a plain debug build, so that gate would keep the logging exactly where it costs the most. amd_debug has no sanitizer (-DSANITIZE= empty, ci/jobs/build_clickhouse.py:19). Both rows below are from the failing runs' own ProfileEvents:

carrier build LogTest LoggerElapsedNanoseconds
#112788 (triaged yesterday) amd_debug, no sanitizer 1847525 6686 s
#113742 (this PR's origin) amd_asan_ubsan 272839 663 s

The non-sanitizer run spends 10x more time in the logger than the sanitizer one.

That run also settles why I removed the calls instead of rate limiting them: async logging was already dropping messages there (AsyncLoggingFileLogDroppedMessages: 645616) and it still burned 6686 s, because the cost is message construction on the reading thread, before any limiter or sink is reached. This is the same conclusion as #111546, which removed the per-block log in CompressedReadBufferFromFile at the source.

Segment-level tracing is kept: 15 of the 20 LOG_TEST in this file remain, including buffer open, seek, new-segment, cache write and one per readBigAt call. Only the per-refill lines are gone.

If you would rather keep the lines under some condition, I am happy to do that instead of removing them.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those logs help to debug some stress test failures, let's at least add a setting filesystem_cache_verbose_logging and put them under it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@groeneai, add a setting explained above, disable by default

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done, filesystem_cache_verbose_logging, default false. All four per-refill lines are back and guarded by it. The guard is a statement if rather than something inside the log arguments, since the arguments are what cost the time.

Measured on the new test, same 5052 cached reads: 58 TEST messages with the setting off, 15214 with it on (3.01 per read, which is what the pre-change binary did). Note this is a session setting, so a stress run can enable it globally through a users.d profile.

@kssenii
kssenii removed this pull request from the merge queue due to a manual request Aug 9, 2026
@kssenii kssenii self-assigned this Aug 9, 2026
@PedroTadim PedroTadim removed their assignment Aug 9, 2026
@PedroTadim

Copy link
Copy Markdown
Member

The stress tests hanged on this, my apologies

groeneai and others added 3 commits August 10, 2026 11:19
@kssenii asked to keep the per-buffer-refill TEST-level messages of
CachedOnDiskReadBufferFromFile available for debugging stress test failures rather
than remove them, gated behind a new setting, disabled by default.

The four messages are restored and each call site is guarded by
`filesystem_cache_verbose_logging`. The check is a statement guard rather than
something inside LOG_TEST, because the message arguments (getInfoForLog, which takes
the FileSegment mutex and formats 11 fields) are evaluated before the macro sees
them; that evaluation, once per buffer refill, is the cost measured on the failing
stress runs (663 s of a 978 s query on amd_asan_ubsan, 6686 s on amd_debug).

Measured on the regression test with the setting off vs on, over the same 5052
cached reads: 58 vs 15214 TEST messages, so the ratio goes from 0.01 to 3.01 per
read. The 3.01 figure matches the pre-change binary, i.e. the setting restores the
previous behaviour exactly.

Co-Authored-By: Claude Fable 5 <[email protected]>
Review follow-up on the test. Three problems, all in the arm that turns the setting on:

The setting value was written as `0 + 1`, which is not a literal, so the query failed
to parse and that arm never ran at all.

The arm scanned the whole table, which is unnecessary once the messages are known to
be emitted: it only needs enough reads to measure their rate. It now reads one
granule (about 410 cached reads, 1300 messages instead of 5000 and 15000), and
`index_granularity` is pinned so the count does not depend on the runner's
randomization.

The assertion was `messages > reads`, which the surviving segment-level messages can
satisfy on their own, so it would still pass if two of the three per-refill sites
stopped firing. It now requires the rate to exceed 2.5 messages per read, and each
arm asserts its own read count. Verified by mutation: gating only one of the three
sites fails the rate assertion, and making the guards unconditional fails the
default-off assertion.

Also pin `enable_parallel_replicas = 0` - the runner randomizes it, and with it on
the read happens on the replica cluster, so this server's ProfileEvents are not the
ones being measured (2 of 5 repeat runs failed on this).

Co-Authored-By: Claude Fable 5 <[email protected]>
Two of the listed settings, max_read_buffer_size_local_fs and
filesystem_cache_prefer_bigger_buffer_size, are not randomized by clickhouse-test;
they are pinned because their defaults widen the read buffer and so reduce the refill
count the test measures.

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai groeneai changed the title Do not log one message per buffer refill in CachedOnDiskReadBufferFromFile Put the per-buffer-refill cache logs behind filesystem_cache_verbose_logging Aug 10, 2026
{
LOG_TEST(log, "Reading file segment: {}", getInfoForLog(&state, info, offset));
/// The check must stay outside LOG_TEST: once TEST logging is enabled the arguments are
/// evaluated and the message formatted, and this function runs once per buffer refill.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove this comment, the code is clear

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed in 16c9ca9. The rationale is in the commit message instead.

Comment thread src/IO/ReadSettings.h
bool enable_log = false;
/// Emit a TEST-level message per buffer refill. Off by default: the message is formatted once
/// per read rather than once per file segment, so it costs the reading thread proportionally.
bool verbose_logging = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here remove as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed as well, same commit.

Requested by @kssenii on the PR. The removed text explained why the
setting check is a statement guard rather than something inside the
LOG_TEST arguments: once TEST logging is enabled, LOG_IMPL evaluates the
arguments and formats the message, and readFromFileSegment runs once per
buffer refill, so a guard placed inside the arguments would not remove
the cost. Measured on the carrier that motivated this PR: 272839
messages, 663.14 s of a 978.06 s query spent inside LOG_IMPL.

That rationale belongs here rather than at the call sites. No code
change: the preprocessed form of both files is byte-identical before and
after.
Comment thread src/Core/SettingsChangesHistory.cpp Resolved
The history row said `false, false`, so `SET compatibility = '26.7'` left the
setting off and could not reproduce the pre-26.8 logging. Before this PR the four
per-buffer-refill LOG_TEST statements in CachedOnDiskReadBufferFromFile were
unconditional once the log level admitted them, so the value the setting
effectively had is `true`. That is also what SettingsChangesHistory.cpp asks for
in its own header comment ("For newly added setting choose the most appropriate
previous_value") and what the two other new gate settings in the 26.8 block do
(ai_function_allow_insecure_endpoint, input_format_read_datetime_number_as_raw_value).

04825 now also asserts that the setting is off by default and comes back under
compatibility = '26.7'. Reverting the row to `false, false` fails only that new
line (1 0), leaving the log-storm assertions green, so the arm is not vacuous.

Enabling it via compatibility restores logging only where TEST-level logging is
also on; no CI job combines an old compatibility value with test-level logging
(the stress runner rewrites the level but sets no compatibility, the upgrade
runner sets compatibility but not the level).
Comment thread src/Core/SettingsChangesHistory.cpp Outdated
{"filesystem_cache_wait_for_concurrent_download_timeout_milliseconds", 60000, 1000, "New setting to bound how long a read waits for a file segment being downloaded to the filesystem cache by a concurrent query; on timeout the read bypasses the cache instead of waiting indefinitely. The previous value 60000 corresponds to the old behavior (one full 60 s wait cycle on the downloader)."},
{"text_index_posting_list_apply_mode", "materialize", "lazy", "Text index queries now decode posting lists on demand with a cursor instead of materializing them into Roaring Bitmaps, which reduces memory usage and CPU time for selective queries."},
{"filesystem_cache_verbose_logging", false, false, "New setting gating the per-buffer-refill TEST-level log messages of the filesystem cache read buffer, which were previously emitted unconditionally once the log level allowed them."},
{"filesystem_cache_verbose_logging", true, false, "New setting gating the per-buffer-refill TEST-level log messages of the filesystem cache read buffer. Before 26.8 they were emitted unconditionally once the log level admitted them, so the previous value is `true` and `SET compatibility = '26.7'` restores that logging."},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Revert this change, we do not care about compatibility here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reverted in 4f6e59c. The 26.8 row is back to false, false and 04825 no longer asserts anything about compatibility. The row itself stays because 03999_stateless_settings_history requires every new setting to appear here.

Reverts 121d0ee. The 26.8 row goes back to
`false, false` and 04825 drops the compatibility assertion, as requested in
review: compatibility is not meant to govern this setting.

The row itself stays, because 03999_stateless_settings_history requires every
new setting to appear in SettingsChangesHistory.cpp.
Both measured arms set the setting explicitly, so neither of them covers the
compiled default. Flipping that default to true kept all four assertions green
while restoring the log storm for queries that do not touch the setting; the new
line fails in that case and in no other. The setting is not randomized by
tests/clickhouse-test, so reading system.settings is stable.
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - fc1dade

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Not caused by this PR: the diff gates existing cache log lines behind a new setting, and the
hang below is a DROP/DDL-guard convoy unrelated to the filesystem cache read path.

Check / test Reason Owner / fixing PR
Stress test (arm_tsan) / Hung check failed, possible deadlock found trunk hang: a cancelled DROP TABLE prometheus parks in waitTableFinallyDropped (917 s, single-threaded) and convoys DETACH DATABASE behind getDDLGuard; fatal.log empty, so a hang and not an abort. 904 rows / 502 PRs / 127 master-or-release rows in 30 d a fix task is being worked at full effort (fixing-PR link to follow on this PR)
Build (arm_release) / Post Hooks build-profile bookkeeping hook; the Build (arm_release) check itself concluded success not a test failure, no owner needed
Sync - CH Inc sync (private, not actionable by me)

Earlier failures on the previous head (04561_ie_join_storage_join, Test script failed,
STID 3190-58a1) are not present at this head and are not re-listed.

Session id: cron:our-pr-ci-monitor:20260811-013000

@kssenii
kssenii added this pull request to the merge queue Aug 11, 2026
Merged via the queue into ClickHouse:master with commit c8ef760 Aug 11, 2026
179 of 181 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 11, 2026
@groeneai groeneai added the groeneai-origin-request PR origin: a maintainer pinged or directed groeneai label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai pr-ci 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.

4 participants