Skip to content

WINDOW VIEW breaks Replicated database #75191

Closed

Description

@al13n321

To reproduce:

  1. Create a WINDOW VIEW in a Replicated database.
  2. Add a replica to that database.

The new replica will get stuck because it'll try to do two things:

  • Create the WINDOW VIEW's inner table: CREATE TABLE db..inner_<uuid>.
  • Create the WINDOW VIEW itself, which also tries to create its inner table and fails with TABLE_ALREADY_EXISTS.

Full repro:

create database re3 engine Replicated('/re3', 's1', 'r1');
create table re3.in (k String, v Int64) engine Memory;
create table re3.out (k String, s Int64) engine ReplicatedMergeTree order by k;
create window view re3.v to out (k String, s Int64) inner engine ReplicatedAggregatingMergeTree order by x as select tumbleStart(x), sum(v) as s from re3.in group by tumble(now(), interval 1 minute) as x SETTINGS allow_experimental_window_view = 1, allow_experimental_analyzer = 0;

-- On another server:
create database re3 engine Replicated('/re3', 's1', 'r2');

then look for infinitely retried "TABLE_ALREADY_EXISTS" errors in the second server's log.

Version info

Activity

  1. added
    bug-unreleased
    experimental feature
    on Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-unreleasedexperimental feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions