Skip to content

Fix no-op cleanup prologue in 04104_any_join_semi_anti_not_ready_set - #112005

Merged
alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:fix/04104-flaky-plan
Jul 27, 2026
Merged

alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:fix/04104-flaky-plan

Conversation

@groeneai

@groeneai groeneai commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

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

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

...

Description

04104_any_join_semi_anti_not_ready_set.sql drops t_left_004104,
t_right_004104, t_subq_004104 (three zeros) but creates and uses
t_left_04104, t_right_04104, t_subq_04104 (two zeros). Every prologue name
is a misspelled twin of a created name, so the prologue matches nothing and the
test has no leftover-state cleanup.

This is latent on the default path, where each test gets a fresh
test_<random> database. It is live in the stress runner's shared-database mode:
ci/jobs/scripts/stress/stress.py:158-161 passes --database=test_{i} to every
odd thread ("Run some threads with one database for all tests"), and
tests/clickhouse-test:3755 skips per-test cleanup when --database is set, so
tables survive between tests. Leftovers then arise within a single job in three
ways: a mid-test abort; a same-database retry, since clickhouse-test:4582
re-runs the test with the same args.database (:2085-2086) and
MESSAGES_TO_RETRY includes (total) memory limit exceeded, one of this test's
own attested failure reasons; and the drop injection described below, which skips
the epilogue DROPs on an otherwise successful run. The next run then fails
TABLE_ALREADY_EXISTS at CREATE TABLE t_left_04104, because the prologue
cleared nothing and the CREATEs have no IF NOT EXISTS.

Correcting the three identifiers alone is not enough in that same mode.
stress.py:222 also passes ignore_drop_queries_probability=0.2 to every
non-upgrade thread, and InterpreterDropQuery.cpp:220-228 reports success
without dropping when the roll fires and storesDataOnDisk is true, which is
always the case for MergeTree. Each prologue DROP is therefore skipped with
p=0.2, so all three would clear only 0.8^3 = 0.512 of the time. Pinning
ignore_drop_queries_probability = 0 on those three statements makes the cleanup
deterministic. The pin is per statement rather than a file-level SET, so the
epilogue DROPs keep exercising the injection.

I did not add IF NOT EXISTS to the CREATEs: that would run the test against a
stale table instead of clearing it.

Verified with the real harness in shared-database mode, with the injection forced
to 1 so the pin is the only thing that can clear the tables. With a prior run's
tables left behind the test passes; it fails return code: 57 with the pin
removed, and also with the rename reverted, so neither line is redundant. At the
probability CI actually uses, 30 consecutive runs against the same database
without reseeding pass with both lines, against 27 passes and 3 failures with the
pin removed. The default path is unaffected (50/50 randomized runs pass) and the
.reference is unchanged.

I am not claiming this fixes the CI failures previously observed on this test.
Those decompose into unrelated external causes (other PRs' own regressions, a
runner filesystem error, host OOM kills, and server deaths caused by other
tests' queries); none involves this prologue, and this change makes no behavioural
difference on the default per-test-database path where they occurred.

Version info

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

groeneai and others added 2 commits July 27, 2026 00:19
The test dropped t_left_004104, t_right_004104, t_subq_004104 (three zeros)
but creates and uses t_left_04104, t_right_04104, t_subq_04104 (two zeros).
Every prologue name was a misspelled twin of a created name, so the prologue
matched nothing and the test had no leftover-state cleanup.

Latent on the default path, where each test gets a fresh test_<random>
database. Live in the stress runner's shared-database mode: stress.py passes
--database=test_{i} to every odd thread, and clickhouse-test skips per-test
cleanup when --database is set, so tables survive between tests. The epilogue
DROPs are unguarded, so a mid-test abort leaves the three tables behind and the
next run in that database fails TABLE_ALREADY_EXISTS at CREATE TABLE
t_left_04104, because the prologue cleared nothing and the CREATEs have no
IF NOT EXISTS.

Verified with the harness in shared-database mode: with a prior run's tables
left behind the test passes with this change and fails with return code 57 when
the rename alone is reverted. The default path is unaffected (50/50 randomized
runs pass) and the reference file is unchanged.

IF NOT EXISTS was deliberately not added to the CREATEs: it would run the test
against a stale table instead of clearing it.

Co-Authored-By: Claude Fable 5 <[email protected]>
Correcting the misspelled prologue names is not sufficient in the mode the
previous commit targets. ci/jobs/scripts/stress/stress.py:222 passes
ignore_drop_queries_probability=0.2 to every non-upgrade stress thread,
including the odd threads that also get --database=test_{i}, and
InterpreterDropQuery.cpp:220-228 reports success without dropping when the
roll fires and storesDataOnDisk is true, which is always the case for
MergeTree. Each prologue DROP was therefore skipped with p=0.2, so all three
cleared only 0.8^3 = 0.512 of the time and the following CREATE, which has no
IF NOT EXISTS, still failed TABLE_ALREADY_EXISTS.

The setting is applied per statement rather than as a file-level SET so the
epilogue DROPs keep exercising the injection.

Verified against the shared-database harness with the probability forced to 1,
so the pin is the only thing that can clear a prior run's tables. Removing the
pin fails with return code 57, and reverting the earlier rename while keeping
the pin also fails with 57, so neither change is redundant. The default
per-test-database path is unaffected, 50 randomized runs pass, and the
reference file is unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai

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

Two rounds. Round 0 bounced this change; round 1 is clean. An independent
reviewer read the resulting code cold before seeing the author's evidence, then a
second model re-reviewed the full scope. Findings and verdicts below.

Round 0 (bounced, both findings fixed here)

❌ The corrected prologue was still silently skipped in the very mode this
change is about.
ci/jobs/scripts/stress/stress.py:222 passes
ignore_drop_queries_probability=0.2 to every non-upgrade stress thread,
including the odd threads that also get --database=test_{i} (:159-161), and
src/Interpreters/InterpreterDropQuery.cpp:220-228 reports success without
dropping when the roll fires and storesDataOnDisk is true, which is always the
case for MergeTree (src/Storages/MergeTree/MergeTreeData.h:1240). So all
three prologue drops would have cleared only 0.8^3 = 0.512 of the time.
Verdict: AGREE, fixed. The three statements now pin
ignore_drop_queries_probability = 0. Measured at the probability CI actually
uses, over 30 consecutive shared-database runs with no reseeding: 30 passes with
the pin, against 27 passes and 3 failures without it.

❌ A coverage claim in the validation-gate comment was false. It asserted
this was the only stateless test whose entire cleanup prologue is dead.
A sweep of all 9577 tests/queries/0_stateless/*.sql files on master finds four
files in this typo class. Verdict: AGREE, corrected. The comment now names
03171_indexing_by_hilbert_curve.sql,
01851_clear_column_referenced_by_mv.sql and
03008_deduplication_wrong_mv.sql; each was confirmed to fail
TABLE_ALREADY_EXISTS on a second run. They are routed separately rather than
bundled here.

⚠️ Reachability was understated. Only a mid-test abort was cited.
Verdict: AGREE, fixed. Two further mechanisms that produce leftovers inside a
single job are now named: the same-database retry path
(tests/clickhouse-test:4582, :2085-2086, :3755, with
(total) memory limit exceeded in MESSAGES_TO_RETRY), and the drop injection
skipping the epilogue drops on an otherwise successful run.

Round 1 (clean)

Second model: 0 findings over the full scope.

Independent reviewer: 0 blockers, 0 majors. The sweep was re-run from scratch
over the master blobs and reproduced the four-file set exactly, including the
five further dead-prologue hits that are correctly excluded (two create their
tables with ATTACH TABLE ... FROM, one never creates anything because all its
CREATEs expect a serverError, one is a different defect). All eight code
citations in the description verified line-exact. The pin was traced through the
Replicated-database path as well: the injection branch runs before the
shouldReplicateQuery enqueue, and on replicas the drop is a secondary query and
already exempt. No settings leak between statements
(src/Client/ClientBase.cpp:2548-2559 restores them), and the clause survives
serialisation into the DDL entry and re-parse. Assertions, pinned plan settings,
fixture and .reference are untouched.

💡 Noted, not blocking: 01835_alias_to_primary_key_cyfdecyf.sql drops db
while creating tb, which is an adjacent but different defect (the created table
has no prologue guard at all), so it is out of scope here and recorded with the
other siblings.

Session id: cron:clickhouse-review-slot-9:20260727-023400

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, 100%. Shared-database mode, exactly as the stress runner uses it: leave a prior run's tables behind (the file minus its 3 epilogue DROPs), then tests/clickhouse-test 04104_any_join_semi_anti_not_ready_set --database=test_shared_04104 --no-random-settings --client-option ignore_drop_queries_probability=1. Forcing the probability to 1 makes the drop injection deterministic, so the pinned prologue is the only thing that can clear the tables. Fails on demand without the fix, passes with it.
b Root cause explained? Yes, two coupled defects in the prologue. First, it drops t_*_004104 (three zeros) while the test creates t_*_04104 (two zeros), so it matches nothing. Second, even spelled correctly it is silently skipped in the mode that matters: stress.py:222 passes ignore_drop_queries_probability=0.2 to every non-upgrade stress thread, and InterpreterDropQuery.cpp:220-228 returns success without dropping when the roll fires and storesDataOnDisk is true (always so for MergeTree), giving P(all three drop) = 0.8^3 = 0.512. The shared database comes from stress.py:158-161 (--database=test_{i}, "one database for all tests") and clickhouse-test:3755 skips per-test cleanup whenever --database is set, so tables survive between tests. The CREATEs have no IF NOT EXISTS, so the next run fails TABLE_ALREADY_EXISTS.
c Fix matches root cause? Yes, one line per defect: correct the three identifiers, and pin ignore_drop_queries_probability = 0 on those three statements so the cleanup is not skipped. No widened bound, no no-random-* tag, no data reduction, no defensive guard. IF NOT EXISTS on the CREATEs was rejected as it would run the test against a stale table instead of clearing it. Statement-level SETTINGS rather than a file-level SET, so only the prologue is exempted and the epilogue keeps exercising the injection.
d Test intent preserved / new tests added? Yes. Only the cleanup DDL changed. The five assertions, three pinned plan settings, fixture and .reference are untouched (empty diff on the .reference). Nothing removed or weakened, and the pin is scoped to three DROP statements so it cannot affect any assertion. This test is itself the regression test; the second-run property is what the mutations below pin.
e Both directions demonstrated? Yes, with a mutation per fix line. Positive, injection forced to 1 on a database holding a prior run's tables: [ OK ] 0.53 sec. Mutation A, pin removed and rename kept: [ FAIL ] return code: 57, Table test_shared_04104.t_left_04104 already exists at CREATE TABLE t_left_04104. Mutation B, rename reverted and pin kept: same [ FAIL ] 57. So neither line is redundant. At the probability CI actually uses, 30 consecutive shared-database runs without reseeding give 30 passes with both lines and 27 passes / 3 failures with the pin removed. Default per-test-database path [ OK ], 50/50 randomized runs pass, and 5 leftover-then-run cycles plus 3 back-to-back runs all pass.
f Fix is general across code paths? Yes. Swept all 9577 tests/queries/0_stateless/*.sql files on master (blobs, not the working tree) with two predicates: every prologue DROP TABLE IF EXISTS name orphaned, and any orphaned drop name that is a near-twin of a created name. Four files carry this typo class: this one plus 03171_indexing_by_hilbert_curve.sql, 01851_clear_column_referenced_by_mv.sql and 03008_deduplication_wrong_mv.sql. Each of the three was confirmed to fail TABLE_ALREADY_EXISTS on a second run after an aborted first run. They are routed separately rather than bundled here.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A for type wrappers, since no expression, type or value surface changes. The relevant axis is harness modes, and all are covered: default per-test database, shared --database, --replicated-database --database (same cleanup path, same fix), randomized settings (50/50 pass), and the drop-injection probability at both 0.2 as CI sets it and 1 as the forced worst case.
h Backward compatible? (maintainer-approved exception only) Yes. Test-only change: no setting default, no serialization format, no SettingsChangesHistory.cpp surface. ignore_drop_queries_probability is set per statement inside one test, so nothing outside this file sees it.
i Invariants and contracts preserved? Yes. Invariant: the test is self-cleaning, succeeding on a second run in the same database even if a prior run aborted midway, and even when every unpinned drop in the session is being skipped (verified over 5 consecutive cycles and 3 back-to-back runs). The epilogue drops stay unguarded and unpinned on purpose, so a failure to create still surfaces and the injection keeps its coverage there. TRUNCATE and the re-INSERT already used the correct spelling. Parallel safety unchanged (unqualified names inside the per-test database, no global objects, no no-parallel).

Session id: cron:clickhouse-impl-slot-6:20260727-015600

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @maxknv - could you review this? The test's cleanup prologue drops t_*_004104 (three zeros) while it creates t_*_04104 (two zeros), so it clears nothing, and in the stress runner's shared-database mode (stress.py:159-161) a leftover table makes the next run fail TABLE_ALREADY_EXISTS; the prologue drops also pin ignore_drop_queries_probability = 0 because stress.py:222 would otherwise let each of them be skipped with p=0.2.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Jul 27, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [36d9e7b]

Summary: ✅


AI Review

Summary

This PR fixes the typoed cleanup DROP names in tests/queries/0_stateless/04104_any_join_semi_anti_not_ready_set.sql and makes those three prologue drops deterministic under the stress runner by pinning ignore_drop_queries_probability = 0 on each statement. I reviewed the live diff against the surrounding stress-runner, retry, parser, and InterpreterDropQuery code paths, and the change matches the failure mode it claims to fix. The attached Praktika report is also clean. I did not find any new blocker or major issue.

Final Verdict

✅ No blocker or major findings.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 27, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That was funny 😆 Thanks for fixing!

@alexey-milovidov alexey-milovidov self-assigned this Jul 27, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 27, 2026
Merged via the queue into ClickHouse:master with commit 21d8a13 Jul 27, 2026
178 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 27, 2026
DROP TABLE IF EXISTS t_left_004104;
DROP TABLE IF EXISTS t_right_004104;
DROP TABLE IF EXISTS t_subq_004104;
DROP TABLE IF EXISTS t_left_04104 SETTINGS ignore_drop_queries_probability = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@clickgapai, adding the setting ignore_drop_queries_probability was not needed here. Ordinary stateless tests don't use this setting. Stress tests uses it, but it does not check test results - the goal of Stress test is to introduce more stress to check invariants in the code.

Send a PR removing unnecessary SETTINGS ignore_drop_queries_probability = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@alexey-milovidov I looked into #112005 but didn't land on a concrete change to make — the requested work looks like it may already be in the PR, or I couldn't pin down exactly what's still needed. If you have a specific case in mind (a query, a file, or the exact scenario to cover), point me to it and I'll follow up.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You are right; the pins should not have gone in. My justification in that PR measured the wrong thing: the return code: 57 I cited came from a Stress run, and Stress does not compare output against the reference, so making the cleanup prologue deterministic there bought nothing. The setting defaults to 0 (src/Core/Settings.cpp) and the only injectors in CI are ci/jobs/scripts/stress/stress.py:222 and --fake-drop in the upgrade check, so no results-checking job ever sees it.

rschu1ze's #113117 already removes every carrier. I grepped master for statement-level SETTINGS ignore_drop_queries_probability = 0: the 6 files it touches are the complete set, and all 6 are pin-free at its head. What is left on master afterwards is legitimate (03013 is the setting's own test, 03920 sets it to 1.0 on purpose, 03359 carries it inside a fuzzer settings dump, 03999 is a baseline). So there is nothing left for me to send for master.

The remaining work is mine: 16 of my open PRs would re-add the pin to 19 test files once #113117 merges. I am removing it from all of them.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Correcting my note above: "I am removing it from all of them" was over-broad, and the reasoning I gave for it was too strong (Stress test does report per-test failures, so a drop that is ignored there is not invisible).

14 of the 16 are discharged, by strip, merge or close. The other two, plus three carriers I found later, keep the clause: five files, 61 clauses. 50 of those are in one file with the same shape as 04652_compound_key_monotonicity.sql, and this PR already settled that case in the other direction: bc9aeba35476bf8 removed its 80 clauses, fbeb49d77b1a6ed put all 80 back, and the reverted state is the one that merged. In the other four the clause is load-bearing for a reason specific to the test, which I checked one by one.

pull Bot pushed a commit to infdahai/ClickHouse that referenced this pull request Aug 5, 2026
Requested by alexey-milovidov on ClickHouse#112005: "Send a PR removing unnecessary
SETTINGS ignore_drop_queries_probability = 0".

The 10 pins were on the test's DROP ... IF EXISTS prologue, where pinning the
setting buys nothing. Its default is 0, and only two jobs inject a nonzero
value: the Stress test (ci/jobs/scripts/stress/stress.py:222, =0.2) and the
Upgrade check via clickhouse-client --fake-drop (programs/client/Client.cpp:988-989,
=1). Neither of those jobs compares per-test results.
tests/docker_scripts/stress_runner.sh:298-300 writes exactly one result row,
built from the wrapper's own exit code, and the per-clickhouse-test exit code is
discarded: stress.py:395-404 collects retcodes only to count how many processes
have finished, then returns the pipe list, and the caller ignores it. So an
ignored DROP in a stateless test cannot turn into a failed check in the only
jobs where an ignored DROP can occur.

The pinning was also internally inconsistent: the same test's epilogue drops,
where the tables always exist, were never pinned.

Measured on this change: with the pins removed the test passes and its output is
byte-identical to the reference, at the default probability, at the 0.2 the
stress runner injects (50 randomized runs), and at 1. Leftover-table counts
after the run are identical before and after the change, so the pins were not
preventing anything.

rschu1ze's ClickHouse#113117 removes the setting from the other six stateless tests that
carry it, so master reaches zero once both land. There is no file overlap.

Co-Authored-By: Claude Fable 5 <[email protected]>
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 8, 2026
…4649

@alexey-milovidov asked for the removal of unnecessary
`SETTINGS ignore_drop_queries_probability = 0` clauses in
ClickHouse#112005 (comment).
This drops the one pin this branch adds, together with the two comment lines
that existed only to justify it.

The setting defaults to 0, and `tests/clickhouse-test` never injects it: the
only injectors are `ci/jobs/scripts/stress/stress.py:222` (0.2, Stress) and
`clickhouse-client --fake-drop` (1, Upgrade check, programs/client/Client.cpp:989).
Neither of those jobs compares per-test results. `stress.py` collects each
`clickhouse-test` return code into `retcodes` only to count finished processes
and then returns the process list, its caller does not assign that value, and
nothing raises or exits on a test failure; `tests/docker_scripts/stress_runner.sh:299`
writes a single result row built from the wrapper's own exit code, and
`upgrade_runner.sh:135` uses the identical pattern. So the pinned DROP cannot
turn red in a job whose results are checked.

The pin was not inert, which is why the comment went with it: a cache
dictionary does not store data on disk, so under an injected probability the
ignore branch rewrites the DROP into a TRUNCATE and
`DROP DICTIONARY` then fails with `Code: 62, Cannot TRUNCATE dictionary`.
Measured on a master debug build: with the setting forced to 1 the unpinned
drop returns 62 and the pinned one returns 0. The drop is the last statement
of the test, the test greps only its own query output, and there is no
`{ echo }` header or reference line covering it, so the removal cannot change
the compared output.
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 8, 2026
…m the two StorageJoin tests

Requested on ClickHouse#112005: the pins are unnecessary, so they should not be added.

They were added to keep the cleanup DROPs deterministic under the Stress job, which injects
`ignore_drop_queries_probability = 0.2`. That buys nothing. The default is 0
(`src/Core/Settings.cpp`) and the only injectors are `ci/jobs/scripts/stress/stress.py` (0.2)
and the upgrade check's `--fake-drop` client (`programs/client/Client.cpp`);
`tests/clickhouse-test` never injects it. Neither injecting job compares per-test results:
`tests/docker_scripts/stress_runner.sh` writes a single row built from the wrapper's own exit
code, and `stress.py` collects per-test return codes only to count finished processes before
returning, so a nonzero `clickhouse-test` exit is discarded. `upgrade_runner.sh` uses the same
wrapper pattern.

Both tests run under `-- { echo }`, so the statement text is the expected output and the
`.reference` files carry the same clauses; all four files are edited in lockstep. The
`DROP` statements themselves are unchanged (94 and 8), and the comment that existed only to
justify the pin is removed with it. The surrounding shared-database rationale is kept: it
explains why the tests drop first at all, which is still true.
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 9, 2026
@alexey-milovidov asked for these pins to be dropped
(ClickHouse#112005 (comment)).

They cannot affect this test's result. The setting's default is 0 and the only
injectors are the Stress runner (ci/jobs/scripts/stress/stress.py:222, 0.2) and
the upgrade check's --fake-drop client (programs/client/Client.cpp:989);
tests/clickhouse-test never injects it. Neither job compares per-test results:
tests/docker_scripts/stress_runner.sh:298-300 writes one row from the wrapper's
own exit code, and stress.py collects per-test return codes only to count
finished processes, so a nonzero clickhouse-test exit is discarded.

Measured with the pins removed: 98/98 reference lines byte-identical, and the
database is left with 0 tables afterwards (control: truncating the run before
the epilogue leaves 13), so the trailing DROPs still execute.
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 12, 2026
ClickHouse#110885 landed the same buildSelectOrUnionExpression nested-union alias
forwarding this branch carried, so the conflicting hunk is resolved to
master's side and QueryTreeBuilder.cpp is left byte-identical to it. The
remaining fix is the two toAST emission sites, which master does not have:
the issue still reproduces on master at a96787f.

Also drop the ignore_drop_queries_probability = 0 pins from the test, as
requested on ClickHouse#112005.
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 18, 2026
Four changes, all from re-reviewing the merged tree.

Trim the commentary around keyToSetConversionMayCollapse to the invariant each
site needs, per the standing request that motivation and context live in the
commit message rather than in the code.

Correct the helper's header: it had claimed an unclassified many-to-one
conversion is only ever treated as approximate, but when
canBeSafelyCast(set -> key) holds, tryPrepareSetColumnsForIndex takes the early
exit that casts the set values directly and returns before consulting the
predicate, so the atom stays exact there. The scope limit itself is unchanged
and pre-existing.

Add Case E2 to 04545. Case E's carrier was a String-to-String conversion, which
is equality-preserving and so never sets set_is_approximate, leaving
tryPrepareSetIndexForHas's own relaxation arm unasserted: deleting
`|| set_is_approximate` from that caller kept the test green. E2 carries a UInt8
key against a Nullable(Int64) element, whose conversion is not
equality-preserving. A text pair cannot be used because has requires a supertype
for the key and the element. Rows are correct either way, so the load-bearing
assertion is Parts: 3/3; the mutant prunes to 2/3 and fails on that line. Its
table is dropped in the epilogue with the other thirty.

Remove ignore_drop_queries_probability = 0 from the thirty cleanup statements,
as asked on ClickHouse#112005. The setting defaults to 0 and only the stress runner and
the upgrade check's --fake-drop client inject it; neither compares per-test
results, and clickhouse-test's leftover-tables check is gated on
`case_file >= "02800"` where case_file is an absolute path, so it never fires.
The DROP statements are unchanged.
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Sep 4, 2026
Requested at ClickHouse#112005 (comment),
and ClickHouse#113117 has since removed every carrier on master. This branch still added
the setting to eight `DROP` statements, so it would bring back a convention
master no longer uses.

The pins only ever changed anything under the stress runner, which injects
`ignore_drop_queries_probability=0.2` as a client option
(`ci/jobs/scripts/stress/stress.py`), and the upgrade check, which sets it to 1
(`programs/client/Client.cpp`); neither job compares per-test output. Measured
at the default 0, which is what every results-checking job uses: with and
without the pins the eight statements exit 0, produce byte-identical output and
leave no table behind. Forcing the setting to 1 is the only way to tell the two
apart. The unpinned run then keeps all four tables (`Memory` truncated, `Set`
and `MergeTree` skipped) and a second run in the same database fails with
`TABLE_ALREADY_EXISTS`. That is the behaviour the removal accepts, and it is
what master's own de-pinned tests now do.

The comment that justified the pins goes with them. The note about the `exists`
consumer of the same resolution site stays, because it explains why that
sibling cannot carry the bug and that is still true.

Co-Authored-By: Claude Opus 5 <[email protected]>
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Sep 4, 2026
Every `DROP TABLE IF EXISTS` in `04747_unwrap_monotonicity_dedup.sql`
carried `SETTINGS ignore_drop_queries_probability = 0`. The setting
defaults to 0 and only two jobs ever set it - the stress test (0.2) and
the upgrade check (1, via `--fake-drop`) - and neither compares a
stateless test's per-test output, so the clause cannot affect any job
that checks results.

@ alexey-milovidov asked for these pins to be removed (ClickHouse#112005), and
ClickHouse#113117 has since deleted every one of them from master. Keeping them
on this branch would re-add a setting a maintainer has just removed.

The removal is textually exact: the file is byte-identical to its
previous content with only the trailing clause dropped from the 20
`DROP` lines, and the `.reference` is untouched because this test does
not use `-- { echo }`.
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Sep 4, 2026
…ck test

Both pinned statements are `DROP DATABASE`, and the injection never reaches one:
the branch in `InterpreterDropQuery::executeToTableImpl` requires
`!is_drop_or_detach_database`, which holds whenever the original query names no
table, and that also covers the table drops a database drop performs internally.

Measured on master with `clickhouse local`, five arms: `DROP TABLE` of a
`MergeTree` at probability 1 leaves the table behind, both through a
statement-level `SETTINGS` clause and through a session-level `SET`, while
`DROP DATABASE` at probability 1 removes the database and its tables, with the
pin and without it. So the clause changed nothing here.

Requested by alexey-milovidov in ClickHouse#112005.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants