Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for create table engine ReplicatedReplacingMergeTree #1169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rupreht
Copy link

@Rupreht Rupreht commented Sep 18, 2024

Fix for x-migrations-table-engine=ReplicatedReplacingMergeTree

2024/09/18 22:32:32 error: failed to open database, "clickhouse://localhost:9440/?username=xxx&password=xxx&secure=1&skip_verify=1&debug=1&x-migrations-table=MIGRATE_SCHEMA_MIGRATIONS&x-migrations-table-engine=ReplicatedReplacingMergeTree('/clickhouse/tables/xxx/MIGRATE_SCHEMA_MIGRATIONS','{replica}')&x-cluster-name=xxxx":
 code: 42, message: There was an error on [chi-replicated-xxxx-0-0:9440]:
Code: 42. DB::Exception: ORDER BY or PRIMARY KEY clause is missing.
Consider using extended storage definition syntax with ORDER BY or PRIMARY KEY clause.

this patch makes so:

CREATE TABLE MIGRATE_SCHEMA_MIGRATIONS ON CLUSTER otel (
   version    Int64,
   dirty      UInt8,
   sequence   UInt64
) Engine=ReplicatedReplacingMergeTree('/clickhouse/tables/otel/MIGRATE_SCHEMA_MIGRATIONS','{replica}')
PRIMARY KEY sequence
ORDER BY sequence

@Rupreht
Copy link
Author

Rupreht commented Sep 18, 2024

you can connect to any nodes in cluster and deploy everything at once
p/s
the broken test in 1.22.x is not because of database/clickhouse/clickhouse.go (my patch)

@Rupreht Rupreht force-pushed the fix_clickhouse_migrationstableengine_tree branch from 8efead9 to 16cb313 Compare September 19, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant