Skip to content

Commit

Permalink
Channels: Run TRUNCATE with alter_sync=2 (#4804)
Browse files Browse the repository at this point in the history
ON CLUSTER fails since it tries to create conflicting
dll entries on each node.

Error:
```Cannot execute replicated DDL query, maximum retries exceeded.
(UNFINISHED)```
  • Loading branch information
macobo authored Nov 12, 2024
1 parent 4aa7dec commit fc83040
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENGINE = MergeTree()
<% end %>
ORDER BY referrer_source;

TRUNCATE TABLE acquisition_channel_source_category <%= @on_cluster_statement %>;
TRUNCATE TABLE acquisition_channel_source_category SETTINGS alter_sync=2;

INSERT INTO acquisition_channel_source_category(referrer_source, category)
SELECT t.1 AS referrer_source, t.2 AS category
Expand Down Expand Up @@ -43,7 +43,7 @@ ENGINE = MergeTree()
<% end %>
ORDER BY referrer_source;

TRUNCATE TABLE acquisition_channel_paid_sources <%= @on_cluster_statement %>;
TRUNCATE TABLE acquisition_channel_paid_sources SETTINGS alter_sync=2;

INSERT INTO acquisition_channel_paid_sources(referrer_source)
SELECT arrayJoin({paid_sources:Array(String)}) AS referrer_source
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TRUNCATE TABLE IF EXISTS location_data <%= if @cluster? do %>ON CLUSTER '{cluster}'<% end %>
TRUNCATE TABLE IF EXISTS location_data SETTINGS alter_sync=2

0 comments on commit fc83040

Please sign in to comment.