Skip to content

Remove WINDOW VIEW - #114747

Merged
alexey-milovidov merged 56 commits into
masterfrom
remove-window-view
Aug 30, 2026
Merged

alexey-milovidov merged 56 commits into
masterfrom
remove-window-view

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Closes: #61069
Closes: #113493
Closes: #114097
Closes: #75191
Related: #114738
Related: #88706

Changelog category (leave one):

  • Backward Incompatible Change

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

The experimental WINDOW VIEW feature is removed, together with the WATCH statement and the windowID function. It has been non-functional since version 24.12 (inserts into the source table were silently not delivered to window views) and was never supported by the analyzer, which is enabled by default since 24.3. The settings allow_experimental_window_view, window_view_clean_interval, window_view_heartbeat_interval, and wait_for_window_view_fire_signal_timeout are kept as obsolete no-ops. The time-window functions tumble, tumbleStart, tumbleEnd, hop, hopStart, and hopEnd are kept. If you still have window views defined, drop them before upgrading: a server that finds a window view in its metadata fails to start (Cannot parse definition from metadata file ... (SYNTAX_ERROR)), the same way the removal of the Lazy database engine behaves. Similar functionality will be reimplemented on top of streaming queries (issue #114738).

The removal, in detail:

  • src/Storages/WindowView/ (StorageWindowView, WindowViewSource, StorageBlocks), WatermarkTransform, the ParserCreateWindowViewQuery parser, and the whole WATCH statement stack (ParserWatchQuery, ASTWatchQuery, InterpreterWatchQuery, the IStorage::watch virtual) — window views were the last implementor of watch, and the WATCH statement was already documented as deprecated.
  • The ASTCreateQuery watermark/lateness fields and their AST JSON serialization and validation. The clickhouse_json boundary fails closed rather than silently reinterpreting legacy payloads: ASTCreateQuery::readJSON rejects a set is_window_view, watermark strategy or allowed_lateness flag and the watermark_function / lateness_function children (otherwise such a payload deserialized as an ordinary CREATE TABLE ... AS SELECT and was executed as an immediate-population table create), while ASTViewTargets::readJSON rejects the Inner target kind, which nothing produces any more and which formatted back to parser-impossible INNER ENGINE ... SQL. Both are covered by 04892_ast_json_removed_window_view_state; the PushingToWindowViewSink and ViewType::WINDOW branches in InsertDependenciesBuilder; window-view special cases in InterpreterCreateQuery, InterpreterInsertQuery, StorageFactory, DatabaseOrdinary, DatabaseReplicated, DDLDependencyVisitor, QueryFuzzer, BuzzHouse, and the ArrowFlight table-type mapping.
  • The windowID function and the UInt32 single-argument forms of tumbleStart/tumbleEnd/hopStart/hopEnd (they only accepted windowID output). The rest of the time-window function family stays, since these are ordinary functions usable in a regular GROUP BY and are exactly the vocabulary for the streaming-queries replacement.
  • The keywords WATCH, EVENTS, ALLOWED_LATENESS, and STRICTLY_ASCENDING (the WATERMARK keyword stays: the streaming-queries WATERMARK FOR clause uses it), the error code QUERY_IS_NOT_SUPPORTED_IN_WINDOW_VIEW, and the corresponding fuzzer dictionary and ANTLR grammar entries.
  • Kept for compatibility: QueryViewsLogElement::ViewType::WINDOW (so existing system.query_views_log tables keep their schema) and ViewTarget::Inner (so old DDL log entries still parse), following the same pattern as the LIVE VIEW removal.
  • No replay compatibility is provided for Replicated databases, again following the LIVE VIEW precedent: a lagging replica that upgrades and then replays a retained CREATE WINDOW VIEW DDL queue entry stalls on a plain SYNTAX_ERROR — the same long-standing behavior as for any queue entry with unknown syntax (for example, one written by a newer server) — and the replica should be recreated. An earlier revision of this PR carried a token-level rewriting layer in DatabaseReplicatedWorker that tried to skip such entries and their follow-ups; it was removed as an unmaintainable fallback path (review kept finding shapes of retained RENAME/EXCHANGE/ATTACH history that it silently mishandled), in favor of failing closed.
  • Likewise no compatibility path is added for SQL-defined HTTP handlers: a stored CREATE HANDLER ... AS WATCH ... definition no longer parses. CREATE HANDLER has never appeared in a released version (it exists only on master and in the unreleased 26.8 branch), and WATCH there can only target a window view, which the upgrade path already requires dropping.
  • The allow_experimental_window_view constraint in tests/docker_scripts/stress_tests.lib is kept (only the constraint, not the profile value, which would mark an obsolete setting as changed and add a system.warnings entry): the upgrade check runs the previous release's suite under the previous release's binary, whose window-view tests are not dropped afterwards because --upgrade-check implies --fake-drop, and the leftover metadata would then stop the new server from starting.
  • Tests: the four remaining window-view tests are removed. The hop overflow regressions stay: 04891_time_window_functions_wrapped_interval_overflow keeps its hop assertions without the windowID ones, and the hop half of 04201_windowID_hop_time_overflow moved to 05043_hop_window_end_past_datetime_range. The pure time-window-function coverage of 01049_window_view_window_functions moved to a new 04891_time_window_functions test, which also pins the new ILLEGAL_TYPE_OF_ARGUMENT behavior of tumbleStart(UInt32).
  • Docs: the Window View section of CREATE VIEW (which master has since moved into the CREATE VIEW doc string of src/Parsers/ParserCreateQuery.cpp, from where the autogenerated region of docs/reference/statements/create/view.mdx is produced), the WATCH page (with its navigation entries and locale twins) are removed and the old-slug redirects retargeted; the window-view entries are removed from the generated settings/functions reference pages (second commit, hence the pr-autogenerated-docs label): the window-view.mdx settings page, the four settings' entries in the pages/manifest/navigation/settings explorer, and the windowID section of time-window-functions.mdx. The unrelated drift accumulated on master since the last nightly regeneration is deliberately not included; the nightly docs-autogen job will pick it up. The hand-written intro of time-window-functions.mdx no longer links to the removed #window-view anchor of the CREATE VIEW page, and the hop / hopStart / hopEnd descriptions no longer say that the bound of the first window is returned "without WINDOW VIEW". In docs/integrations/language-clients/rust/index.mdx, the three WATCH mentions (the Compression::Lz4 default, the watch cargo feature, and the mocking utilities) are scoped to servers older than v26.9: the clickhouse-rs crate keeps its watch feature, so the accurate statement is which servers accept the query.

Why now: the feature has been non-functional since Dec 2024 — commit ceae84c87a2 removed the explicit view-dependency registration and DDLDependencyVisitor never extracted the source table of a CREATE WINDOW VIEW, so inserts into the source table were silently not pushed to window views, and direct inserts failed with std::out_of_range (#113493). Nobody noticed for ~1.5 years. It was never ported to the analyzer (with enable_analyzer = 1, the default, existing window views load permanently inert), its tests were removed in #73822 because they were inherently flaky, and it kept costing triage time (#114097 is a recent server SIGSEGV through getSourceTableSelectQuery).

The full assessment, including the plan for reimplementing this functionality on top of streaming queries (SELECT ... FROM t STREAM, WATERMARK FOR, emit-on-watermark windowed aggregation), is in #114738.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

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

Version info

  • Merged into: 26.9.1.384 (included in 26.9 and later)

@mintlify

mintlify Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ClickHouse-docs 🟢 Ready View Preview Aug 14, 2026, 2:27 AM

@alexey-milovidov alexey-milovidov added the pr-autogenerated-docs PR that regenerates docs artifacts from source; exempt from the autogenerated-region edit guard label Aug 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ad14224]

Summary: ✅


AI Review

Summary

This PR removes the experimental WINDOW VIEW feature, its WATCH statement, and the windowID function, while keeping the tumble / hop family and hardening the legacy AST-JSON boundary. The follow-up fixes addressed the earlier replicated-DDL and docs regressions, but one contract mismatch remains in the retained time-window extractors.

Findings

⚠️ Majors

  • [src/Functions/FunctionsTimeWindow.cpp:255] The one-argument tumbleStart / tumbleEnd / hopStart / hopEnd path still validates Tuple(Nullable(Date/DateTime), ...) as acceptable input via isTupleOfTwoDateTimes, and getReturnTypeImpl propagates the nullable element type, but executeWindowBound later rejects the same shape because it only accepts bare ColumnVector<UInt16/UInt32> elements. The new expectations in tests/queries/0_stateless/04891_time_window_functions.sql now pin that inconsistency instead of choosing one contract. Either reject nullable tuple elements during validation, or accept them end-to-end in executeWindowBound.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions: make the single-argument time-window bound extractors consistent for nullable tuple elements, either by rejecting them at validation time or by accepting them end-to-end and updating the tests to match.

LLVM Coverage Report

Measured on commit ad14224.

Metric Baseline Current Δ
Lines 88.50% 88.60% +0.10%
Functions 92.00% 92.10% +0.10%
Branches 80.80% 80.80% +0.00%

Changed lines: Changed C/C++ lines covered: 382/386 (98.96%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-backward-incompatible Pull request with backwards incompatible changes label Aug 14, 2026
robot-clickhouse and others added 2 commits August 14, 2026 02:30
The experimental `WINDOW VIEW` feature is removed, following the same
path as the `LIVE VIEW` removal (PR #88706):

- `StorageWindowView`, `WindowViewSource`, `StorageBlocks` and
  `WatermarkTransform` are deleted together with the CREATE WINDOW VIEW
  parser, the WATCH statement (window views were its last implementor),
  the `windowID` function, and the WATCH, EVENTS, ALLOWED_LATENESS and
  STRICTLY_ASCENDING keywords.
- The settings `allow_experimental_window_view`,
  `window_view_clean_interval`, `window_view_heartbeat_interval` and
  `wait_for_window_view_fire_signal_timeout` are kept as obsolete no-ops.
- The `tumble`/`hop`/`tumbleStart`/`tumbleEnd`/`hopStart`/`hopEnd`
  functions are kept. The UInt32 single-argument forms of the
  bound-extraction functions, which only accepted `windowID` output, are
  removed. Their coverage from 01049_window_view_window_functions moved
  to 04891_time_window_functions.
- `QueryViewsLogElement::ViewType::WINDOW` and `ViewTarget::Inner` are
  kept so that old log tables and DDL log entries remain readable.
- Docs: the Window View section, the WATCH page, and its navigation
  entries are removed; the old-slug redirects are retargeted.

The feature has been non-functional since Dec 2024 (commit ceae84c
removed the view-dependency registration, issue #113493), was never
ported to the analyzer, and its tests were removed in PR #73822. A
server with a window view left in metadata will fail to load it: drop
window views before upgrading.

Related: #114738

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Only the window-view-related parts of the generated settings and
functions reference: the window-view.mdx settings page, the four
obsolete settings' entries (pages, manifest, navigation, the settings
explorer), and the `windowID` section and `WINDOW VIEW` mentions in
time-window-functions.mdx. The drift accumulated on master since the
last nightly regeneration is deliberately not included; the nightly
docs-autogen job will pick it up. The PR carries the
pr-autogenerated-docs label because these regions are autogenerated.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread src/Parsers/ASTCreateQuery.cpp Resolved
Comment thread tests/docker_scripts/stress_tests.lib Resolved
@clickhouse-gh

clickhouse-gh Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing ad14224d5 with master e1e0186e3 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

354 object files changed (-473.03 KiB total), 0 added.

Object file Master PR Δ
src/Functions/CMakeFiles/clickhouse_functions_obj.dir/FunctionsTimeWindow.cpp.o 739.98 KiB 618.29 KiB -121.69 KiB (-16.45%)
src/Parsers/CMakeFiles/clickhouse_parsers.dir/ParserCreateQuery.cpp.o 496.97 KiB 473.95 KiB -23.02 KiB (-4.63%)
src/CMakeFiles/dbms.dir/Interpreters/InsertDependenciesBuilder.cpp.o 902.15 KiB 883.36 KiB -18.79 KiB (-2.08%)

721 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

1122 translation units recompiled, 7300 s compile time in total, 1122 of them have a recent master baseline.

Job report

robot-clickhouse and others added 5 commits August 14, 2026 15:06
# Conflicts:
#	docs/_site/customizations/settings-legacy-routes/session-settings.js
#	docs/snippets/components/SessionSettingsExplorer/SessionSettingsExplorer.jsx
…undary

`ASTCreateQuery::readJSON` no longer reads `is_window_view`, the watermark
strategies, `allowed_lateness`, or the `watermark_function` / `lateness_function`
children, and `JSONObjectReader` ignores keys it does not read. A legacy
`clickhouse_json` payload of a window view therefore deserialized as an ordinary
`CREATE TABLE ... AS SELECT` - all create-kind flags false with `select` set,
which `isCreateQueryWithImmediateInsertSelect` accepts and executes as an
immediate-population table create. Reject such payloads instead.

The flags are rejected only when set: `writeJSON` emitted them for every `CREATE`
form (`writeBool` always writes the key, `false` included), so a legacy payload of
an ordinary query carries them as `false` and must still be accepted. `writeChild`
skipped null children, so the two expression fields are rejected by presence.

`ASTViewTargets::readJSON` now also rejects the `Inner` target kind. Nothing
produces it any more - `ParserViewTargets` throws for it, `ParserCreateQuery` and
`CreateQueryUUIDs` only build `To` / `Samples` / `Tags` / `Metrics`, and the only
syntax that ever carried an inner target was `CREATE WINDOW VIEW ... INNER ENGINE`.
Formatting such a target is lossy in both directions: a crafted
`{"kind":"Inner","inner_engine":...}` formatted as
`CREATE MATERIALIZED VIEW mv TO dst INNER ENGINE = Memory AS SELECT 1`, which the
SQL parser no longer accepts, while a bare `Inner` target was dropped from the
formatted SQL entirely. The kind itself stays in `ViewTarget::Kind` so that the
UUID mappings of old DDL log entries still parse.

Co-Authored-By: Claude Fable 5 <[email protected]>
…for the upgrade check

The upgrade check runs the *previous release's* stateless suite under the
*previous release's* binary, and v26.7 still contains
`04202_window_view_disabled_with_analyzer` and `04218_window_view_insert_70296`,
which create window views. `clickhouse-test --upgrade-check` runs the client with
`--fake-drop` (`ignore_drop_queries_probability = 1`), so their `DROP TABLE` is
ignored and the window view stays in the metadata. The new binary does not merely
skip such a table - it fails to start:

    <Error> Application: Caught exception while loading metadata: Code: 62.
    DB::Exception: Syntax error (in file store/.../wv.sql): failed at position 8
    (WINDOW) ... Cannot parse definition from metadata file ... (SYNTAX_ERROR)

Dropping the constraint would therefore let the upgrade check brick its own
post-upgrade restart, depending on which of the old tests ran within the global
time limit.

Only the constraint is restored, not the profile value that `master` also had:
`<readonly/>` alone rejects any change with `SETTING_CONSTRAINT_VIOLATION`, and
both binaries default the setting to `false`. Assigning the value would mark an
obsolete setting as changed on the new binary, adding an `Obsolete setting` entry
to `system.warnings` that `01945_system_warnings` asserts is absent.

Co-Authored-By: Claude Fable 5 <[email protected]>
`SQLDefinedHandlerFromAST` landed on `master` after this branch was created and
includes `Parsers/ASTWatchQuery.h` to exempt `WATCH` from the "a mutating query
needs a mutating HTTP method" gate of `CREATE HANDLER`. The `WATCH` statement is
gone, so drop that branch and the stale comment in
`statementHasSideEffectsUnderReadonly`. (`04652_create_handler_watch`, which
pinned the behaviour, is deleted in the preceding commit.)

Co-Authored-By: Claude Fable 5 <[email protected]>
`WATCH`, `EVENTS` and `STRICTLY_ASCENDING` are no longer keywords, so drop them
from the client's highlighting list and from the Web UI's copy of it (the two are
kept in sync). Also fix the `ParserInsertQuery` doc comment, which still described
`INSERT INTO ... SELECT | WATCH`.

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread src/Parsers/ParserCreateQuery.cpp Resolved
Comment thread programs/server/play.html Resolved
…continue

# Conflicts:
#	docs/ar/reference/navigation.json
#	docs/es/reference/navigation.json
#	docs/fr/reference/navigation.json
#	docs/ja/reference/navigation.json
#	docs/ko/reference/navigation.json
#	docs/pt-BR/reference/navigation.json
#	docs/ru/reference/navigation.json
#	docs/snippets/components/SessionSettingsExplorer/SessionSettingsExplorer.jsx
#	docs/zh/reference/navigation.json
@alexey-milovidov

Copy link
Copy Markdown
Member Author

test_replicated_database/test.py::test_skip_legacy_window_view_ddl_chain

This should be deleted right away.

Three separate follow-ups, all of them user-facing documentation:

- `src/Functions/FunctionsTimeWindow.cpp`: restore the deterministic
  `toDateTime('2026-01-02 03:04:05', 'UTC')` arguments in the `tumble` / `tumbleStart` /
  `tumbleEnd` / `hop` / `hopStart` / `hopEnd` examples. `master` replaced the original
  `now()` calls, whose documented responses were pinned to a fixed date and therefore
  could never match, and an earlier merge of this branch resolved that hunk to our
  (older) side. It made `Docs examples` red with six unexpected failures, one per
  surviving time-window function.
- `docs/reference/functions/regular-functions/time-window-functions.mdx`: drop the link
  to the removed `#window-view` anchor of the `CREATE VIEW` page, which was the last
  error of `Check internal links and anchors`, and regenerate the three `hop` / `hopStart`
  / `hopEnd` descriptions, which still said the first-window bound is returned "when hop
  function is used without `WINDOW VIEW`" while the `FunctionDocumentation` source they
  come from no longer does.
- `docs/integrations/language-clients/rust/index.mdx`: scope the three `WATCH` mentions
  (the `lz4` compression default, the `watch` cargo feature, and the mocking utilities)
  to servers older than v26.9. The `clickhouse-rs` crate keeps its `watch` feature, so
  the right fix is to say which servers accept the statement rather than to delete the
  bullets. The dangling "See the corresponding section for details" is dropped along
  with it: the section it pointed at was the `WATCH` reference page.
Comment thread docs/_site/redirects.json Resolved
@alexey-milovidov

alexey-milovidov commented Aug 29, 2026 •

Copy link
Copy Markdown
Member Author

🕵 Status after merging master (30afece):

  • The branch was CONFLICTING; it is MERGEABLE again. Three conflicts: src/Databases/enableAllExperimentalSettings.cpp (kept master's new CompressionCodecFactory::getGateSettingNames loop, dropped the allow_experimental_window_view line) and the two multi-megabyte single-line generated payloads (docs/_site/customizations/settings-legacy-routes/session-settings.js, docs/snippets/components/SessionSettingsExplorer/SessionSettingsExplorer.jsx). The latter two were resolved by parsing the JSON, deleting the four window-view settings and re-serializing; the transform was validated by replaying it on the merge base and comparing byte-for-byte with the previous state of this branch, and the result differs from master by exactly those four keys and nothing else.

  • Docs examples (6 unexpected failures) was caused by this branch, and by the merge rather than by the removal: master had replaced the now() calls in the tumble / tumbleStart / tumbleEnd / hop / hopStart / hopEnd FunctionDocumentation examples with toDateTime('2026-01-02 03:04:05', 'UTC') — a documented response can never match a now() result — and the 2026-08-27 merge resolved that hunk to the older side, so all six surviving time-window functions failed. The deterministic arguments are restored; src/Functions/FunctionsTimeWindow.cpp now differs from master only by the windowID removal.

  • Docs check (Mintlify) had one error left, the #window-view fragment. It came from the hand-written intro of time-window-functions.mdx (above AUTOGENERATED_START), now reworded. The three hop / hopStart / hopEnd descriptions in the autogenerated region are synced with their FunctionDocumentation sources in the same commit.

  • Both AI-review majors are addressed; see the replies on the two threads. The Rust client page's three WATCH mentions are scoped to servers older than v26.9 rather than deleted, because clickhouse-rs keeps its watch cargo feature and its mock support.

  • CH Inc sync needed a manual merge (the robot reported "Needs manual intervention"): its normal path — previous sync head plus current upstream head — conflicts in ~30 files of public/private reconciliation that private master has already done, so the sync branch was rebuilt as private master plus this head, which is what the robot's own fallback recipe produces. It now merges, builds, and passes the private style check.

  • A local RelWithDebInfo build of the merged tree compiles with no errors.

The pull request deletes `docs/reference/settings/session-settings/window-view.mdx`,
but nothing preserved the published
`/reference/settings/session-settings/window-view` route, so existing links and
bookmarks for `window_view_clean_interval` / `window_view_heartbeat_interval`
would start returning 404.

Add a redirect to the session settings index for that route in every language,
the same way the removed `WATCH` page is redirected, and delete the localized
copies of the page together with their navigation entries, matching how the
localized `WATCH` pages are removed.
{
FunctionArgumentDescriptors mandatory_args{
{"window_id_or_tuple", &isTupleOfTwoDateTimesOrUInt32, nullptr, "Tuple(Date/DateTime, Date/DateTime) or UInt32"}
{"window_tuple", &isTupleOfTwoDateTimes, nullptr, "Tuple(Date/DateTime, Date/DateTime)"}

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.

isTupleOfTwoDateTimes still strips inner nullability, so this one-argument overload accepts Tuple(Nullable(Date/DateTime), ...) and getReturnTypeImpl even propagates the nullable element type. But executeWindowBound only accepts bare ColumnVector<UInt16/UInt32> elements, so the same shape is rejected later with ILLEGAL_TYPE_OF_ARGUMENT. That leaves the public contract self-contradictory, and the new negative expectations in 04891_time_window_functions.sql are now pinning that mismatch in place.

Please make the contract consistent in one direction or the other: either reject nullable tuple elements at validation time here, or allow them in executeWindowBound and update the tests accordingly.

@alexey-milovidov alexey-milovidov self-assigned this Aug 30, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Aug 30, 2026
Merged via the queue into master with commit 2ae8a25 Aug 30, 2026
343 of 344 checks passed
@alexey-milovidov
alexey-milovidov deleted the remove-window-view branch August 30, 2026 09:56
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 30, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 30, 2026
Master removed the window view storage in ClickHouse#114747, so the branch's only conflict
is the modify/delete on StorageWindowView.cpp. Accepted the deletion.

The arm it carried relaxed allow_non_metadata_alters around the internal cleanup
ALTER that StorageWindowView issued for windows past the watermark. That
synthesizer no longer exists, so the relaxation has no caller and is dropped
rather than relocated. The other internal synthesizers the branch covers are
unaffected.

Co-Authored-By: Claude Opus 5 <[email protected]>
pull Bot pushed a commit to admariner/ClickHouse that referenced this pull request Aug 30, 2026
The test broke the connection between a `Distributed` table and its remote shard,
healed it, and then waited a fixed 5 seconds for the background sender to deliver
the two pending inserts. That wait races the sender's retry interval: every failed
attempt doubles it, starting at `background_insert_sleep_time_ms` (100 ms) and
growing up to `background_insert_max_sleep_time_ms`, which defaults to 30 seconds.
A newly inserted file does not shorten an interval the sender is already waiting
out, because `addFileAndSchedule` calls `scheduleAfter` with `overwrite = false`,
which is a no-op for an already delayed task. So the test could see only the first
row and fail with `assert '1' == '3'`.

Measured with two local servers, stopping and restarting the shard in place of the
network partition: after a 60 second outage the sender's `error_count` reaches 9,
which saturates the interval at the 30 second cap, and all rows arrive 20.2 seconds
after the shard comes back - four times the 5 seconds the test allowed. With
`background_insert_max_sleep_time_ms = 1000` the same scenario delivers everything
in 1.5 seconds.

The test now caps that setting on its table and waits for the observable state
instead of sleeping: for the rows to appear on the shard, and - in place of the
sleep that was there to let the send fail while the connection was down - for
`error_count` in `system.distribution_queue` to grow. The latter also states the
intent explicitly, that healing the partition has to exercise a reconnection.

The test has never failed on `master`; in the last 90 days it failed four times,
all of them on pull requests and all in instrumented builds (two under
`amd_llvm_coverage`, two under `amd_msan`), which is what a slow machine
accumulating more failed attempts inside the same partition window looks like.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114747&sha=ad14224d5f960e11c6fddf144128ac30beed5cc8&name_0=PR&name_1=Integration%20tests%20%28amd_llvm_coverage%2C%206%2F8%29
Related: ClickHouse#114747

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov alexey-milovidov mentioned this pull request Sep 20, 2026
47 of 72 tasks
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 10, 2026
WINDOW VIEW was removed on master (ClickHouse#114747), so `ASTCreateQuery` no longer
has `is_window_view` and the stored metadata can no longer hold that kind:
`isView()` is now exactly an ordinary or a materialized view. Remove the
check that rejected a stored Window View and its test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
UberDever added a commit to UberDever/ClickHouse that referenced this pull request Oct 19, 2026

This branch was successfully deployed

1 active deployment
staging - docs — ad14224d Deployed Aug 30, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-autogenerated-docs PR that regenerates docs artifacts from source; exempt from the autogenerated-region edit guard pr-backward-incompatible Pull request with backwards incompatible changes pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

2 participants