Skip to content

Bound the system.text_log scans of test 04401_http_query_parameters_not_leaked_to_logs by the test start time - #123814

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:bound-04401-text-log-scans-by-test-start
Oct 5, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:bound-04401-text-log-scans-by-test-start

Conversation

@groeneai

@groeneai groeneai commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #123652

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

04401_http_query_parameters_not_leaked_to_logs timed out at 600 s in Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) on #123752 and #122362; 8 more runs in that lane took 149-498 s. No related open issue found.

All six system.text_log reads of the test were bounded only by event_time >= now() - INTERVAL 600 SECOND, so each read the last ten minutes of the whole server's log. In the #123752 job's query_log each message LIKE scan read ~4.7M rows (~120 MB from S3) and took 97-222 s, while the polling loop exited on its first iteration. Of 16 job logs read in that lane, all 10 slow runs drew remote_filesystem_read_method = 'read', enable_filesystem_cache = 0 and filesystem_prefetch_min_bytes_for_single_read_task = 1Mi; none of the 6 fast ones did.

Change. Take toUnixTimestamp(now()) once before the first request and bound the six reads with event_time >= toDateTime($test_start), as in #123652. Every asserted line is logged after that, so the .reference is unchanged. text_log is ordered by (event_date, event_time), so the bound prunes the read to the test's own granules.

Validation (master debug build, text_log padded to 681K rows in the ten-minute window):

  • before: each scan reads 681,982 rows; after: 381 rows, output matches the reference;
  • a request leaking the secret through a non-sensitive parameter still fails the test (4/4);
  • 50/50 runs with randomized settings; one run with the three settings above forced.

The per-MB cost of these small S3 reads in that lane is not explained here; this PR only removes the dependence on the server-wide log volume.

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.10.1.1602-master (included in 26.10 and later)

04401_http_query_parameters_not_leaked_to_logs bounded its six
system.text_log reads only by `event_time >= now() - INTERVAL 600 SECOND`,
so every read scanned the last ten minutes of the whole server's log. On
the parallel `Stateless tests (arm_binary, ParallelReplicas, s3 storage,
parallel)` server that is ~4.7M rows / ~120 MB of `message` per scan, and
with `remote_filesystem_read_method = 'read'`, `enable_filesystem_cache = 0`
and 1 MiB remote read tasks the five `message LIKE` scans took 97-222 s
each, so the test hit the 600 s timeout (ClickHouse#123752, ClickHouse#122362).

Take `toUnixTimestamp(now())` before the first request and bound all six
reads with `event_time >= toDateTime(test_start)`, as ClickHouse#123652 did for
05061. Every asserted line is logged after that point, so the reference
is unchanged; text_log is ordered by (event_date, event_time), so the
bound prunes the read to the test's own granules. Locally, with 681K rows
in the ten-minute window, a scan reads 381 rows instead of 681,982.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Oct 4, 2026
@groeneai

groeneai commented Oct 4, 2026

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

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (1 nit).

# Sev Finding Verdict Evidence / action
1 💡 event_date >= yesterday() is implied by the new event_time bound DISAGREE kept for partition pruning, same predicate shape as #123652; no action

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-11:20261004-032000

@groeneai groeneai added the groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect label Oct 4, 2026
@groeneai

groeneai commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes for the mechanism: with 681K rows in the ten-minute text_log window, the original test reads the whole window in every scan (max 681,982 rows per scan). The 600 s timeout itself needs the arm lane's S3 read cost and is not reproduced on a local disk.
b Root cause explained? Six system.text_log reads bounded only by now() - INTERVAL 600 SECOND scan the whole server's last ten minutes of log (~4.7M rows in that lane); under remote_filesystem_read_method = 'read' + enable_filesystem_cache = 0 + 1 MiB remote read tasks, five such scans exceed 600 s.
c Fix matches root cause? Yes: the reads are bounded to rows logged since the test started. No setting pinned, no tag added, no timeout raised.
d Test intent preserved / new tests added? Yes: same queries, assertions and reference; the two positive controls still catch a window that is too narrow.
e Both directions demonstrated? Same window: original 681,982 rows per scan, fixed 381 (0.06 %). Mutation FAIL 4/4, reverted OK; 50/50 with randomized settings.
f Fix is general across code paths? All six text_log reads of the test are bounded, including the polling loop. The same pattern in 05061 was fixed by #123652.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test-only). The bound is an epoch value, so randomized session_timezone cannot shift it (50/50 runs drew 6 time zones).
h Backward compatible? (maintainer-approved exception only) N/A (test-only; no settings, formats or defaults change).
i Invariants and contracts preserved? Every asserted line comes from a request sent after test_start and is stamped by the server clock; event_time is floored to the second and compared with >=, so a line in the same second is kept.

Session id: cron:clickhouse-impl-slot-4:20261004-025600

@clickhouse-gh

clickhouse-gh Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ffe543e]

Summary: ✅


AI Review

Summary

This PR narrows all six system.text_log reads in 04401_http_query_parameters_not_leaked_to_logs to rows logged since the test started, which matches the timeout mechanism described in the PR body without changing the assertions or expected output. I did not find a correctness, compatibility, or evidence gap in the current patch.

Final Verdict

✅ No review findings.

@Algunenano
Algunenano added this pull request to the merge queue Oct 5, 2026
Merged via the queue into ClickHouse:master with commit 392f555 Oct 5, 2026
149 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 5, 2026
@clickhouse-gh clickhouse-gh Bot added comp-protocols Server wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc... and removed comp-testing Test content only (no production code). labels Nov 22, 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 comp-protocols Server wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc... groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect 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.

3 participants