repo
stringlengths
5
53
pr_number
int32
1
321k
task_type
stringclasses
2 values
issue_text
stringlengths
0
81.2k
pr_title
stringlengths
1
319
pr_body
stringlengths
0
105k
base_sha
stringlengths
40
40
head_sha
stringlengths
40
40
gold_diff
stringlengths
0
202M
changed_files
listlengths
0
100
review_threads
listlengths
0
100
test_patch
stringlengths
0
23.4M
merged
bool
1 class
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
this will make COLLECT ERROR stage not working (must be done after it)
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "this will make COLLECT ERROR stage not working (must be done after it)", "path": "ci/jobs/functional_tests.py", "hunk": "@@ -548,6 +568,51 @@ def start():\n test_result.set_failed()\n break\n \n+ # Run additional build types for bugfix val...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
non uniq results (test names) might cause problems. it's known limitation in ci. early exit keeping only Result from "failed" run might be a solution
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "non uniq results (test names) might cause problems. it's known limitation in ci.\n\nearly exit keeping only Result from \"failed\" run might be a solution", "path": "ci/jobs/functional_tests.py", "hunk": "@@ -548,6 +568,51 @@ def start():\n test_result.set_failed()\...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
Running a job multiple times in the same workspace for each build may result in unrelated testing issues being caught, which increase the risk of job's false negative result
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "Running a job multiple times in the same workspace for each build may result in unrelated testing issues being caught, which increase the risk of job's false negative result", "path": "ci/jobs/functional_tests.py", "hunk": "@@ -548,6 +568,51 @@ def start():\n test_r...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
In the additional bugfix-validation build loop, infrastructure-error handling is not mirrored from the primary run: we append results from `run_pytest_and_collect_results`, but never call `_mark_infrastructure_errors` and never update `has_error`/`error_info` from `bt_result_parallel` / `bt_result_sequential`. Because...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
[ "ci/jobs/integration_test_job.py" ]
[ { "comment": "In the additional bugfix-validation build loop, infrastructure-error handling is not mirrored from the primary run: we append results from `run_pytest_and_collect_results`, but never call `_mark_infrastructure_errors` and never update `has_error`/`error_info` from `bt_result_parallel` / `bt_result...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`find_master_builds` currently probes only `build_amd_asan` and then assumes the same SHA has all other required build types. That can pick a master commit with a partial build set (e.g. one sanitizer build failed/upload missing), and then `wget` for a later build type fails with `strict=True`, making bugfix-validatio...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "`find_master_builds` currently probes only `build_amd_asan` and then assumes the same SHA has all other required build types.\n\nThat can pick a master commit with a partial build set (e.g. one sanitizer build failed/upload missing), and then `wget` for a later build type fails with `strict=True`,...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
Same issue as in `ci/jobs/functional_tests.py`: probing only `build_amd_asan` is not enough when this job later requires all entries from `BUGFIX_BUILD_TYPES`. If a master SHA has partial artifacts, this function returns it and the job fails later during download of missing build types. Please require all build-type ...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
[ "ci/jobs/integration_test_job.py" ]
[ { "comment": "Same issue as in `ci/jobs/functional_tests.py`: probing only `build_amd_asan` is not enough when this job later requires all entries from `BUGFIX_BUILD_TYPES`.\n\nIf a master SHA has partial artifacts, this function returns it and the job fails later during download of missing build types.\n\nPlea...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`run_sets_cnt` is referenced but never initialized in this function before use (`for cnt in range(run_sets_cnt):`), which will raise `NameError` and fail the job before tests run. Please initialize it before the loop (for example, default `run_sets_cnt = 1`, and set a higher value only for targeted/flaky modes where m...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "`run_sets_cnt` is referenced but never initialized in this function before use (`for cnt in range(run_sets_cnt):`), which will raise `NameError` and fail the job before tests run.\n\nPlease initialize it before the loop (for example, default `run_sets_cnt = 1`, and set a higher value only for targ...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
Inside the multi-run branch this recomputes `global_time_limit` with `job_timeout` and `soft_limit_margin`, but neither variable is initialized in this function. Once `run_sets_cnt > 1` and `global_time_limit > 0`, this will raise `NameError` and abort the job. Please initialize these values before use (or derive the ...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "Inside the multi-run branch this recomputes `global_time_limit` with `job_timeout` and `soft_limit_margin`, but neither variable is initialized in this function. Once `run_sets_cnt > 1` and `global_time_limit > 0`, this will raise `NameError` and abort the job.\n\nPlease initialize these values be...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`test_result.results` is replaced with `bt_result.results`, but `test_result.status` is never updated. For non-bugfix PRs (where status inversion is skipped), this can hide real failures from additional build types: `Result.create_from(results=results)` only looks at top-level `test_result.status`, so the job may stay...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "`test_result.results` is replaced with `bt_result.results`, but `test_result.status` is never updated.\n\nFor non-bugfix PRs (where status inversion is skipped), this can hide real failures from additional build types: `Result.create_from(results=results)` only looks at top-level `test_result.stat...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
This now regresses local `BugfixValidation` runs: `find_master_builds` depends on `Info.get_kv_data("master_commits")`, but that key is only populated by CI workflow hooks. In local runs it is typically absent, so this unconditional `assert build_urls` fails before tests start. Please keep local behavior compatible, f...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "This now regresses local `BugfixValidation` runs: `find_master_builds` depends on `Info.get_kv_data(\"master_commits\")`, but that key is only populated by CI workflow hooks. In local runs it is typically absent, so this unconditional `assert build_urls` fails before tests start.\n\nPlease keep lo...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
Same local-run regression as in `functional_tests.py`: `find_master_builds` relies on CI-populated `master_commits`, so local `BugfixValidation` can fail at `assert build_urls` even when local binaries are available. Please add a local fallback path (reuse existing binaries when present, and require S3/master-commits ...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
[ "ci/jobs/integration_test_job.py" ]
[ { "comment": "Same local-run regression as in `functional_tests.py`: `find_master_builds` relies on CI-populated `master_commits`, so local `BugfixValidation` can fail at `assert build_urls` even when local binaries are available.\n\nPlease add a local fallback path (reuse existing binaries when present, and re...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
The additional bugfix-validation reruns call `run_pytest_and_collect_results` without the `timeout` argument (unlike the primary parallel/sequential runs above). If one of these secondary runs hangs outside pytest's own session timeout handling, the job can block indefinitely and never finish. Please pass the same out...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
[ "ci/jobs/integration_test_job.py" ]
[ { "comment": "The additional bugfix-validation reruns call `run_pytest_and_collect_results` without the `timeout` argument (unlike the primary parallel/sequential runs above).\n\nIf one of these secondary runs hangs outside pytest's own session timeout handling, the job can block indefinitely and never finish. ...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
Treating every `Result.Status.ERROR` as successful bug reproduction makes `BugfixValidation` accept harness failures as if the bug was reproduced. In `FTResultsProcessor`, `ERROR` is also used for parser failures and for "the test runner was terminated unexpectedly", so this can hide real CI breakage. Please keep gene...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "Treating every `Result.Status.ERROR` as successful bug reproduction makes `BugfixValidation` accept harness failures as if the bug was reproduced. In `FTResultsProcessor`, `ERROR` is also used for parser failures and for \"the test runner was terminated unexpectedly\", so this can hide real CI bre...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
This now counts generic `Result.Status.ERROR` as successful reproduction. In this job, `ERROR` is also used for runner-level problems (for example session-timeout paths in `run_pytest_and_collect_results`), so infrastructure/harness failures can flip `BugfixValidation` to green. Please invert only explicit bug-reprodu...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
[ "ci/jobs/integration_test_job.py" ]
[ { "comment": "This now counts generic `Result.Status.ERROR` as successful reproduction. In this job, `ERROR` is also used for runner-level problems (for example session-timeout paths in `run_pytest_and_collect_results`), so infrastructure/harness failures can flip `BugfixValidation` to green.\n\nPlease invert o...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
This replacement happens before `CH.terminate`, while the previous ClickHouse process is still executing `{ch_path}/clickhouse`. On Linux, overwriting a running ELF usually fails with `Text file busy`; here that failure is silent because `Shell.run` is non-strict by default. The loop can then restart the old binary an...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "This replacement happens before `CH.terminate`, while the previous ClickHouse process is still executing `{ch_path}/clickhouse`.\n\nOn Linux, overwriting a running ELF usually fails with `Text file busy`; here that failure is silent because `Shell.run` is non-strict by default. The loop can then r...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`Result.Status.ERROR` can still be masked as a successful reproduction here. `FTResultsProcessor` can produce mixed `FAIL` + `ERROR` results when the runner ends with an exception after some failures were already parsed. In that case `has_failure` becomes `True` from the `FAIL` rows, and the branch below calls `test_r...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "`Result.Status.ERROR` can still be masked as a successful reproduction here.\n\n`FTResultsProcessor` can produce mixed `FAIL` + `ERROR` results when the runner ends with an exception after some failures were already parsed. In that case `has_failure` becomes `True` from the `FAIL` rows, and the br...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`ERROR` still is not fully dominant here, because this guard only inspects per-test rows. `FTResultsProcessor` can set the top-level result to `ERROR` (`not s.success_finish`) even when parsed rows are only `FAIL`/`OK` (no `Result.Status.ERROR` leaf). In that case `has_error` stays `False`, we invert `FAIL` to `OK`, a...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "`ERROR` still is not fully dominant here, because this guard only inspects per-test rows.\n\n`FTResultsProcessor` can set the top-level result to `ERROR` (`not s.success_finish`) even when parsed rows are only `FAIL`/`OK` (no `Result.Status.ERROR` leaf). In that case `has_error` stays `False`, we ...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
### Duplicated function and constant across two files **Low Severity** <!-- DESCRIPTION START --> `BUGFIX_BUILD_TYPES` and `find_master_builds()` are copy-pasted identically in both `functional_tests.py` and `integration_test_job.py`. If the S3 URL pattern, build type list, or lookup logic is updated in one file but ...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "### Duplicated function and constant across two files\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\n`BUGFIX_BUILD_TYPES` and `find_master_builds()` are copy-pasted identically in both `functional_tests.py` and `integration_test_job.py`. If the S3 URL pattern, build type list, or lookup logic ...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
### Copy command missing strict mode unlike sibling calls **Medium Severity** <!-- DESCRIPTION START --> The `Shell.run` copying `clickhouse_{BUGFIX_BUILD_TYPES[0]}` to `clickhouse` lacks `strict=True`, unlike every other file-manipulation command in this bugfix validation flow (lines 339–341 use `strict=True`, lines...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "### Copy command missing strict mode unlike sibling calls\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `Shell.run` copying `clickhouse_{BUGFIX_BUILD_TYPES[0]}` to `clickhouse` lacks `strict=True`, unlike every other file-manipulation command in this bugfix validation flow (lines 339–3...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
The binary copied here is `amd_asan_ubsan`, but `run_tests` still chooses `--memory-limit` from `Info().job_name`; for this job the name is `Bugfix validation (functional tests)`, so the ASan run gets the 5 GiB default instead of the 10 GiB used by regular `amd_asan_ubsan` stateless jobs. A master-side memory-limit fai...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "The binary copied here is `amd_asan_ubsan`, but `run_tests` still chooses `--memory-limit` from `Info().job_name`; for this job the name is `Bugfix validation (functional tests)`, so the ASan run gets the 5 GiB default instead of the 10 GiB used by regular `amd_asan_ubsan` stateless jobs. A master...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`CH.terminate` is too broad for this per-build restart. It also tears down helpers started in the outer `start` stage: it kills Redpanda when `self.kafka_proc` is set and resets MinIO webhooks. The loop then calls only `CH.start` and `CH.wait_ready`, so the next build type runs with Kafka gone and without redoing the r...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "`CH.terminate` is too broad for this per-build restart. It also tears down helpers started in the outer `start` stage: it kills Redpanda when `self.kafka_proc` is set and resets MinIO webhooks. The loop then calls only `CH.start` and `CH.wait_ready`, so the next build type runs with Kafka gone and...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
This helper becomes part of both bugfix validation jobs, but neither digest config includes `ci/jobs/scripts/bugfix_validation.py` (`bugfix_validation_ft_pr_job` lists `functional_tests.py` and test/config paths, while `common_integration_test_job_config` lists `integration_test_job.py` and integration paths). The Prak...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/scripts/bugfix_validation.py b/ci/jobs/scripts/bugfix_validation.py new file mode 100644 index 000000000000..eb5dd1f612b7 --- /dev/null +++ b/ci/jobs/scripts/bugfix_validation.py @@ -0,0 +1,23 @@ +from ci.praktika.info import Info +from ci.praktika.utils import Shell + +BUGFIX_BUILD_TYPES = ["amd_a...
[ "ci/jobs/scripts/bugfix_validation.py" ]
[ { "comment": "This helper becomes part of both bugfix validation jobs, but neither digest config includes `ci/jobs/scripts/bugfix_validation.py` (`bugfix_validation_ft_pr_job` lists `functional_tests.py` and test/config paths, while `common_integration_test_job_config` lists `integration_test_job.py` and integr...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
The per-build restart should fail closed when the server cannot come back up. `CH.start` and `CH.wait_ready` both return `False` on failure, but this loop ignores the return values and still runs `clickhouse-test`. A failed restart of `amd_tsan`/`amd_msan` would then be reported as ordinary test failures such as `Serve...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "The per-build restart should fail closed when the server cannot come back up. `CH.start` and `CH.wait_ready` both return `False` on failure, but this loop ignores the return values and still runs `clickhouse-test`. A failed restart of `amd_tsan`/`amd_msan` would then be reported as ordinary test f...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`ClickHouseProc.start` always runs `Utils.clean_dir(Path(run_path))`, so this per-build restart starts the next binary with an empty `{temp_dir}/run_r0`. The initial `start` stage populated stateful data and `system.zookeeper`, but this loop does not call `prepare_stateful_data` / `insert_system_zookeeper_config` again...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/functional_tests.py b/ci/jobs/functional_tests.py index a6b7388b8ce8..345fe10eaf8d 100644 --- a/ci/jobs/functional_tests.py +++ b/ci/jobs/functional_tests.py @@ -5,6 +5,7 @@ import subprocess from pathlib import Path +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_master...
[ "ci/jobs/functional_tests.py" ]
[ { "comment": "`ClickHouseProc.start` always runs `Utils.clean_dir(Path(run_path))`, so this per-build restart starts the next binary with an empty `{temp_dir}/run_r0`. The initial `start` stage populated stateful data and `system.zookeeper`, but this loop does not call `prepare_stateful_data` / `insert_system_z...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
This digest still omits `./ci/jobs/scripts/clickhouse_proc.py`, even though the bugfix-validation loop now directly depends on the new `ClickHouseProc.stop_server` and `ClickHouseProc.clean_logs` behavior added in this PR. `bugfix_validation_ft_pr_job` is not derived from `common_ft_job_config`, so it does not inherit ...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/defs/job_configs.py b/ci/defs/job_configs.py index 8fdfe5f1838d..f63e5e7db667 100644 --- a/ci/defs/job_configs.py +++ b/ci/defs/job_configs.py @@ -543,13 +543,16 @@ class JobConfigs: # --root/--privileged/--cgroupns=host is required for clickhouse-test --memory-limit bugfix_validation_ft_pr_jo...
[ "ci/defs/job_configs.py" ]
[ { "comment": "This digest still omits `./ci/jobs/scripts/clickhouse_proc.py`, even though the bugfix-validation loop now directly depends on the new `ClickHouseProc.stop_server` and `ClickHouseProc.clean_logs` behavior added in this PR. `bugfix_validation_ft_pr_job` is not derived from `common_ft_job_config`, s...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
Bugfix validation now requires `master_commits` in `Info` for every non-local run: both `functional_tests.py` and `integration_test_job.py` call `find_master_builds` and assert the result. This hook only stores the key when `info.repo_name == "ClickHouse/ClickHouse"`, so the synced private PR workflow (`ClickHouse/Clic...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/scripts/workflow_hooks/store_data.py b/ci/jobs/scripts/workflow_hooks/store_data.py index 1a31f9d1de0a..e75db148566e 100644 --- a/ci/jobs/scripts/workflow_hooks/store_data.py +++ b/ci/jobs/scripts/workflow_hooks/store_data.py @@ -23,13 +23,20 @@ digest = Digest().calc_job_digest(some_build_job...
[ "ci/jobs/scripts/workflow_hooks/store_data.py" ]
[ { "comment": "Bugfix validation now requires `master_commits` in `Info` for every non-local run: both `functional_tests.py` and `integration_test_job.py` call `find_master_builds` and assert the result. This hook only stores the key when `info.repo_name == \"ClickHouse/ClickHouse\"`, so the synced private PR wo...
true
ClickHouse/ClickHouse
97,014
comment_to_fix
Fix bugfix validation failing due to git ownership check in Docker
`OOM in dmesg` is a synthetic harness/resource failure added above, but this inversion treats every `FAIL` leaf as a reproduced bug. With the new multi-build sanitizer loop on `amd-small-mem`, a host OOM after otherwise passing tests becomes `Result.Status.OK` and `R.set_success`, the same as this trace: `Result("OOM i...
d0534d76c0718cf7d990e929bf22660641ae4a90
75f70593f94f80f92b7be4250fa0de20ce47d032
diff --git a/ci/jobs/integration_test_job.py b/ci/jobs/integration_test_job.py index e10e26c92b5f..1afe89c6a602 100644 --- a/ci/jobs/integration_test_job.py +++ b/ci/jobs/integration_test_job.py @@ -8,6 +8,7 @@ from more_itertools import tail +from ci.jobs.scripts.bugfix_validation import BUGFIX_BUILD_TYPES, find_...
[ "ci/jobs/integration_test_job.py" ]
[ { "comment": "`OOM in dmesg` is a synthetic harness/resource failure added above, but this inversion treats every `FAIL` leaf as a reproduced bug. With the new multi-build sanitizer loop on `amd-small-mem`, a host OOM after otherwise passing tests becomes `Result.Status.OK` and `R.set_success`, the same as this...
true
ClickHouse/ClickHouse
101,447
issue_to_patch
Fix use-after-free of workload storage mutex during server shutdown
During server shutdown, `ContextSharedPart` destroys `workload_entity_storage` via `unique_ptr::reset` while a query pipeline may still be running `PipelineExecutor::allocateCPU`, which holds a raw reference to the storage obtained from `getWorkloadEntityStorage`. This caused a use-after-free of the `recursive_mutex` i...
b187aa1ea88de810e7ee86961a0e725ab2b341d2
6278ace9a4a73d81694b62bd3322d323915a76db
diff --git a/programs/server/Server.cpp b/programs/server/Server.cpp index e0d4cb793493..375a650fdc01 100644 --- a/programs/server/Server.cpp +++ b/programs/server/Server.cpp @@ -2543,7 +2543,7 @@ try } /// Load WORKLOADs and RESOURCEs. - global_context->getWorkloadEntityStorage()...
[ "programs/server/Server.cpp", "src/Common/Scheduler/Nodes/WorkloadResourceManager.cpp", "src/Common/Scheduler/Nodes/WorkloadResourceManager.h", "src/Common/Scheduler/Nodes/tests/gtest_workload_resource_manager.cpp", "src/Common/Scheduler/createResourceManager.cpp", "src/Disks/DiskObjectStorage/DiskObjectS...
[ { "comment": "`getWorkloadEntityStoragePtr` reads `shared->workload_entity_storage` without synchronization, but shutdown later writes to the same `shared_ptr` object (`delete_workload_entity_storage = std::move(workload_entity_storage)` under `shared->mutex`).\n\nConcurrent read/write of the same `std::shared_...
diff --git a/src/Common/Scheduler/Nodes/tests/gtest_workload_resource_manager.cpp b/src/Common/Scheduler/Nodes/tests/gtest_workload_resource_manager.cpp index 3446e3e46e1e..7050bb435603 100644 --- a/src/Common/Scheduler/Nodes/tests/gtest_workload_resource_manager.cpp +++ b/src/Common/Scheduler/Nodes/tests/gtest_workloa...
true
ClickHouse/ClickHouse
101,447
comment_to_fix
Fix use-after-free of workload storage mutex during server shutdown
`getWorkloadEntityStoragePtr` reads `shared->workload_entity_storage` without synchronization, but shutdown later writes to the same `shared_ptr` object (`delete_workload_entity_storage = std::move(workload_entity_storage)` under `shared->mutex`). Concurrent read/write of the same `std::shared_ptr` object is a data ra...
b187aa1ea88de810e7ee86961a0e725ab2b341d2
6278ace9a4a73d81694b62bd3322d323915a76db
diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 99bfc66be017..9f22039155e1 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -517,7 +517,7 @@ struct ContextSharedPart : boost::noncopyable mutable std::unique_ptr<IUserDefinedSQLObjectsStorage> user_define...
[ "src/Interpreters/Context.cpp" ]
[ { "comment": "`getWorkloadEntityStoragePtr` reads `shared->workload_entity_storage` without synchronization, but shutdown later writes to the same `shared_ptr` object (`delete_workload_entity_storage = std::move(workload_entity_storage)` under `shared->mutex`).\n\nConcurrent read/write of the same `std::shared_...
true
ClickHouse/ClickHouse
101,447
comment_to_fix
Fix use-after-free of workload storage mutex during server shutdown
`getWorkloadEntityStoragePtr` only protects lifetime while the returned `shared_ptr` is kept by the caller, but `getWorkloadEntityStorage` immediately discards that owner and returns a raw reference (`return *getWorkloadEntityStoragePtr();`). That means other call sites that still use `getWorkloadEntityStorage` can st...
b187aa1ea88de810e7ee86961a0e725ab2b341d2
6278ace9a4a73d81694b62bd3322d323915a76db
diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 99bfc66be017..9f22039155e1 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -517,7 +517,7 @@ struct ContextSharedPart : boost::noncopyable mutable std::unique_ptr<IUserDefinedSQLObjectsStorage> user_define...
[ "src/Interpreters/Context.cpp" ]
[ { "comment": "`getWorkloadEntityStoragePtr` only protects lifetime while the returned `shared_ptr` is kept by the caller, but `getWorkloadEntityStorage` immediately discards that owner and returns a raw reference (`return *getWorkloadEntityStoragePtr();`).\n\nThat means other call sites that still use `getWorkl...
true
ClickHouse/ClickHouse
101,447
comment_to_fix
Fix use-after-free of workload storage mutex during server shutdown
`getWorkloadEntityStoragePtr` now synchronizes initialization/write with `shared->mutex`, but the `SHUTDOWN(... workload_entity_storage, stopWatching())` path still reads the same `shared->workload_entity_storage` object without that mutex. If shutdown overlaps with the first initialization, this is still a concurrent...
b187aa1ea88de810e7ee86961a0e725ab2b341d2
6278ace9a4a73d81694b62bd3322d323915a76db
diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index 99bfc66be017..9f22039155e1 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -517,7 +517,7 @@ struct ContextSharedPart : boost::noncopyable mutable std::unique_ptr<IUserDefinedSQLObjectsStorage> user_define...
[ "src/Interpreters/Context.cpp" ]
[ { "comment": "`getWorkloadEntityStoragePtr` now synchronizes initialization/write with `shared->mutex`, but the `SHUTDOWN(... workload_entity_storage, stopWatching())` path still reads the same `shared->workload_entity_storage` object without that mutex.\n\nIf shutdown overlaps with the first initialization, th...
true
ClickHouse/ClickHouse
91,583
issue_to_patch
Local Iceberg table not insertable after server restart ### Describe the bug Easy to reproduce. ### How to reproduce Run: ```sql CREATE TABLE t0 (c0 Int) ENGINE = IcebergLocal(local, format = 'CSV', path = 't0/'); INSERT INTO TABLE t0 (c0) VALUES (1); ``` Restart the server, then run: ``` INSERT INTO TABLE t0 (c0)...
Add integration tests for attach/detach and restart of Iceberg tables
### Changelog category (leave one): - Not for changelog (changelog entry is not required) ### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.md): Test-only. Adds integration coverage ...
c71bec377604c20107106a0091901a321430aa7f
71da38208bb3dfaa71aebe49febda8323d92a896
[ "tests/integration/test_storage_iceberg_with_spark/test_writes.py" ]
[ { "comment": "It is a bit strange. You have a comment which clearly contradicts to a code you added. Why this logic is not relevant anymore?", "path": "src/Storages/ObjectStorage/registerStorageObjectStorage.cpp", "hunk": "@@ -77,7 +77,7 @@ createStorageObjectStorage(const StorageFactory::Arguments & ar...
diff --git a/tests/integration/test_storage_iceberg_with_spark/test_writes.py b/tests/integration/test_storage_iceberg_with_spark/test_writes.py index f110430e8914..808ef7236097 100644 --- a/tests/integration/test_storage_iceberg_with_spark/test_writes.py +++ b/tests/integration/test_storage_iceberg_with_spark/test_wri...
true
ClickHouse/ClickHouse
91,583
comment_to_fix
Add integration tests for attach/detach and restart of Iceberg tables
JAS: you can add a real restart of the server into integration test. See example: tests/integration/test_storage_iceberg_with_spark/test_restart_broken_s3.py
c71bec377604c20107106a0091901a321430aa7f
71da38208bb3dfaa71aebe49febda8323d92a896
diff --git a/tests/integration/test_storage_iceberg_with_spark/test_writes.py b/tests/integration/test_storage_iceberg_with_spark/test_writes.py index f110430e8914..808ef7236097 100644 --- a/tests/integration/test_storage_iceberg_with_spark/test_writes.py +++ b/tests/integration/test_storage_iceberg_with_spark/test_wri...
[ "tests/integration/test_storage_iceberg_with_spark/test_writes.py" ]
[ { "comment": "JAS: you can add a real restart of the server into integration test. See example: tests/integration/test_storage_iceberg_with_spark/test_restart_broken_s3.py", "path": "tests/integration/test_storage_iceberg_with_spark/test_writes.py", "hunk": "@@ -102,3 +102,19 @@ def test_writes_orc_form...
true
ClickHouse/ClickHouse
91,583
comment_to_fix
Add integration tests for attach/detach and restart of Iceberg tables
Wrong name
c71bec377604c20107106a0091901a321430aa7f
71da38208bb3dfaa71aebe49febda8323d92a896
diff --git a/tests/integration/test_storage_iceberg_with_spark/test_writes.py b/tests/integration/test_storage_iceberg_with_spark/test_writes.py index f110430e8914..808ef7236097 100644 --- a/tests/integration/test_storage_iceberg_with_spark/test_writes.py +++ b/tests/integration/test_storage_iceberg_with_spark/test_wri...
[ "tests/integration/test_storage_iceberg_with_spark/test_writes.py" ]
[ { "comment": "Wrong name", "path": "tests/integration/test_storage_iceberg_with_spark/test_writes.py", "hunk": "@@ -102,3 +102,19 @@ def test_writes_orc_format(started_cluster_iceberg_with_spark, format_version, s\n found_orc_files = True\n assert found_orc_files\n \n+@pytest.mark.parame...
true
ClickHouse/ClickHouse
105,248
issue_to_patch
Fix arrayRemove logical error when comparing incompatible Variant types
Related: #95839 When `arrayRemove`'s first argument is an `Array(Variant(...))` whose Variant alternatives are all incompatible with the type of the second argument and `variant_throw_on_type_mismatch = 0`, `equals` returns `Nullable(Nothing)` instead of throwing. The previous code stripped the `Nullable` and then dec...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
1fcf1c2b16335305856abda4740eb3e2275f4b12
diff --git a/src/Functions/array/arrayRemove.cpp b/src/Functions/array/arrayRemove.cpp index d3901c993284..b43364630a0b 100644 --- a/src/Functions/array/arrayRemove.cpp +++ b/src/Functions/array/arrayRemove.cpp @@ -138,6 +138,17 @@ ColumnPtr FunctionArrayRemove::executeImpl( /// equals() on tuples with nullabl...
[ "src/Functions/array/arrayRemove.cpp", "tests/queries/0_stateless/04256_arrayRemove_variant_no_throw_on_mismatch.reference", "tests/queries/0_stateless/04256_arrayRemove_variant_no_throw_on_mismatch.sql" ]
[ { "comment": "Please limit this recovery path to the `Nothing` result described above. As written, any unexpected non-`UInt8` result from `equals` is converted into an all-zero filter, so `arrayRemove` would silently keep every element instead of surfacing a broken comparison contract. Handle `TypeIndex::Nothin...
diff --git a/tests/queries/0_stateless/04256_arrayRemove_variant_no_throw_on_mismatch.reference b/tests/queries/0_stateless/04256_arrayRemove_variant_no_throw_on_mismatch.reference new file mode 100644 index 000000000000..c5d9b8c3a142 --- /dev/null +++ b/tests/queries/0_stateless/04256_arrayRemove_variant_no_throw_on_m...
true
ClickHouse/ClickHouse
105,248
comment_to_fix
Fix arrayRemove logical error when comparing incompatible Variant types
Please limit this recovery path to the `Nothing` result described above. As written, any unexpected non-`UInt8` result from `equals` is converted into an all-zero filter, so `arrayRemove` would silently keep every element instead of surfacing a broken comparison contract. Handle `TypeIndex::Nothing` here, and throw a `...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
1fcf1c2b16335305856abda4740eb3e2275f4b12
diff --git a/src/Functions/array/arrayRemove.cpp b/src/Functions/array/arrayRemove.cpp index d3901c993284..b43364630a0b 100644 --- a/src/Functions/array/arrayRemove.cpp +++ b/src/Functions/array/arrayRemove.cpp @@ -138,6 +138,17 @@ ColumnPtr FunctionArrayRemove::executeImpl( /// equals() on tuples with nullabl...
[ "src/Functions/array/arrayRemove.cpp" ]
[ { "comment": "Please limit this recovery path to the `Nothing` result described above. As written, any unexpected non-`UInt8` result from `equals` is converted into an all-zero filter, so `arrayRemove` would silently keep every element instead of surfacing a broken comparison contract. Handle `TypeIndex::Nothin...
true
ClickHouse/ClickHouse
106,690
issue_to_patch
Fix spurious resource request failure from reused `ResourceGuard::Request`
`ResourceGuard::Request` is reused per thread via the `Request::local()` thread-local instance. Its `exception` member is set by `failed()` but was never cleared on reuse, so a thread that had previously run a failed resource request kept a stale `exception`. A subsequent request scheduled on that thread could be grant...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
da47f28415c7460ae1d6385dd4fa20fedae1f0be
diff --git a/src/Common/HTTPConnectionPool.cpp b/src/Common/HTTPConnectionPool.cpp index 5583cedf8792..999003858b4c 100644 --- a/src/Common/HTTPConnectionPool.cpp +++ b/src/Common/HTTPConnectionPool.cpp @@ -354,8 +354,22 @@ struct ResourceGuardSessionDataHooks : public Poco::Net::IHTTPSessionDataHooks void atStart...
[ "src/Common/HTTPConnectionPool.cpp", "src/Common/Scheduler/ISchedulerQueue.h", "src/Common/Scheduler/Nodes/tests/gtest_resource_scheduler.cpp", "src/Common/Scheduler/Nodes/tests/gtest_workload_resource_manager.cpp", "src/Common/Scheduler/ResourceGuard.h" ]
[ { "comment": "The same failed-request path still leaves the thread-local `Request` in the wrong lifecycle state. In the default-lock constructor, `request.wait` throws after `failed` has moved the request to `Dequeued`; because the `ResourceGuard` constructor never completes, `~ResourceGuard` does not run and `...
diff --git a/src/Common/Scheduler/Nodes/tests/gtest_resource_scheduler.cpp b/src/Common/Scheduler/Nodes/tests/gtest_resource_scheduler.cpp index e99ad6bef8a8..50a00d26fe3e 100644 --- a/src/Common/Scheduler/Nodes/tests/gtest_resource_scheduler.cpp +++ b/src/Common/Scheduler/Nodes/tests/gtest_resource_scheduler.cpp @@ -1...
true
ClickHouse/ClickHouse
106,690
comment_to_fix
Fix spurious resource request failure from reused `ResourceGuard::Request`
The same failed-request path still leaves the thread-local `Request` in the wrong lifecycle state. In the default-lock constructor, `request.wait` throws after `failed` has moved the request to `Dequeued`; because the `ResourceGuard` constructor never completes, `~ResourceGuard` does not run and `request.finish` is nev...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
da47f28415c7460ae1d6385dd4fa20fedae1f0be
diff --git a/src/Common/Scheduler/ResourceGuard.h b/src/Common/Scheduler/ResourceGuard.h index 5d894b8b9ed5..402c3a782ce1 100644 --- a/src/Common/Scheduler/ResourceGuard.h +++ b/src/Common/Scheduler/ResourceGuard.h @@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` req...
[ "src/Common/Scheduler/ResourceGuard.h" ]
[ { "comment": "The same failed-request path still leaves the thread-local `Request` in the wrong lifecycle state. In the default-lock constructor, `request.wait` throws after `failed` has moved the request to `Dequeued`; because the `ResourceGuard` constructor never completes, `~ResourceGuard` does not run and `...
true
ClickHouse/ClickHouse
106,690
comment_to_fix
Fix spurious resource request failure from reused `ResourceGuard::Request`
`enqueueRequestUsingBudget` commits `budget.ask` before it calls the concrete `enqueueRequest`, so this recovery path is not enough when `enqueueRequest` throws before linking the request (for example `SERVER_OVERLOADED` from `max_waiting_queries`, or `INVALID_SCHEDULER_NODE`). The request never entered the scheduler a...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
da47f28415c7460ae1d6385dd4fa20fedae1f0be
diff --git a/src/Common/Scheduler/ResourceGuard.h b/src/Common/Scheduler/ResourceGuard.h index 5d894b8b9ed5..402c3a782ce1 100644 --- a/src/Common/Scheduler/ResourceGuard.h +++ b/src/Common/Scheduler/ResourceGuard.h @@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` req...
[ "src/Common/Scheduler/ResourceGuard.h" ]
[ { "comment": "`enqueueRequestUsingBudget` commits `budget.ask` before it calls the concrete `enqueueRequest`, so this recovery path is not enough when `enqueueRequest` throws before linking the request (for example `SERVER_OVERLOADED` from `max_waiting_queries`, or `INVALID_SCHEDULER_NODE`). The request never e...
true
ClickHouse/ClickHouse
106,690
comment_to_fix
Fix spurious resource request failure from reused `ResourceGuard::Request`
This recovery is only wired into the `ResourceGuard` constructor, but `ResourceGuard::Request` has another owner: `ResourceGuardSessionDataHooks` in `src/Common/HTTPConnectionPool.cpp`. `HTTPSession::write`/`HTTPSession::receive` catch exceptions thrown from `atStart` and unconditionally call `atFail`. If `request.enqu...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
da47f28415c7460ae1d6385dd4fa20fedae1f0be
diff --git a/src/Common/Scheduler/ResourceGuard.h b/src/Common/Scheduler/ResourceGuard.h index 5d894b8b9ed5..402c3a782ce1 100644 --- a/src/Common/Scheduler/ResourceGuard.h +++ b/src/Common/Scheduler/ResourceGuard.h @@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` req...
[ "src/Common/Scheduler/ResourceGuard.h" ]
[ { "comment": "This recovery is only wired into the `ResourceGuard` constructor, but `ResourceGuard::Request` has another owner: `ResourceGuardSessionDataHooks` in `src/Common/HTTPConnectionPool.cpp`. `HTTPSession::write`/`HTTPSession::receive` catch exceptions thrown from `atStart` and unconditionally call `atF...
true
ClickHouse/ClickHouse
106,185
issue_to_patch
Add embedded documentation for aggregate function combinators
Part of the series adding embedded, runtime-introspectable documentation to ClickHouse component registries (table engines [#106177](https://github.com/ClickHouse/ClickHouse/pull/106177), database engines [#106178](https://github.com/ClickHouse/ClickHouse/pull/106178), data types [#106180](https://github.com/ClickHouse...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/src/AggregateFunctions/Combinators/AggregateFunctionArray.cpp b/src/AggregateFunctions/Combinators/AggregateFunctionArray.cpp index 86fceb681a75..24850d7d2afa 100644 --- a/src/AggregateFunctions/Combinators/AggregateFunctionArray.cpp +++ b/src/AggregateFunctions/Combinators/AggregateFunctionArray.cpp @@ -5...
[ "src/AggregateFunctions/Combinators/AggregateFunctionArray.cpp", "src/AggregateFunctions/Combinators/AggregateFunctionCombinatorFactory.cpp", "src/AggregateFunctions/Combinators/AggregateFunctionCombinatorFactory.h", "src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp", "src/Agg...
[ { "comment": "The contract here is runtime-introspectable documentation for the combinator itself, but this description is only correct for single-argument nested aggregates such as `sumArgMin(x, key)`. `ArgMin` also supports zero-argument nested aggregates (`countArgMin(key)`) and multi-argument ones (`corrArg...
diff --git a/tests/queries/0_stateless/02117_show_create_table_system.reference b/tests/queries/0_stateless/02117_show_create_table_system.reference index 4db93d47ea91..92ac2450538d 100644 --- a/tests/queries/0_stateless/02117_show_create_table_system.reference +++ b/tests/queries/0_stateless/02117_show_create_table_sy...
true
ClickHouse/ClickHouse
106,185
comment_to_fix
Add embedded documentation for aggregate function combinators
The contract here is runtime-introspectable documentation for the combinator itself, but this description is only correct for single-argument nested aggregates such as `sumArgMin(x, key)`. `ArgMin` also supports zero-argument nested aggregates (`countArgMin(key)`) and multi-argument ones (`corrArgMin(x, y, key)`); in g...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp b/src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp index dd89576a71c1..f62c49b72ce4 100644 --- a/src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp +++ b/src/Aggregate...
[ "src/AggregateFunctions/Combinators/AggregateFunctionCombinatorsArgMinArgMax.cpp" ]
[ { "comment": "The contract here is runtime-introspectable documentation for the combinator itself, but this description is only correct for single-argument nested aggregates such as `sumArgMin(x, key)`. `ArgMin` also supports zero-argument nested aggregates (`countArgMin(key)`) and multi-argument ones (`corrArg...
true
ClickHouse/ClickHouse
106,185
comment_to_fix
Add embedded documentation for aggregate function combinators
This `syntax` value omits the second call that supplies the nested aggregate arguments and resampling key. The existing public syntax is `"<aggregate_function>Resample(start, end, step)(<aggregate_function_arguments>, resampling_key)"` (for example, `sumResample(0, 10, 1)(value, key)`), so the current value is incomple...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/src/AggregateFunctions/Combinators/AggregateFunctionResample.cpp b/src/AggregateFunctions/Combinators/AggregateFunctionResample.cpp index 41652432331f..f74a4059a005 100644 --- a/src/AggregateFunctions/Combinators/AggregateFunctionResample.cpp +++ b/src/AggregateFunctions/Combinators/AggregateFunctionResamp...
[ "src/AggregateFunctions/Combinators/AggregateFunctionResample.cpp" ]
[ { "comment": "This `syntax` value omits the second call that supplies the nested aggregate arguments and resampling key. The existing public syntax is `\"<aggregate_function>Resample(start, end, step)(<aggregate_function_arguments>, resampling_key)\"` (for example, `sumResample(0, 10, 1)(value, key)`), so the c...
true
ClickHouse/ClickHouse
106,185
comment_to_fix
Add embedded documentation for aggregate function combinators
The embedded docs should not describe `SimpleState` as returning an aggregate state. `AggregateFunctionSimpleState` delegates `insertResultInto` to the nested function, and the existing public docs describe this combinator as returning the same final value with a `SimpleAggregateFunction` type. As written, `system.aggr...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/src/AggregateFunctions/Combinators/AggregateFunctionSimpleState.cpp b/src/AggregateFunctions/Combinators/AggregateFunctionSimpleState.cpp index c9c9ddcf8228..d9df7eef5b92 100644 --- a/src/AggregateFunctions/Combinators/AggregateFunctionSimpleState.cpp +++ b/src/AggregateFunctions/Combinators/AggregateFunct...
[ "src/AggregateFunctions/Combinators/AggregateFunctionSimpleState.cpp" ]
[ { "comment": "The embedded docs should not describe `SimpleState` as returning an aggregate state. `AggregateFunctionSimpleState` delegates `insertResultInto` to the nested function, and the existing public docs describe this combinator as returning the same final value with a `SimpleAggregateFunction` type. As...
true
ClickHouse/ClickHouse
106,185
comment_to_fix
Add embedded documentation for aggregate function combinators
The PR contract is that every registered user-facing aggregate function combinator has embedded `description` and `syntax`, but this assertion samples only five names. Since `AggregateFunctionCombinatorFactory::registerCombinator` still accepts default-empty `Documentation`, the test would pass if `ForEach`, `Map`, `Si...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
1cfb6342b4652f83cd4799547ffe64ec00dff9e1
diff --git a/tests/queries/0_stateless/04305_aggregate_function_combinators_documentation.sql b/tests/queries/0_stateless/04305_aggregate_function_combinators_documentation.sql new file mode 100644 index 000000000000..f45409b495ac --- /dev/null +++ b/tests/queries/0_stateless/04305_aggregate_function_combinators_docume...
[ "tests/queries/0_stateless/04305_aggregate_function_combinators_documentation.sql" ]
[ { "comment": "The PR contract is that every registered user-facing aggregate function combinator has embedded `description` and `syntax`, but this assertion samples only five names. Since `AggregateFunctionCombinatorFactory::registerCombinator` still accepts default-empty `Documentation`, the test would pass if...
true
ClickHouse/ClickHouse
106,182
issue_to_patch
Add embedded documentation and a system table for dictionary layouts
Fifth PR in the series that adds embedded, runtime-introspectable documentation to ClickHouse component registries (after table engines [#106177](https://github.com/ClickHouse/ClickHouse/pull/106177), database engines [#106178](https://github.com/ClickHouse/ClickHouse/pull/106178), data types [#106180](https://github.c...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
c00a16a40690dcc4ac2f0115d37762520ed0a375
diff --git a/docs/en/operations/system-tables/dictionary_layouts.md b/docs/en/operations/system-tables/dictionary_layouts.md new file mode 100644 index 000000000000..fc1df6d066bd --- /dev/null +++ b/docs/en/operations/system-tables/dictionary_layouts.md @@ -0,0 +1,45 @@ +--- +description: 'System table containing a lis...
[ "docs/en/operations/system-tables/dictionary_layouts.md", "src/Access/ContextAccess.cpp", "src/Dictionaries/DictionaryFactory.cpp", "src/Dictionaries/DictionaryFactory.h", "src/Dictionaries/DirectDictionary.cpp", "src/Dictionaries/FlatDictionary.cpp", "src/Dictionaries/HashedArrayDictionary.cpp", "src...
[ { "comment": "New documentation files under `docs/` must include the full required frontmatter set: `description`, `sidebar_label`, `sidebar_position`, `slug`, `title`, and `doc_type`. This page currently omits `sidebar_label` and `sidebar_position`, so it does not satisfy the repo documentation metadata contra...
diff --git a/tests/queries/0_stateless/02117_show_create_table_system.reference b/tests/queries/0_stateless/02117_show_create_table_system.reference index 4db93d47ea91..1135e82502ab 100644 --- a/tests/queries/0_stateless/02117_show_create_table_system.reference +++ b/tests/queries/0_stateless/02117_show_create_table_sy...
true
ClickHouse/ClickHouse
106,182
comment_to_fix
Add embedded documentation and a system table for dictionary layouts
New documentation files under `docs/` must include the full required frontmatter set: `description`, `sidebar_label`, `sidebar_position`, `slug`, `title`, and `doc_type`. This page currently omits `sidebar_label` and `sidebar_position`, so it does not satisfy the repo documentation metadata contract and can be missed o...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
c00a16a40690dcc4ac2f0115d37762520ed0a375
diff --git a/docs/en/operations/system-tables/dictionary_layouts.md b/docs/en/operations/system-tables/dictionary_layouts.md new file mode 100644 index 000000000000..fc1df6d066bd --- /dev/null +++ b/docs/en/operations/system-tables/dictionary_layouts.md @@ -0,0 +1,45 @@ +--- +description: 'System table containing a lis...
[ "docs/en/operations/system-tables/dictionary_layouts.md" ]
[ { "comment": "New documentation files under `docs/` must include the full required frontmatter set: `description`, `sidebar_label`, `sidebar_position`, `slug`, `title`, and `doc_type`. This page currently omits `sidebar_label` and `sidebar_position`, so it does not satisfy the repo documentation metadata contra...
true
ClickHouse/ClickHouse
106,182
comment_to_fix
Add embedded documentation and a system table for dictionary layouts
Adding `system.dictionary_layouts` here makes its columns and table comment part of the system-table schema contract, but the existing `02117_show_create_table_system` regression is not updated to include it. The new `04305_dictionary_layouts_documentation` test checks selected rows/content, but it would not catch acci...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
c00a16a40690dcc4ac2f0115d37762520ed0a375
diff --git a/src/Storages/System/attachSystemTables.cpp b/src/Storages/System/attachSystemTables.cpp index 4c8a2b628178..df3a809d8e57 100644 --- a/src/Storages/System/attachSystemTables.cpp +++ b/src/Storages/System/attachSystemTables.cpp @@ -22,6 +22,7 @@ #include <Storages/System/StorageSystemDataSkippingIndices.h> ...
[ "src/Storages/System/attachSystemTables.cpp" ]
[ { "comment": "Adding `system.dictionary_layouts` here makes its columns and table comment part of the system-table schema contract, but the existing `02117_show_create_table_system` regression is not updated to include it. The new `04305_dictionary_layouts_documentation` test checks selected rows/content, but i...
true
ClickHouse/ClickHouse
106,182
comment_to_fix
Add embedded documentation and a system table for dictionary layouts
`system.dictionary_layouts` is added as a harmless registry/introspection table, but the implicit-access allowlist in `ContextAccess::addImplicitAccessRights` is not updated. With the default server config `access_control_improvements.select_from_system_db_requires_grant=true`, users without explicit grants keep implic...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
c00a16a40690dcc4ac2f0115d37762520ed0a375
diff --git a/src/Storages/System/attachSystemTables.cpp b/src/Storages/System/attachSystemTables.cpp index 4c8a2b628178..df3a809d8e57 100644 --- a/src/Storages/System/attachSystemTables.cpp +++ b/src/Storages/System/attachSystemTables.cpp @@ -22,6 +22,7 @@ #include <Storages/System/StorageSystemDataSkippingIndices.h> ...
[ "src/Storages/System/attachSystemTables.cpp" ]
[ { "comment": "`system.dictionary_layouts` is added as a harmless registry/introspection table, but the implicit-access allowlist in `ContextAccess::addImplicitAccessRights` is not updated. With the default server config `access_control_improvements.select_from_system_db_requires_grant=true`, users without expli...
true
ClickHouse/ClickHouse
107,358
issue_to_patch
Add regression test for recursive CTE referenced from another recursive CTE
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/issues/89844 --> Related: #89844 ### Changelog category (leave one): - CI Fix or Improvement (changelog entry is not required) ### Changelog entr...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
637b70a43f4aedb960737c5cbb6860d2ad7e28c6
[ "tests/queries/0_stateless/04337_recursive_cte_inner_ref_no_logical_error.reference", "tests/queries/0_stateless/04337_recursive_cte_inner_ref_no_logical_error.sql" ]
[]
diff --git a/tests/queries/0_stateless/04337_recursive_cte_inner_ref_no_logical_error.reference b/tests/queries/0_stateless/04337_recursive_cte_inner_ref_no_logical_error.reference new file mode 100644 index 000000000000..fd3c81a4d763 --- /dev/null +++ b/tests/queries/0_stateless/04337_recursive_cte_inner_ref_no_logica...
true
ClickHouse/ClickHouse
107,326
issue_to_patch
Backport #105544 to 26.3: Fix ignoring `input_format_try_infer_datetimes` during insertion into shared data in JSON
Original pull-request https://github.com/ClickHouse/ClickHouse/pull/105544 Cherry-pick pull-request https://github.com/ClickHouse/ClickHouse/pull/107325 This pull-request is a last step of an automated backporting. Treat it as a standard pull-request: look at the checks and resolve conflicts. Merge it only if you inte...
a8282a90557dc185a09b8a636dc0fb2cf07ae8fe
7696bab5662bb22abb64a353e3f57fe60ad24173
diff --git a/src/Formats/JSONExtractTree.cpp b/src/Formats/JSONExtractTree.cpp index 29934e72dcaf..e127fe77cd67 100644 --- a/src/Formats/JSONExtractTree.cpp +++ b/src/Formats/JSONExtractTree.cpp @@ -2206,6 +2206,7 @@ class ObjectJSONNode : public JSONExtractTreeNode<JSONParser> } }...
[ "src/Formats/JSONExtractTree.cpp", "tests/queries/0_stateless/04264_json_shared_data_respect_try_infer_datetimes.reference", "tests/queries/0_stateless/04264_json_shared_data_respect_try_infer_datetimes.sh" ]
[]
diff --git a/tests/queries/0_stateless/04264_json_shared_data_respect_try_infer_datetimes.reference b/tests/queries/0_stateless/04264_json_shared_data_respect_try_infer_datetimes.reference new file mode 100644 index 000000000000..d4e612e75c69 --- /dev/null +++ b/tests/queries/0_stateless/04264_json_shared_data_respect_...
true
ClickHouse/ClickHouse
100,177
issue_to_patch
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
When a new job is scheduled, the thread pool now wakes the most recently idle thread (LIFO order) instead of an OS-determined arbitrary thread. This concentrates work on fewer OS threads, which: 1. Reduces memory fragmentation from jemalloc per-thread caches (tcache). Previously, work spread across many threads caused...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/Scheduler/ResourceGuard.h b/src/Common/Scheduler/ResourceGuard.h index 5d894b8b9ed5..6dcc4e825825 100644 --- a/src/Common/Scheduler/ResourceGuard.h +++ b/src/Common/Scheduler/ResourceGuard.h @@ -95,6 +95,10 @@ class ResourceGuard // lock(mutex) is not required because `Finished` req...
[ "src/Common/Scheduler/ResourceGuard.h", "src/Common/ThreadPool.cpp", "src/Common/ThreadPool.h", "src/Common/tests/gtest_thread_pool_lifo.cpp", "tests/queries/0_stateless/03350_alter_table_fetch_partition_thread_pool.sql" ]
[ { "comment": "`ThreadFromThreadPool::worker` runs under `DENY_ALLOCATIONS_IN_SCOPE`, but `idle_thread_stack.push_back(this)` can allocate when the vector grows. That introduces allocation attempts on the worker path and can trigger allocation-denial failures/assertions.\n\nPlease make this container allocation-...
diff --git a/src/Common/tests/gtest_thread_pool_lifo.cpp b/src/Common/tests/gtest_thread_pool_lifo.cpp new file mode 100644 index 000000000000..268ed6df1da2 --- /dev/null +++ b/src/Common/tests/gtest_thread_pool_lifo.cpp @@ -0,0 +1,299 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
`ThreadFromThreadPool::worker` runs under `DENY_ALLOCATIONS_IN_SCOPE`, but `idle_thread_stack.push_back(this)` can allocate when the vector grows. That introduces allocation attempts on the worker path and can trigger allocation-denial failures/assertions. Please make this container allocation-free on worker paths (fo...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
[ "src/Common/ThreadPool.h" ]
[ { "comment": "`ThreadFromThreadPool::worker` runs under `DENY_ALLOCATIONS_IN_SCOPE`, but `idle_thread_stack.push_back(this)` can allocate when the vector grows. That introduces allocation attempts on the worker path and can trigger allocation-denial failures/assertions.\n\nPlease make this container allocation-...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
`ThreadPool.h` now declares `std::vector<ThreadFromThreadPool *> idle_thread_stack`, but this header does not include `<vector>` directly. Relying on transitive includes is fragile and can cause build exceptions when include graphs change. Please add `#include <vector>` to this header explicitly.
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
[ "src/Common/ThreadPool.h" ]
[ { "comment": "`ThreadPool.h` now declares `std::vector<ThreadFromThreadPool *> idle_thread_stack`, but this header does not include `<vector>` directly.\n\nRelying on transitive includes is fragile and can cause build exceptions when include graphs change. Please add `#include <vector>` to this header explicitl...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
This PR changes core `ThreadPool` wake-up semantics (global `new_job_or_shutdown` -> per-thread LIFO signaling), but there is no new regression test that validates the new behavior. Please add at least one deterministic test in `src/Common/tests/` that exercises the new wake-up path and guards against lost wakeups/dea...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "This PR changes core `ThreadPool` wake-up semantics (global `new_job_or_shutdown` -> per-thread LIFO signaling), but there is no new regression test that validates the new behavior.\n\nPlease add at least one deterministic test in `src/Common/tests/` that exercises the new wake-up path and guards ...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
`std::erase(parent_pool.idle_thread_stack, this)` is `O(idle_threads)` and runs while holding `parent_pool.mutex` on a worker wake-up path. Because `new_job_or_shutdown.notify_one` can wake a different waiter than the one selected via `idle_wakeup_flag`, this branch can execute frequently under contention. That turns ...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "`std::erase(parent_pool.idle_thread_stack, this)` is `O(idle_threads)` and runs while holding `parent_pool.mutex` on a worker wake-up path.\n\nBecause `new_job_or_shutdown.notify_one` can wake a different waiter than the one selected via `idle_wakeup_flag`, this branch can execute frequently under...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
`ThreadPool::scheduleImpl` tries to prioritize a specific idle worker by setting `idle_wakeup_flag`, but the waiter predicate still allows *any* waiter to pass on `!parent_pool.jobs.empty()`. After `notify_one`, an arbitrary thread can wake first, satisfy `!jobs.empty()`, and take the job even when `idle_wakeup_flag` ...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "`ThreadPool::scheduleImpl` tries to prioritize a specific idle worker by setting `idle_wakeup_flag`, but the waiter predicate still allows *any* waiter to pass on `!parent_pool.jobs.empty()`.\n\nAfter `notify_one`, an arbitrary thread can wake first, satisfy `!jobs.empty()`, and take the job even ...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
`wait` now calls `wakeUpAllIdleThreadsNoLock`, which sets `idle_wakeup_flag = true` for all idle workers. In `ThreadFromThreadPool::worker`, that flag makes the wait predicate pass even when there is no job and no shutdown/excess-thread condition. The loop then falls through to: ```cpp if (parent_pool.jobs.empty() ||...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "`wait` now calls `wakeUpAllIdleThreadsNoLock`, which sets `idle_wakeup_flag = true` for all idle workers.\n\nIn `ThreadFromThreadPool::worker`, that flag makes the wait predicate pass even when there is no job and no shutdown/excess-thread condition. The loop then falls through to:\n\n```cpp\nif (...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
Calling `wakeUpAllIdleThreadsNoLock` from `setMaxThreads` / `setMaxFreeThreads` can tear down **all** idle workers, not only excess ones. Concrete trace (no jobs): 1. Assume `threads.size() = 40`, `max_threads = 64`, `max_free_threads = 40`, `scheduled_jobs = 0`. 2. `setMaxThreads(63)` executes this line and `wakeUpAl...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "Calling `wakeUpAllIdleThreadsNoLock` from `setMaxThreads` / `setMaxFreeThreads` can tear down **all** idle workers, not only excess ones.\n\nConcrete trace (no jobs):\n1. Assume `threads.size() = 40`, `max_threads = 64`, `max_free_threads = 40`, `scheduled_jobs = 0`.\n2. `setMaxThreads(63)` execut...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
The comment says "shared condition variable", but this path now waits on the per-thread `idle_cv`. Please update the wording to avoid confusion during future maintenance.
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "The comment says \"shared condition variable\", but this path now waits on the per-thread `idle_cv`. Please update the wording to avoid confusion during future maintenance.\n", "path": "src/Common/ThreadPool.cpp", "hunk": "@@ -730,15 +769,52 @@ void ThreadPoolImpl<Thread>::ThreadFromThread...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
Using `ssize_t` in this public header makes the type source implicit and platform-dependent. `ssize_t` is not a standard C++ type and currently relies on transitive includes. Please switch this field to `std::ptrdiff_t` (or include the defining header explicitly) to avoid fragile build breakage when include graphs cha...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
[ "src/Common/ThreadPool.h" ]
[ { "comment": "Using `ssize_t` in this public header makes the type source implicit and platform-dependent. `ssize_t` is not a standard C++ type and currently relies on transitive includes.\n\nPlease switch this field to `std::ptrdiff_t` (or include the defining header explicitly) to avoid fragile build breakage...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
This change now calls `new_job_or_shutdown.notify_all` for every scheduled job. With many idle workers, each enqueue wakes *all* waiters, so one job dispatch becomes O(idle_threads) wakeups and lock-contention cycles. In the global pool (`max_free_threads` can be large), this can regress throughput/latency under bursty...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "This change now calls `new_job_or_shutdown.notify_all` for every scheduled job. With many idle workers, each enqueue wakes *all* waiters, so one job dispatch becomes O(idle_threads) wakeups and lock-contention cycles. In the global pool (`max_free_threads` can be large), this can regress throughpu...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
If it's redundant, remove it.
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "If it's redundant, remove it.", "path": "src/Common/ThreadPool.cpp", "hunk": "@@ -511,10 +531,10 @@ void ThreadPoolImpl<Thread>::wait()\n ProfileEvents::increment(\n std::is_same_v<Thread, std::thread> ? ProfileEvents::GlobalThreadPoolLockWaitMicroseconds : ProfileEvents::Local...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
Remove the safety net. If the code is correct, we don't need it. If the code is not correct, we have to fix it.
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "Remove the safety net. If the code is correct, we don't need it. If the code is not correct, we have to fix it.", "path": "src/Common/ThreadPool.cpp", "hunk": "@@ -730,15 +762,62 @@ void ThreadPoolImpl<Thread>::ThreadFromThreadPool::worker()\n \n parent_pool.job_finished.no...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
The comment says the worker wait predicate checks **only** `idle_wakeup_flag`, but the implementation now also wakes on `!jobs.empty()`, `shutdown`, and excess-thread conditions (see `worker` wait predicate in `ThreadPool.cpp`). Please update this comment to match the actual predicate. In this concurrency-sensitive ar...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.h b/src/Common/ThreadPool.h index bb73c1a10041..1e82b48bdc61 100644 --- a/src/Common/ThreadPool.h +++ b/src/Common/ThreadPool.h @@ -64,6 +64,9 @@ class ThreadPoolImpl ~ThreadFromThreadPool(); private: + /// Allow enclosing ThreadPoolImpl to access per-thread idl...
[ "src/Common/ThreadPool.h" ]
[ { "comment": "The comment says the worker wait predicate checks **only** `idle_wakeup_flag`, but the implementation now also wakes on `!jobs.empty()`, `shutdown`, and excess-thread conditions (see `worker` wait predicate in `ThreadPool.cpp`).\n\nPlease update this comment to match the actual predicate. In this ...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
The new test validates that jobs eventually start, but it does not check the PR contract that `ThreadPool` wakes the *most recently idle* worker. Because this PR’s user-facing claim is specifically LIFO worker selection, please add a deterministic assertion on wake order (for example, drive two+ workers into a known i...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/tests/gtest_thread_pool_lifo.cpp b/src/Common/tests/gtest_thread_pool_lifo.cpp new file mode 100644 index 000000000000..268ed6df1da2 --- /dev/null +++ b/src/Common/tests/gtest_thread_pool_lifo.cpp @@ -0,0 +1,299 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <...
[ "src/Common/tests/gtest_thread_pool_lifo.cpp" ]
[ { "comment": "The new test validates that jobs eventually start, but it does not check the PR contract that `ThreadPool` wakes the *most recently idle* worker.\n\nBecause this PR’s user-facing claim is specifically LIFO worker selection, please add a deterministic assertion on wake order (for example, drive two...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
`LIFONotifyWithThreadSelfRemoval` covers job completion under churn, but the regression that drove several earlier threads was in the limit-shrink wakeup path (`setMaxThreads`/`setMaxFreeThreads` via `wakeUpExcessIdleThreadsNoLock`). Please add a focused test that starts with many idle workers, shrinks limits, and ass...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/tests/gtest_thread_pool_lifo.cpp b/src/Common/tests/gtest_thread_pool_lifo.cpp new file mode 100644 index 000000000000..268ed6df1da2 --- /dev/null +++ b/src/Common/tests/gtest_thread_pool_lifo.cpp @@ -0,0 +1,299 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <...
[ "src/Common/tests/gtest_thread_pool_lifo.cpp" ]
[ { "comment": "`LIFONotifyWithThreadSelfRemoval` covers job completion under churn, but the regression that drove several earlier threads was in the limit-shrink wakeup path (`setMaxThreads`/`setMaxFreeThreads` via `wakeUpExcessIdleThreadsNoLock`).\n\nPlease add a focused test that starts with many idle workers,...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
Because `idle_wakeup_flag` alone satisfies this predicate, the selected idle worker can pass the wait after the queued job has already been taken by a worker that just finished another job. In that case it falls through to the later `jobs.empty()` check and removes itself from the pool even though there is no shutdown ...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index ca6fc24a9b54..cb5414214d45 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -12,6 +12,7 @@ #include <base/scope_guard.h> #include <type_traits> +#include <vector> #include <Poco/Util/Application.h> #include <Poco/U...
[ "src/Common/ThreadPool.cpp" ]
[ { "comment": "Because `idle_wakeup_flag` alone satisfies this predicate, the selected idle worker can pass the wait after the queued job has already been taken by a worker that just finished another job. In that case it falls through to the later `jobs.empty()` check and removes itself from the pool even though...
true
ClickHouse/ClickHouse
100,177
comment_to_fix
ThreadPool: wake most recently idle worker thread (LIFO) when scheduling a job to reduce memory fragmentation
This does not make the idle order deterministic. `probe_x_done` is set inside the probe lambda before that worker has decremented `scheduled_jobs` and pushed itself back onto the idle stack. After the main thread releases job B, the probe worker and B's worker race to reacquire `ThreadPool::mutex`; if the probe worker ...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
6555f83347cdcdb64e31699e7f5e92bf31e3e2ac
diff --git a/src/Common/tests/gtest_thread_pool_lifo.cpp b/src/Common/tests/gtest_thread_pool_lifo.cpp new file mode 100644 index 000000000000..268ed6df1da2 --- /dev/null +++ b/src/Common/tests/gtest_thread_pool_lifo.cpp @@ -0,0 +1,299 @@ +#include <Common/CurrentMetrics.h> +#include <Common/ThreadPool.h> + +#include <...
[ "src/Common/tests/gtest_thread_pool_lifo.cpp" ]
[ { "comment": "This does not make the idle order deterministic. `probe_x_done` is set inside the probe lambda before that worker has decremented `scheduled_jobs` and pushed itself back onto the idle stack. After the main thread releases job B, the probe worker and B's worker race to reacquire `ThreadPool::mutex`...
true
ClickHouse/ClickHouse
107,381
issue_to_patch
Disable parallel replicas in nested scalar subquery contexts
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/pull/94517 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [use...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
591768e8f7d17d09e42c107df0ea8081301d9c95
diff --git a/src/Analyzer/Resolve/evaluateScalarSubqueryIfNeeded.cpp b/src/Analyzer/Resolve/evaluateScalarSubqueryIfNeeded.cpp index f2a8973b1d6d..97922f168b26 100644 --- a/src/Analyzer/Resolve/evaluateScalarSubqueryIfNeeded.cpp +++ b/src/Analyzer/Resolve/evaluateScalarSubqueryIfNeeded.cpp @@ -145,6 +145,36 @@ void Que...
[ "src/Analyzer/Resolve/evaluateScalarSubqueryIfNeeded.cpp", "tests/queries/0_stateless/04337_parallel_replicas_scalar_subquery_no_leak.reference", "tests/queries/0_stateless/04337_parallel_replicas_scalar_subquery_no_leak.sh" ]
[]
diff --git a/tests/queries/0_stateless/04337_parallel_replicas_scalar_subquery_no_leak.reference b/tests/queries/0_stateless/04337_parallel_replicas_scalar_subquery_no_leak.reference new file mode 100644 index 000000000000..6190c7c66c72 --- /dev/null +++ b/tests/queries/0_stateless/04337_parallel_replicas_scalar_subque...
true
ClickHouse/ClickHouse
107,374
issue_to_patch
Fix in-place mutation of shared Variant subcolumn when converting Variant to a column
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/issues/101415 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
8e3b04f3ffa1ecc0b659147b61f8728198a669e2
diff --git a/src/Functions/FunctionDynamicAdaptor.cpp b/src/Functions/FunctionDynamicAdaptor.cpp index 7cd00eddb9c5..d0ec7f7babe8 100644 --- a/src/Functions/FunctionDynamicAdaptor.cpp +++ b/src/Functions/FunctionDynamicAdaptor.cpp @@ -31,6 +31,17 @@ namespace ErrorCodes extern const int NO_COMMON_TYPE; } +/// E...
[ "src/Functions/FunctionDynamicAdaptor.cpp", "src/Functions/FunctionVariantAdaptor.cpp", "src/Functions/FunctionsConversion.cpp", "tests/queries/0_stateless/04337_variant_to_column_inplace_mutation.reference", "tests/queries/0_stateless/04337_variant_to_column_inplace_mutation.sql" ]
[ { "comment": "This detaches the `Variant` fast path before `expand`, but the sibling `Dynamic` adaptor still has the same aliasing bug. In `FunctionDynamicAdaptor.cpp`, the single-type-plus-NULL path replaces the `Dynamic` argument with `variant_column.getVariantPtrByGlobalDiscriminator(global_discr)` and then ...
diff --git a/tests/queries/0_stateless/04337_variant_to_column_inplace_mutation.reference b/tests/queries/0_stateless/04337_variant_to_column_inplace_mutation.reference new file mode 100644 index 000000000000..c989f8e106ce --- /dev/null +++ b/tests/queries/0_stateless/04337_variant_to_column_inplace_mutation.reference ...
true
ClickHouse/ClickHouse
107,374
comment_to_fix
Fix in-place mutation of shared Variant subcolumn when converting Variant to a column
This detaches the `Variant` fast path before `expand`, but the sibling `Dynamic` adaptor still has the same aliasing bug. In `FunctionDynamicAdaptor.cpp`, the single-type-plus-NULL path replaces the `Dynamic` argument with `variant_column.getVariantPtrByGlobalDiscriminator(global_discr)` and then still calls `nested_re...
3659e5601eac2078ed0f3ccef17d3e9ea9bebc3c
8e3b04f3ffa1ecc0b659147b61f8728198a669e2
diff --git a/src/Functions/FunctionVariantAdaptor.cpp b/src/Functions/FunctionVariantAdaptor.cpp index f5fd599ab77e..68bf356ccfcd 100644 --- a/src/Functions/FunctionVariantAdaptor.cpp +++ b/src/Functions/FunctionVariantAdaptor.cpp @@ -59,6 +59,16 @@ static void removeLowCardinalityFromResult(DataTypePtr & result_type, ...
[ "src/Functions/FunctionVariantAdaptor.cpp" ]
[ { "comment": "This detaches the `Variant` fast path before `expand`, but the sibling `Dynamic` adaptor still has the same aliasing bug. In `FunctionDynamicAdaptor.cpp`, the single-type-plus-NULL path replaces the `Dynamic` argument with `variant_column.getVariantPtrByGlobalDiscriminator(global_discr)` and then ...
true
ClickHouse/ClickHouse
107,347
issue_to_patch
DeltaLake Logical error: Not found column cx in physical names map ### Describe the bug Not the same path as https://github.com/ClickHouse/ClickHouse/issues/87322 A `SELECT` from a persistent DeltaLake table aborts the server with: ``` Logical error: 'Not found column c0 in physical names map. There are only column...
Fix DeltaLake server abort on SELECT when a column is missing from the column mapping
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Closes: https://github.com/ClickHouse/ClickHouse/issues/NNNNN (auto-closes the issue when this PR is merged into the default branch) Related: https://github.com/ClickHouse/ClickHouse/pull/NNNNN -->...
6133237facb11dbea3105e927047ef9b49e9b35e
85a67b9a38593a624ccde2932da111fbd0387b92
diff --git a/src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelUtils.cpp b/src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelUtils.cpp index 90e8a73f1a78..48eefca1c513 100644 --- a/src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelUtils.cpp +++ b/src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelUtils.cpp @...
[ "src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelUtils.cpp", "tests/queries/0_stateless/04337_delta_lake_missing_column_in_mapping.reference", "tests/queries/0_stateless/04337_delta_lake_missing_column_in_mapping.sh" ]
[]
diff --git a/tests/queries/0_stateless/04337_delta_lake_missing_column_in_mapping.reference b/tests/queries/0_stateless/04337_delta_lake_missing_column_in_mapping.reference new file mode 100644 index 000000000000..241084c6bf19 --- /dev/null +++ b/tests/queries/0_stateless/04337_delta_lake_missing_column_in_mapping.refe...
true
ClickHouse/ClickHouse
104,896
issue_to_patch
Fix LOGICAL_ERROR for materialized CTE under serialize_query_plan + parallel replicas
Extracted from https://github.com/ClickHouse/ClickHouse/pull/97261 ### Changelog category (leave one): - Not for changelog (changelog entry is not required) --- Fix `LOGICAL_ERROR: CTE '...' does not have query tree, but was not planned yet` when a materialized CTE is used with parallel replicas and `serializ...
215ff2543f8b19ca39ac6707fc5cad6195c57880
517ea582d303548bad870f4bd0d0878d7d4463e4
diff --git a/src/Interpreters/ClusterProxy/executeQuery.cpp b/src/Interpreters/ClusterProxy/executeQuery.cpp index 2a7214cf865e..df5a73c56b4d 100644 --- a/src/Interpreters/ClusterProxy/executeQuery.cpp +++ b/src/Interpreters/ClusterProxy/executeQuery.cpp @@ -738,7 +738,7 @@ void executeQueryWithParallelReplicas( ...
[ "src/Interpreters/ClusterProxy/executeQuery.cpp", "src/Planner/Planner.cpp", "src/Processors/QueryPlan/ParallelReplicasLocalPlan.cpp", "src/Processors/QueryPlan/ParallelReplicasLocalPlan.h", "tests/queries/0_stateless/04043_materialized_cte_serialize_query_plan.sql", "tests/queries/0_stateless/04227_pr_ma...
[ { "comment": "This new `serialize_query_plan` block is reachable from the old-analyzer path, where `query_tree` is intentionally `nullptr`.\n\nConcrete path:\n- `StorageMergeTree::read` calls `ClusterProxy::executeQueryWithParallelReplicas` (AST overload) when analyzer is disabled.\n- That overload forwards `qu...
diff --git a/tests/queries/0_stateless/04043_materialized_cte_serialize_query_plan.sql b/tests/queries/0_stateless/04043_materialized_cte_serialize_query_plan.sql index c9fb959ecefa..51f635c7f8d2 100644 --- a/tests/queries/0_stateless/04043_materialized_cte_serialize_query_plan.sql +++ b/tests/queries/0_stateless/04043...
true
ClickHouse/ClickHouse
104,896
comment_to_fix
Fix LOGICAL_ERROR for materialized CTE under serialize_query_plan + parallel replicas
This new `serialize_query_plan` block is reachable from the old-analyzer path, where `query_tree` is intentionally `nullptr`. Concrete path: - `StorageMergeTree::read` calls `ClusterProxy::executeQueryWithParallelReplicas` (AST overload) when analyzer is disabled. - That overload forwards `query_tree = nullptr`. - Her...
215ff2543f8b19ca39ac6707fc5cad6195c57880
517ea582d303548bad870f4bd0d0878d7d4463e4
diff --git a/src/Interpreters/ClusterProxy/executeQuery.cpp b/src/Interpreters/ClusterProxy/executeQuery.cpp index 2a7214cf865e..df5a73c56b4d 100644 --- a/src/Interpreters/ClusterProxy/executeQuery.cpp +++ b/src/Interpreters/ClusterProxy/executeQuery.cpp @@ -738,7 +738,7 @@ void executeQueryWithParallelReplicas( ...
[ "src/Interpreters/ClusterProxy/executeQuery.cpp" ]
[ { "comment": "This new `serialize_query_plan` block is reachable from the old-analyzer path, where `query_tree` is intentionally `nullptr`.\n\nConcrete path:\n- `StorageMergeTree::read` calls `ClusterProxy::executeQueryWithParallelReplicas` (AST overload) when analyzer is disabled.\n- That overload forwards `qu...
true
ClickHouse/ClickHouse
104,896
comment_to_fix
Fix LOGICAL_ERROR for materialized CTE under serialize_query_plan + parallel replicas
This PR now fixes the non-local-plan path (`parallel_replicas_local_plan = 0`) by wiring `remote_query_plan` in `executeQueryWithParallelReplicas`, but the new/updated test cases here still run with local-plan enabled by default. Could we add an explicit variant with `parallel_replicas_local_plan = 0` for the material...
215ff2543f8b19ca39ac6707fc5cad6195c57880
517ea582d303548bad870f4bd0d0878d7d4463e4
diff --git a/tests/queries/0_stateless/04227_pr_materialized_cte_set_subquery.sql b/tests/queries/0_stateless/04227_pr_materialized_cte_set_subquery.sql new file mode 100644 index 000000000000..4ef6fb5ac96f --- /dev/null +++ b/tests/queries/0_stateless/04227_pr_materialized_cte_set_subquery.sql @@ -0,0 +1,23 @@ +SET en...
[ "tests/queries/0_stateless/04227_pr_materialized_cte_set_subquery.sql" ]
[ { "comment": "This PR now fixes the non-local-plan path (`parallel_replicas_local_plan = 0`) by wiring `remote_query_plan` in `executeQueryWithParallelReplicas`, but the new/updated test cases here still run with local-plan enabled by default.\n\nCould we add an explicit variant with `parallel_replicas_local_pl...
true
ClickHouse/ClickHouse
96,856
issue_to_patch
delta-kernel-rs: switch to default-engine-native-tls, keep MSan exclusion
### Changelog category (leave one): - Build/Testing/Packaging Improvement ### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.md): * Build `delta-kernel-rs` with the `default-engine-na...
48167c3e3c73c46327c9b40303e7335aee6f508d
aa76a0be3379849517188824c10f205b4d190703
diff --git a/contrib/delta-kernel-rs-cmake/CMakeLists.txt b/contrib/delta-kernel-rs-cmake/CMakeLists.txt index 7fc6082ee436..77498621515d 100644 --- a/contrib/delta-kernel-rs-cmake/CMakeLists.txt +++ b/contrib/delta-kernel-rs-cmake/CMakeLists.txt @@ -6,7 +6,14 @@ include(ExternalProject) set(USE_DELTA_KERNEL_RS ${EN...
[ "contrib/delta-kernel-rs-cmake/CMakeLists.txt" ]
[ { "comment": "This line confirms `delta-kernel-rs` is still disabled when `SANITIZE STREQUAL \"memory\"`.\n\nSo the current PR contract is inconsistent with the title/changelog text (`enable DeltaLake engine under MSan`, `Enables DeltaLake testing under MSan`). Please update the PR title and `Changelog entry` t...
true
ClickHouse/ClickHouse
96,856
comment_to_fix
delta-kernel-rs: switch to default-engine-native-tls, keep MSan exclusion
This line confirms `delta-kernel-rs` is still disabled when `SANITIZE STREQUAL "memory"`. So the current PR contract is inconsistent with the title/changelog text (`enable DeltaLake engine under MSan`, `Enables DeltaLake testing under MSan`). Please update the PR title and `Changelog entry` to describe the actual beha...
48167c3e3c73c46327c9b40303e7335aee6f508d
aa76a0be3379849517188824c10f205b4d190703
diff --git a/contrib/delta-kernel-rs-cmake/CMakeLists.txt b/contrib/delta-kernel-rs-cmake/CMakeLists.txt index 7fc6082ee436..77498621515d 100644 --- a/contrib/delta-kernel-rs-cmake/CMakeLists.txt +++ b/contrib/delta-kernel-rs-cmake/CMakeLists.txt @@ -6,7 +6,14 @@ include(ExternalProject) set(USE_DELTA_KERNEL_RS ${EN...
[ "contrib/delta-kernel-rs-cmake/CMakeLists.txt" ]
[ { "comment": "This line confirms `delta-kernel-rs` is still disabled when `SANITIZE STREQUAL \"memory\"`.\n\nSo the current PR contract is inconsistent with the title/changelog text (`enable DeltaLake engine under MSan`, `Enables DeltaLake testing under MSan`). Please update the PR title and `Changelog entry` t...
true
ClickHouse/ClickHouse
96,856
comment_to_fix
delta-kernel-rs: switch to default-engine-native-tls, keep MSan exclusion
The dependency graph still enables the Rustls TLS stack here. `default-engine-native-tls` adds `delta_kernel/default-engine-native-tls`, but the same feature set also enables `delta_kernel/arrow` through `default-engine-base`; that enables `object_store`, whose `reqwest` dependency is declared with `rustls-tls-native-r...
48167c3e3c73c46327c9b40303e7335aee6f508d
aa76a0be3379849517188824c10f205b4d190703
diff --git a/contrib/delta-kernel-rs-cmake/CMakeLists.txt b/contrib/delta-kernel-rs-cmake/CMakeLists.txt index 7fc6082ee436..77498621515d 100644 --- a/contrib/delta-kernel-rs-cmake/CMakeLists.txt +++ b/contrib/delta-kernel-rs-cmake/CMakeLists.txt @@ -6,7 +6,14 @@ include(ExternalProject) set(USE_DELTA_KERNEL_RS ${EN...
[ "contrib/delta-kernel-rs-cmake/CMakeLists.txt" ]
[ { "comment": "The dependency graph still enables the Rustls TLS stack here. `default-engine-native-tls` adds `delta_kernel/default-engine-native-tls`, but the same feature set also enables `delta_kernel/arrow` through `default-engine-base`; that enables `object_store`, whose `reqwest` dependency is declared wit...
true
ClickHouse/ClickHouse
94,681
issue_to_patch
`EXPLAIN SYNTAX` and `IQueryTreeNode::toAST` should format all operators as functions For example, `SELECT 1 + 2` will be formatted as `SELECT plus(1, 2)`. This will simplify everything and allow us to continue in https://github.com/ClickHouse/ClickHouse/pull/92340
Format operators as functions in EXPLAIN SYNTAX and toAST
Resolves #94603 `EXPLAIN SYNTAX` and the analyzer explain formatting paths now print operators as function calls (for example `plus(1, 2)` instead of `1 + 2`) by formatting AST output with `allow_operators = false` in `InterpreterExplainQuery`. The change also introduces `ConvertToASTOptions.use_source_expression_for...
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/src/Analyzer/ConstantNode.cpp b/src/Analyzer/ConstantNode.cpp index c79fc91de9cf..3f193443bcf8 100644 --- a/src/Analyzer/ConstantNode.cpp +++ b/src/Analyzer/ConstantNode.cpp @@ -180,6 +180,9 @@ ASTPtr ConstantNode::toASTImpl(const ConvertToASTOptions & options) const static const auto from_column = []...
[ "src/Analyzer/ConstantNode.cpp", "src/Analyzer/IQueryTreeNode.h", "src/Interpreters/InterpreterExplainQuery.cpp", "src/Parsers/ASTFunction.cpp", "src/Parsers/IAST.cpp", "tests/queries/0_stateless/00597_push_down_predicate_long.reference", "tests/queries/0_stateless/00808_not_optimize_predicate.oldanalyz...
[ { "comment": "(minor thing, could you change\n\n```\n-- Unary operators\n```\n\nto\n\n```sql\nSELECT 'Unary operators';\n```\n\nsuch that the reference file gains some \"separators\" between expected results?", "path": "tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql", "hunk": ...
diff --git a/tests/queries/0_stateless/00597_push_down_predicate_long.reference b/tests/queries/0_stateless/00597_push_down_predicate_long.reference index 5cc57fd58f20..fc9eacf1f5d6 100644 --- a/tests/queries/0_stateless/00597_push_down_predicate_long.reference +++ b/tests/queries/0_stateless/00597_push_down_predicate_...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
(minor thing, could you change ``` -- Unary operators ``` to ```sql SELECT 'Unary operators'; ``` such that the reference file gains some "separators" between expected results?
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql b/tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql new file mode 100644 index 000000000000..5995614cdf32 --- /dev/null +++ b/tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql @@ -0,0 +...
[ "tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql" ]
[ { "comment": "(minor thing, could you change\n\n```\n-- Unary operators\n```\n\nto\n\n```sql\nSELECT 'Unary operators';\n```\n\nsuch that the reference file gains some \"separators\" between expected results?", "path": "tests/queries/0_stateless/03800_explain_syntax_operators_as_functions.sql", "hunk": ...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
This is incorrect. `EXPLAIN QUERY TREE` is supposed to show how the query looks after the application of the query tree passes.
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/src/Interpreters/InterpreterExplainQuery.cpp b/src/Interpreters/InterpreterExplainQuery.cpp index be4b226744eb..ce939803ec76 100644 --- a/src/Interpreters/InterpreterExplainQuery.cpp +++ b/src/Interpreters/InterpreterExplainQuery.cpp @@ -555,7 +555,8 @@ bool explainQueryTree( ASTPtr explained_query, ...
[ "src/Interpreters/InterpreterExplainQuery.cpp" ]
[ { "comment": "This is incorrect. `EXPLAIN QUERY TREE` is supposed to show how the query looks after the application of the query tree passes.", "path": "src/Interpreters/InterpreterExplainQuery.cpp", "hunk": "@@ -468,7 +468,13 @@ bool explainQueryTree(\n IAST::FormatSettings format_settings(sett...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
This is the correct output.
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference b/tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference index d7e55a8e210b..f4a260c38322 100644 --- a/tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference +++ b/tests/queries/0_stateless/00826...
[ "tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference" ]
[ { "comment": "This is the correct output.", "path": "tests/queries/0_stateless/00826_cross_to_inner_join.oldanalyzer.reference", "hunk": "@@ -49,148 +49,88 @@\n 1\t1\t1\t1\n 2\t2\t2\t\\N\n --- cross ---\n-SELECT\n- a,\n- b,\n- t2_00826.a,\n- t2_00826.b\n+SELECT *\n FROM t1_00826\n-ALL INNER ...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
`01566_negate_formatting.sql` still contains `explain syntax select negate(...)` queries, but this `-- { echo }` reference line was changed to `-...`. `echo` sections must match the exact input query text; otherwise `Fast test` fails before comparing result rows. Please regenerate this `.reference` from the current `.s...
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/01566_negate_formatting.reference b/tests/queries/0_stateless/01566_negate_formatting.reference index 56d80dad4b2c..06a6e3851db8 100644 --- a/tests/queries/0_stateless/01566_negate_formatting.reference +++ b/tests/queries/0_stateless/01566_negate_formatting.reference @@ -3,37 +3,3...
[ "tests/queries/0_stateless/01566_negate_formatting.reference" ]
[ { "comment": "`01566_negate_formatting.sql` still contains `explain syntax select negate(...)` queries, but this `-- { echo }` reference line was changed to `-...`. `echo` sections must match the exact input query text; otherwise `Fast test` fails before comparing result rows. Please regenerate this `.reference...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
`02006_test_positional_arguments.sql` still runs `if(x3 > 10, x3, plus(x1, x2))` and `plus(1, 1) AS a`, but this reference now expects `x1 + x2` / `1 + 1`. That desynchronizes the `-- { echo }` block from the unchanged `.sql` input and is likely to fail `Fast test`. Please regenerate this `.reference` from the current ...
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/02006_test_positional_arguments.reference b/tests/queries/0_stateless/02006_test_positional_arguments.reference index 2b8863624c61..8b15f17be11f 100644 --- a/tests/queries/0_stateless/02006_test_positional_arguments.reference +++ b/tests/queries/0_stateless/02006_test_positional_a...
[ "tests/queries/0_stateless/02006_test_positional_arguments.reference" ]
[ { "comment": "`02006_test_positional_arguments.sql` still runs `if(x3 > 10, x3, plus(x1, x2))` and `plus(1, 1) AS a`, but this reference now expects `x1 + x2` / `1 + 1`. That desynchronizes the `-- { echo }` block from the unchanged `.sql` input and is likely to fail `Fast test`. Please regenerate this `.refere...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
`02035_isNull_isNotNull_format.sql` still has `explain syntax select isNull(null);` and `explain syntax select isNotNull(null);`, but this `.reference` replaces them with `null IS NULL` / `null IS NOT NULL`. This breaks `-- { echo }` alignment with the test input. Please regenerate this `.reference` so it matches the u...
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/tests/queries/0_stateless/02035_isNull_isNotNull_format.reference b/tests/queries/0_stateless/02035_isNull_isNotNull_format.reference index 942858105d03..28cb53238127 100644 --- a/tests/queries/0_stateless/02035_isNull_isNotNull_format.reference +++ b/tests/queries/0_stateless/02035_isNull_isNotNull_format...
[ "tests/queries/0_stateless/02035_isNull_isNotNull_format.reference" ]
[ { "comment": "`02035_isNull_isNotNull_format.sql` still has `explain syntax select isNull(null);` and `explain syntax select isNotNull(null);`, but this `.reference` replaces them with `null IS NULL` / `null IS NOT NULL`. This breaks `-- { echo }` alignment with the test input. Please regenerate this `.referenc...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
`explainQueryTree` is used by both `EXPLAIN SYNTAX` and `EXPLAIN QUERY TREE`. Setting `ast_options.use_source_expression_for_constants = true` unconditionally here changes `EXPLAIN QUERY TREE dump_ast=1` semantics: folded constants are printed as their source expressions, so the dump no longer reflects the post-pass qu...
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/src/Interpreters/InterpreterExplainQuery.cpp b/src/Interpreters/InterpreterExplainQuery.cpp index be4b226744eb..ce939803ec76 100644 --- a/src/Interpreters/InterpreterExplainQuery.cpp +++ b/src/Interpreters/InterpreterExplainQuery.cpp @@ -555,7 +555,8 @@ bool explainQueryTree( ASTPtr explained_query, ...
[ "src/Interpreters/InterpreterExplainQuery.cpp" ]
[ { "comment": "`explainQueryTree` is used by both `EXPLAIN SYNTAX` and `EXPLAIN QUERY TREE`. Setting `ast_options.use_source_expression_for_constants = true` unconditionally here changes `EXPLAIN QUERY TREE dump_ast=1` semantics: folded constants are printed as their source expressions, so the dump no longer ref...
true
ClickHouse/ClickHouse
94,681
comment_to_fix
Format operators as functions in EXPLAIN SYNTAX and toAST
This comment says `EXPLAIN SYNTAX` prefers operators over function calls, but the code below sets `allow_operators = false` for that path, which is the PR's actual contract. Please flip the wording to avoid preserving the wrong invariant in future changes, e.g. `function calls are preferred over operator syntax`.
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
5bd94445fa4cc7e4f4c6b218e8dc149fe47cf9af
diff --git a/src/Interpreters/InterpreterExplainQuery.cpp b/src/Interpreters/InterpreterExplainQuery.cpp index be4b226744eb..ce939803ec76 100644 --- a/src/Interpreters/InterpreterExplainQuery.cpp +++ b/src/Interpreters/InterpreterExplainQuery.cpp @@ -555,7 +555,8 @@ bool explainQueryTree( ASTPtr explained_query, ...
[ "src/Interpreters/InterpreterExplainQuery.cpp" ]
[ { "comment": "This comment says `EXPLAIN SYNTAX` prefers operators over function calls, but the code below sets `allow_operators = false` for that path, which is the PR's actual contract. Please flip the wording to avoid preserving the wrong invariant in future changes, e.g. `function calls are preferred over o...
true
ClickHouse/ClickHouse
105,286
issue_to_patch
Logical error: Mutation of `Memory` table produced incomplete output: A (STID: 2380-3043) _Important: This issue was automatically generated and is used by CI for matching failures. DO NOT modify the body content. DO NOT remove labels._ Test name: Logical error: Mutation of `Memory` table produced incomplete output: ...
Fix `Memory` table abort on `ALTER TABLE ... APPLY PATCHES` (STID 2380-3043)
Fixes `STID: 2380-3043` (`Logical error: Mutation of \`Memory\` table produced incomplete output: block 0 has 0 rows, expected N`), reported by @alexey-milovidov on https://github.com/ClickHouse/ClickHouse/pull/99972 as a chronic `BuzzHouse` finding hitting master and 8+ unrelated PRs (`#99804`, `#100185`, `#100586`, `...
051854fa1daf6e2feb2b18c638b0f51f1c04434a
b6ccaf5a68eb8f9341f0bd98a2394dac3009b539
diff --git a/src/Storages/StorageMemory.cpp b/src/Storages/StorageMemory.cpp index 109d1874da08..f0fc30d478b6 100644 --- a/src/Storages/StorageMemory.cpp +++ b/src/Storages/StorageMemory.cpp @@ -13,6 +13,7 @@ #include <DataTypes/DataTypeLowCardinality.h> #include <DataTypes/DataTypeString.h> #include <Storages/Alter...
[ "src/Storages/StorageMemory.cpp", "tests/queries/0_stateless/04254_memory_apply_patches_no_op.reference", "tests/queries/0_stateless/04254_memory_apply_patches_no_op.sql" ]
[ { "comment": "~Wouldn't it be better to throw an error? This way we just silently don't do anything.~\r\n\r\nOkay, I see that Memory engine just silently ignores things, so this should be good.", "path": "src/Storages/StorageMemory.cpp", "hunk": "@@ -247,6 +248,30 @@ void StorageMemory::checkMutationIsP...
diff --git a/tests/queries/0_stateless/04254_memory_apply_patches_no_op.reference b/tests/queries/0_stateless/04254_memory_apply_patches_no_op.reference new file mode 100644 index 000000000000..575a1b14bb42 --- /dev/null +++ b/tests/queries/0_stateless/04254_memory_apply_patches_no_op.reference @@ -0,0 +1,5 @@ +before:...
true
ClickHouse/ClickHouse
106,175
issue_to_patch
fix(docs): correct h3Distance example output value
Several embedded function-documentation examples (shown in `SHOW CREATE FUNCTION` / docs and used by the docs generation) had incorrect outputs. This corrects them to match the actual server behavior: - `h3Distance`: the example distance between cells `590080540275638271` and `590103561300344831` is `6`, not `7`. - `m...
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
8d617d769b286ed421c0f5cb29b803bbf8c0ef94
diff --git a/src/Functions/h3Distance.cpp b/src/Functions/h3Distance.cpp index bcdf8efb6e2e..038887be5851 100644 --- a/src/Functions/h3Distance.cpp +++ b/src/Functions/h3Distance.cpp @@ -141,7 +141,7 @@ This function calculates the minimum number of grid cells between the start and "SELECT h3Distance(59008...
[ "src/Functions/h3Distance.cpp", "src/Functions/multiSearchFirstPositionCaseInsensitiveUTF8.cpp", "src/Functions/multiSearchFirstPositionUTF8.cpp", "src/Functions/readWkt.cpp" ]
[ { "comment": "The example output still violates the PR's contract of matching server output: after changing the header to `readWKTMultiLineString`, the Pretty block width must grow too, but the value row and bottom border below still use the old `readWKTLineString` width. The generated output will pad `MultiLin...
true
ClickHouse/ClickHouse
106,175
comment_to_fix
fix(docs): correct h3Distance example output value
The example output still violates the PR's contract of matching server output: after changing the header to `readWKTMultiLineString`, the Pretty block width must grow too, but the value row and bottom border below still use the old `readWKTLineString` width. The generated output will pad `MultiLineString` and draw the ...
f95eeea66d09a3bddb48df51b6e317cbe3c2325c
8d617d769b286ed421c0f5cb29b803bbf8c0ef94
diff --git a/src/Functions/readWkt.cpp b/src/Functions/readWkt.cpp index fa625463a2d7..369b2d75bb5a 100644 --- a/src/Functions/readWkt.cpp +++ b/src/Functions/readWkt.cpp @@ -338,11 +338,11 @@ Parses a Well-Known Text (WKT) representation of a MultiLineString geometry and }, { "MultiLineString exampl...
[ "src/Functions/readWkt.cpp" ]
[ { "comment": "The example output still violates the PR's contract of matching server output: after changing the header to `readWKTMultiLineString`, the Pretty block width must grow too, but the value row and bottom border below still use the old `readWKTLineString` width. The generated output will pad `MultiLin...
true
ClickHouse/ClickHouse
106,538
issue_to_patch
Add non-allocating IColumn::computeHashInto column hash kernel
Split out the hash-production half of #106120 into its own pull request, as requested in review: keep the per-column hash calculation separate from the batched scatter interface so each can be reviewed and benchmarked in isolation. ## Motivation Several in-memory routing paths — sharded aggregation (`BufferedShar...
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/ColumnAggregateFunction.cpp b/src/Columns/ColumnAggregateFunction.cpp index 3ce9eca657c1..1dcb6ac69b70 100644 --- a/src/Columns/ColumnAggregateFunction.cpp +++ b/src/Columns/ColumnAggregateFunction.cpp @@ -17,7 +17,6 @@ #include <Common/FieldVisitorToString.h> #include <Common/HashTable/Hash....
[ "src/Columns/ColumnAggregateFunction.cpp", "src/Columns/ColumnAggregateFunction.h", "src/Columns/ColumnArray.cpp", "src/Columns/ColumnArray.h", "src/Columns/ColumnBLOB.h", "src/Columns/ColumnCompressed.h", "src/Columns/ColumnConst.cpp", "src/Columns/ColumnConst.h", "src/Columns/ColumnDecimal.cpp", ...
[ { "comment": "`ColumnDynamic::updateHashWithValue` normalizes shared-variant values by decoding the stored type and value, but this path delegates to `ColumnVariant`, where typed variants hash the nested value and shared variants hash the serialized `String` bytes. Two equal `Dynamic` keys can therefore get dif...
diff --git a/src/Columns/tests/gtest_compute_hash_into.cpp b/src/Columns/tests/gtest_compute_hash_into.cpp new file mode 100644 index 000000000000..6e7cb6dae0dc --- /dev/null +++ b/src/Columns/tests/gtest_compute_hash_into.cpp @@ -0,0 +1,1123 @@ +#include <gtest/gtest.h> + +#include <Columns/ColumnArray.h> +#include <C...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
`ColumnDynamic::updateHashWithValue` normalizes shared-variant values by decoding the stored type and value, but this path delegates to `ColumnVariant`, where typed variants hash the nested value and shared variants hash the serialized `String` bytes. Two equal `Dynamic` keys can therefore get different `computeHashInt...
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/ColumnDynamic.h b/src/Columns/ColumnDynamic.h index 8b3db42e821f..2c2e526b6216 100644 --- a/src/Columns/ColumnDynamic.h +++ b/src/Columns/ColumnDynamic.h @@ -5,7 +5,6 @@ #include <Columns/ColumnVector.h> #include <Columns/IColumn.h> #include <DataTypes/IDataType.h> -#include <Common/WeakHash...
[ "src/Columns/ColumnDynamic.h" ]
[ { "comment": "`ColumnDynamic::updateHashWithValue` normalizes shared-variant values by decoding the stored type and value, but this path delegates to `ColumnVariant`, where typed variants hash the nested value and shared variants hash the serialized `String` bytes. Two equal `Dynamic` keys can therefore get dif...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
This hashes dynamic path columns and `shared_data` as separate storage carriers. `ColumnObject::updateHashWithValue` explicitly merges dynamic and shared paths in sorted path order and includes path names; otherwise the same JSON object can be represented with a path in a dynamic column in one block and in `shared_data...
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/ColumnObject.cpp b/src/Columns/ColumnObject.cpp index 9821e65348dc..d97434b4b0c5 100644 --- a/src/Columns/ColumnObject.cpp +++ b/src/Columns/ColumnObject.cpp @@ -5,6 +5,8 @@ #include <IO/Operators.h> #include <IO/WriteBufferFromString.h> #include <Common/Arena.h> +#include <Common/HashTable/...
[ "src/Columns/ColumnObject.cpp" ]
[ { "comment": "This hashes dynamic path columns and `shared_data` as separate storage carriers. `ColumnObject::updateHashWithValue` explicitly merges dynamic and shared paths in sorted path order and includes path names; otherwise the same JSON object can be represented with a path in a dynamic column in one blo...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
`combined_manual` is calculated but never checked, so this test would pass for any `initial=false` implementation that merely changes the buffer. Please assert `EXPECT_EQ(combined_api, combined_manual)` here; that is the actual contract documented above.
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/tests/gtest_compute_hash_into.cpp b/src/Columns/tests/gtest_compute_hash_into.cpp new file mode 100644 index 000000000000..6e7cb6dae0dc --- /dev/null +++ b/src/Columns/tests/gtest_compute_hash_into.cpp @@ -0,0 +1,1123 @@ +#include <gtest/gtest.h> + +#include <Columns/ColumnArray.h> +#include <C...
[ "src/Columns/tests/gtest_compute_hash_into.cpp" ]
[ { "comment": "`combined_manual` is calculated but never checked, so this test would pass for any `initial=false` implementation that merely changes the buffer. Please assert `EXPECT_EQ(combined_api, combined_manual)` here; that is the actual contract documented above.\n", "path": "src/Columns/tests/gtest_co...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
These distribution tests seed `rng` with `randomSeed`, then assert a p=0.001 chi-square cutoff. A correct hash has a non-zero chance to exceed that cutoff, so the test is nondeterministic and can flake in CI. Please use a fixed seed or deterministic input sequence for the distribution checks.
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/tests/gtest_compute_hash_into.cpp b/src/Columns/tests/gtest_compute_hash_into.cpp new file mode 100644 index 000000000000..6e7cb6dae0dc --- /dev/null +++ b/src/Columns/tests/gtest_compute_hash_into.cpp @@ -0,0 +1,1123 @@ +#include <gtest/gtest.h> + +#include <Columns/ColumnArray.h> +#include <C...
[ "src/Columns/tests/gtest_compute_hash_into.cpp" ]
[ { "comment": "These distribution tests seed `rng` with `randomSeed`, then assert a p=0.001 chi-square cutoff. A correct hash has a non-zero chance to exceed that cutoff, so the test is nondeterministic and can flake in CI. Please use a fixed seed or deterministic input sequence for the distribution checks.\n", ...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
`IColumn::computeHashInto` requires the non-initial path to combine the finalized per-row hash once, but this streams every captured column into the caller's prior hash. For captured columns `a, b`, this computes `combine(h_b, combine(h_a, prior))`, while a `ColumnConst(ColumnFunction)` first computes the finalized fun...
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/ColumnFunction.cpp b/src/Columns/ColumnFunction.cpp index 0ecc7aa779a0..1ebd50be6e1e 100644 --- a/src/Columns/ColumnFunction.cpp +++ b/src/Columns/ColumnFunction.cpp @@ -2,6 +2,7 @@ #include <Columns/ColumnFunction.h> #include <Columns/ColumnsCommon.h> #include <Columns/validateColumnType.h>...
[ "src/Columns/ColumnFunction.cpp" ]
[ { "comment": "`IColumn::computeHashInto` requires the non-initial path to combine the finalized per-row hash once, but this streams every captured column into the caller's prior hash. For captured columns `a, b`, this computes `combine(h_b, combine(h_a, prior))`, while a `ColumnConst(ColumnFunction)` first comp...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
This new wide-value folding path is not exercised by the replacement tests: `gtest_compute_hash_into` covers `UInt32`, `UInt64`, `BFloat16`, `Decimal32`, and `Decimal64`, but not 128/256-bit vector values such as `UInt128`, `Int128`, `UInt256`, `Int256`, `UUID`, or `IPv6`; the matching `ColumnDecimal` path for `Decimal...
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/ColumnVector.cpp b/src/Columns/ColumnVector.cpp index a6d489642ec6..1911ed54f95a 100644 --- a/src/Columns/ColumnVector.cpp +++ b/src/Columns/ColumnVector.cpp @@ -19,7 +19,6 @@ #include <Common/RadixSort.h> #include <Common/SipHash.h> #include <Common/TargetSpecific.h> -#include <Common/WeakH...
[ "src/Columns/ColumnVector.cpp" ]
[ { "comment": "This new wide-value folding path is not exercised by the replacement tests: `gtest_compute_hash_into` covers `UInt32`, `UInt64`, `BFloat16`, `Decimal32`, and `Decimal64`, but not 128/256-bit vector values such as `UInt128`, `Int128`, `UInt256`, `Int256`, `UUID`, or `IPv6`; the matching `ColumnDeci...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
This test block says the representation-independence contract covers `ColumnLowCardinality` and `ColumnReplicated`, but the added checks never instantiate either wrapper. The stateless `grace_hash` case also does not cover `ColumnLowCardinality::computeHashInto`, because `JoinUtils::materializeColumn` removes low-cardi...
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/tests/gtest_compute_hash_into.cpp b/src/Columns/tests/gtest_compute_hash_into.cpp new file mode 100644 index 000000000000..6e7cb6dae0dc --- /dev/null +++ b/src/Columns/tests/gtest_compute_hash_into.cpp @@ -0,0 +1,1123 @@ +#include <gtest/gtest.h> + +#include <Columns/ColumnArray.h> +#include <C...
[ "src/Columns/tests/gtest_compute_hash_into.cpp" ]
[ { "comment": "This test block says the representation-independence contract covers `ColumnLowCardinality` and `ColumnReplicated`, but the added checks never instantiate either wrapper. The stateless `grace_hash` case also does not cover `ColumnLowCardinality::computeHashInto`, because `JoinUtils::materializeCol...
true
ClickHouse/ClickHouse
106,538
comment_to_fix
Add non-allocating IColumn::computeHashInto column hash kernel
`IColumn::computeHashInto` now requires the non-initial path to combine the finalized per-row hash via `fmix32Combined(h, prior)`, but this override leaves `hash_out` unchanged when `initial == false`. For a dummy column the finalized row hash is `0`, so a later key `(prefix, materialized ColumnNothing)` hashes as just...
44aecc852cee7a9f38ec84df626833f5681e42f7
f22f3f8d702ec84858a7d0ef3f236ce0d929ed40
diff --git a/src/Columns/IColumnDummy.h b/src/Columns/IColumnDummy.h index 5842ef1959e9..763d4c1c1b30 100644 --- a/src/Columns/IColumnDummy.h +++ b/src/Columns/IColumnDummy.h @@ -1,8 +1,7 @@ #pragma once #include <Columns/IColumn.h> -#include <Common/WeakHash.h> - +#include <Common/HashTable/Hash.h> namespace DB...
[ "src/Columns/IColumnDummy.h" ]
[ { "comment": "`IColumn::computeHashInto` now requires the non-initial path to combine the finalized per-row hash via `fmix32Combined(h, prior)`, but this override leaves `hash_out` unchanged when `initial == false`. For a dummy column the finalized row hash is `0`, so a later key `(prefix, materialized ColumnNo...
true