Channels: Run TRUNCATE with alter_sync=2 (#4804)

ON CLUSTER fails since it tries to create conflicting
dll entries on each node.

Error:
```Cannot execute replicated DDL query, maximum retries exceeded.
(UNFINISHED)```
This commit is contained in:
Karl-Aksel Puulmann 2024-11-12 09:24:23 +02:00 committed by GitHub
parent 4aa7dec301
commit fc83040ec1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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
@ -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

View File

@ -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