Skip to content

Add test: TO INNER UUID rejected for refreshable MV without APPEND — new BAD_ARGUMENTS check untested - #103894

Merged
nikitamikhaylov merged 3 commits into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr60669
May 7, 2026
Merged

nikitamikhaylov merged 3 commits into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr60669

Conversation

@clickgapai

@clickgapai clickgapai commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

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

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

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

Adds test coverage for 1 untested code path(s), found during automated review of PR #60669.
That PR adds support for Refreshable Materialized Views in Replicated databases with cross-replica coordination via Keeper. Key changes: (1) New StopToken/StopSource/StopCallback in Common/. (2) New DDL log entry version PARENT_TABLE_UUID_VERSION = 7 adding parent_table_uuid for conditional

1. TO INNER UUID rejected for refreshable MV without APPEND — new BAD_ARGUMENTS check untested
src/Storages/StorageMaterializedView.cpp:263
Risk: Trace: StorageMaterializedView::StorageMaterializedView enters the refresh-strategy block, sets fixed_uuid = query.refresh_strategy->append. With non-APPEND, fixed_uuid is false; on user CREATE
What's unique vs PR tests: PR test 02932_refreshable_materialized_views_2.sh covers the existing TO existing_table form, the BAD_ARGUMENTS error for hh refresh every 2 second to dest as select x from src (existing target
Tags: -- Tags: atomic-database — atomic-database: Refreshable MV requires Atomic database for inner-table EXCHANGE; matches tag used by existing 02932_refreshable_materialized_views_*.sh.
Try it on ClickHouse Fiddle

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Not applicable — test-only change.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.418

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 2, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [26f77c4]

Summary: ✅


AI Review

Summary

This PR adds a focused stateless test that validates BAD_ARGUMENTS for CREATE MATERIALIZED VIEW ... REFRESH ... TO INNER UUID ... without APPEND, plus the matching reference output. The current version is narrow, deterministic for its target assertion, and appropriate as a test-only change.

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

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 2, 2026
… settings

The flaky-check runner injects randomized session_timezone (e.g.
'zoneinfo/UTC' from get_localzone() on hosts with a direct
/etc/localtime->/usr/share/zoneinfo/UTC symlink). That malformed
timezone causes the server to reject the very first query with
'Invalid time zone: zoneinfo/UTC. (BAD_ARGUMENTS)' before the
test's targeted parse-time BAD_ARGUMENTS assertion can fire,
producing ~25-30% per-run flakiness across sanitizer flaky checks.

Add the no-random-settings tag (alongside the existing no-parallel)
so the test exercises only the StorageMaterializedView parse-time
check it is meant to cover.
@@ -0,0 +1,51 @@
-- Tags: atomic-database, no-parallel, no-random-settings

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.

no-parallel and no-random-settings look avoidable here and make the test less representative for normal CI runs.

  • no-random-settings: instead of disabling all random settings, set session_timezone explicitly at the start of the test so only the known timezone flake is neutralized.
  • no-parallel: this is introduced by the APPEND cross-check creating a fixed TO INNER UUID. Consider dropping that cross-check (or moving it to a .sh test that can generate unique UUIDs) so this coverage test can run in parallel.

Can we keep this test without no-* tags?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

CI is currently passing or still running — no failures to fix at this time.

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, check again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the re-check ping, @alexey-milovidov. I rechecked the AI review's two suggestions empirically and adjusted accordingly:

Dropped no-parallel ✅ — Removed the APPEND cross-check (the part that needed a fixed server-wide UUID). The remaining negative CREATE MATERIALIZED VIEW … REFRESH … TO INNER UUID … -- { serverError BAD_ARGUMENTS } throws during storage construction at src/Storages/StorageMaterializedView.cpp:263, which is before any UUID is claimed in the global registry — so a fixed literal UUID is safe under parallel reruns. Verified with 5× --test-runs: all green.

Could not drop no-random-settings — I tried the reviewer's suggested fix (explicit SET session_timezone = 'UTC' as the first statement). It doesn't work in this test runner. The flaky-check randomizer injects session_timezone as a connection-level setting via clickhouse-client cmdline → it rides on every HTTP request as a URL setting, and the server validates URL settings before parsing the query body. So even our own SET session_timezone = 'UTC' is rejected with Invalid time zone: zoneinfo/UTC. (BAD_ARGUMENTS) before it can take effect.

Reproducer (10 runs without no-random-settings, 2 hit the bad random pick):

Code: 36. DB::Exception: Invalid time zone: zoneinfo/UTC. (BAD_ARGUMENTS), result:
Settings used in the test: … --session_timezone zoneinfo/UTC …

So I restored no-random-settings with a much shorter rationale (the old comment was way too long — fair point). With no-parallel gone, the test now runs in parallel; with the bogus-timezone path filtered out, all 5 reruns pass cleanly. Final tag set: atomic-database, no-random-settings. Reference also updated (rejected_without_append_ok).

Happy to take another look if you'd prefer a different approach to dodging the zoneinfo/UTC randomizer pick.

Note: the bot pushed a commit, but the description above may not exactly match the actual change — see the diff for what was committed.


ClickGapAI · Confidence: HIGH

@clickgapai

Copy link
Copy Markdown
Contributor Author

CI fix exhausted: 1 attempts on Stateless tests (amd_msan, flaky check), 15 total (15 fix attempts, 0 skips). Needs human review.

Requested by @alexey-milovidov in ClickHouse#103894 (comment)

contrib/NuRaft                                     |  2 +-
 contrib/SimSIMD                                    |  2 +-
 contrib/StringZilla                                |  2 +-
 contrib/avro                                       |  2 +-
 contrib/aws                                        |  2 +-
 contrib/aws-c-auth                                 |  2 +-
 contrib/aws-checksums                              |  2 +-
 contrib/aws-crt-cpp                                |  2 +-
 contrib/azure                                      |  2 +-
 contrib/boost                                      |  2 +-
@nikitamikhaylov nikitamikhaylov self-assigned this May 7, 2026
@nikitamikhaylov
nikitamikhaylov added this pull request to the merge queue May 7, 2026
Merged via the queue into ClickHouse:master with commit bd7d220 May 7, 2026
165 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants