Skip to content

Add test: Path::hasGlobsIgnorePlaceholders early-return branch (no placeholder, raw globs) untested - #104058

Merged
tiandiwonder merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr62423
Jun 5, 2026
Merged

tiandiwonder merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr62423

Conversation

@clickgapai

@clickgapai clickgapai commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.

Retrospective finding from a historical scan of PR #62423 (merged 2024-05-10). Confirmed on current codebase — close with a note if already fixed.

This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.

Adds test coverage for 1 untested code path(s), found during automated review of PR #62423.
That PR PR #62423 fixes the exception message thrown when INSERT-ing into a partitioned s3/hdfs/azureBlobStorage path that ALSO contains globs (e.g. data_*_{_partition_id}.csv). Before the fix, such writes hit the partitioned sink and produced a confusing S3-side error; after the fix the storage thr

1. Path::hasGlobsIgnorePlaceholders early-return branch (no placeholder, raw globs) untested
src/Storages/ObjectStorage/StorageObjectStorageConfiguration.cpp:232, src/Storages/ObjectStorage/StorageObjectStorage.cpp:572
Risk: The helper Path::hasGlobsIgnorePlaceholders introduced by this PR has two distinct execution paths: (A) the early return if (!hasPartitionWildcard() && !hasSchemaHashWildcard()) return hasGlobs();
What's unique vs PR tests: PR test 03037 tests the partitioned + glob case (path has {_partition_id} AND globs, with partition by clause) — branch B of hasGlobsIgnorePlaceholders. This test covers the orthogonal case: non
Tags: -- Tags: no-fasttest — no-fasttest: Matches the existing PR test 03037 — fast test build does not have the S3 mock at localhost:11111.
Try it on ClickHouse Fiddle

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Not applicable — test-only change.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.6.1.415

@clickhouse-gh

clickhouse-gh Bot commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [faec51d]

Summary: ❌

job_name test_name status info comment
Stress test (arm_msan) FAIL
Test script failed FAIL cidb IGNORED

AI Review

Summary

This PR adds a single stateless test (04202_s3_write_to_globbed_path_non_partitioned.sql) plus empty reference output to cover the non-placeholder branch of Path::hasGlobsIgnorePlaceholders for INSERT INTO FUNCTION s3 with globbed path segments. I did not find correctness, safety, or test-structure issues that require changes.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ➖
No test removal ✅
Experimental gate ➖
No magic constants ➖
Backward compatibility ➖
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ➖
Compilation time ✅
No large/binary files ✅
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 5, 2026
@tiandiwonder tiandiwonder added can be tested Allows running workflows for external contributors and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels May 5, 2026
@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 5, 2026
@clickgapai

Copy link
Copy Markdown
Contributor Author

CI check Stress test (arm_msan) failed, but the failure does not reference this PR's test (04202_s3_write_to_globbed_path_non_partitioned).

This PR is test-only; the bot will not retrigger CI or modify the test to chase a failure that appears unrelated. If you believe a failure is related to this test, please comment with details and the bot will re-evaluate.

@clickgapai

Copy link
Copy Markdown
Contributor Author

This PR has accumulated 5 CI failures that don't reference its test, so the bot has not attempted any fix. Closing — please re-run CI or comment if you'd like the bot to look again.

@clickgapai

Copy link
Copy Markdown
Contributor Author

The bot has tried to address CI failures on this PR 5 times without a successful push (logs unavailable / context insufficient / plan rejected). Stopping further auto-fix attempts on Stress test (arm_msan) — needs human review.

@clickgapai

Copy link
Copy Markdown
Contributor Author

CI failure in Stress test (arm_msan) appears to be unrelated breakage and is not related to this change. Let me know if you'd like me to merge master and retrigger CI.

@alexey-milovidov alexey-milovidov mentioned this pull request May 12, 2026
1 task done
groeneai added a commit to groeneai/ClickHouse that referenced this pull request May 14, 2026
Before this change, `tests/docker_scripts/stress_runner.sh` exported
`THREAD_POOL_FAULT_INJECTION=1` before `configure`, so install.sh
symlinked `tests/config/config.d/cannot_allocate_thread_injection.xml`
into the server's `config.d/` and the server started with
`cannot_allocate_thread_fault_injection_probability=0.0001` already
active. `stress.py` then ran a small smoke check (two canary tests)
to validate the setup. The smoke check did, among other things:

    CREATE DATABASE IF NOT EXISTS test_N
        ON CLUSTER test_cluster_database_replicated
        ENGINE = Replicated(...)

When thread-pool fault injection fired during the async load of the
Replicated database (`Code: 439. Cannot schedule a task: fault
injected`), the server raised the exception after it had already
started streaming the HTTP response, so
`WriteBufferFromHTTPServerResponse` deliberately broke the chunked
encoding. The client (`clickhouse-test` → `clickhouse_execute_http`)
saw `http.client.IncompleteRead`, the per-test retry was exhausted,
and the smoke check aborted the whole stress test job.

The protocol break is by design — the server uses it to signal that a
streamed response is incomplete and must not be consumed as if it were
successful. Retrying it on the client (the previous attempt) would mask
genuine server failures.

Instead, this commit applies @azat's prescription: run the smoke check
against a server that does *not* have the thread-pool fault injector
installed, then enable it only once the smoke check has passed.

- `tests/docker_scripts/stress_runner.sh` no longer exports
  `THREAD_POOL_FAULT_INJECTION=1` before `configure`. install.sh leaves
  `cannot_allocate_thread_injection.xml` uninstalled. The server starts
  with `cannot_allocate_thread_fault_injection_probability=0` (default),
  so the smoke check runs deterministically.
- `stress.py` gains `--enable-thread-pool-fault-injection`. When set,
  `run_func_test` calls a new `install_thread_pool_fault_injection()`
  helper after the smoke-check loop. The helper symlinks the canonical
  config and runs `SYSTEM RELOAD CONFIG` with retries (the reload can
  itself transiently fail under ZooKeeper fault injection and
  ThreadFuzzer). `stress_runner.sh` passes the flag; the upgrade runner
  does not. If the smoke check raises, the install path is not reached
  and the post-stress cleanup `rm -f`s any stale symlink.
- The obsolete `CANNOT_SCHEDULE_TASK` / `Fault injection` entries are
  removed from the smoke-check `ignored_errors` list. Tolerating them
  would now mask a genuine setup failure since the injector is not
  active during the smoke check.

The failure mode recurs ~weekly across unrelated master PRs (e.g.
ClickHouse#104058, ClickHouse#103490, ClickHouse#102351, ClickHouse#102610, ClickHouse#102203, and master CI on
2026-04-28). Tracked by @alexey-milovidov's directive on PR ClickHouse#96844:
ClickHouse#96844 (comment)

Failing report example (PR ClickHouse#96844, commit 9c4f6f5, MSan stress):
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96844&sha=9c4f6f5a34d4bb45fcf73f20c464ba8d855a0c1f&name_0=PR&name_1=Stress%20test%20%28arm_msan%29

Validation: `tmp/test_install_thread_pool_fault_injection.py` (not
committed) covers (a) the symlink+reload mechanics, (b) fail-close when
the source config is missing, (c) flag off → no install, (d) flag on →
install runs once after smoke check, (e) install does not run when
smoke check raises an unrecoverable error, (f) the obsolete entries
are gone from `ignored_errors`. All six pass.
@clickhouse-gh

clickhouse-gh Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Dear @tiandiwonder, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@clickgapai

Copy link
Copy Markdown
Contributor Author

This is an automated inactivity reminder, not a technical objection — the finding still stands. The PR remains active: it adds coverage for the no-placeholder early-return branch in hasGlobsIgnorePlaceholders (src/Storages/ObjectStorage/StorageObjectStorageConfiguration.cpp:232), which the PR's own 03037 test only exercises on the with-placeholder side.

One open item is unrelated to this notice: CI shows Stress test (arm_msan) failing. I'm keeping the PR assigned and tracking that separately.

@tiandiwonder
tiandiwonder enabled auto-merge June 5, 2026 00:52
@tiandiwonder

Copy link
Copy Markdown
Contributor

@clickgapai please check what is blocking the merge?

@clickgapai

Copy link
Copy Markdown
Contributor Author

The only red check is Stress test (arm_msan); everything else is green. That job runs broad concurrent workloads under MemorySanitizer and doesn't touch this PR's diff — the change here is a single stateless test (...DATABASE_ACCESS_DENIED on an insert to a globbed s3() path), which a stress/msan run never exercises. So the failure is unrelated infrastructure flakiness, not a regression from this PR.

Automated re-run attempts on this job already hit the per-check classification cap (last three were skipped without resolving it), so it needs a manual re-trigger or a maintainer override to merge. If you'd like, I can push an empty commit to re-run CI — just confirm.

@tiandiwonder
tiandiwonder added this pull request to the merge queue Jun 5, 2026
Merged via the queue into ClickHouse:master with commit 3567d4b Jun 5, 2026
163 of 166 checks passed
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 5, 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 pr-not-for-changelog This PR should not be mentioned in the changelog 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