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

Recreate table with uuid macros in zookeeper path #615

Closed
leqduyvp opened this issue Mar 6, 2023 · 5 comments
Closed

Recreate table with uuid macros in zookeeper path #615

leqduyvp opened this issue Mar 6, 2023 · 5 comments

Comments

@leqduyvp
Copy link

leqduyvp commented Mar 6, 2023

Is there an option to change the 'CREATE TABLE' query in the backup to use {uuid} macro in zookeeper path?
My source tables were created with '/clickhouse/tables/{uuid}/{shard}' as zookeeper path parameter, but when I restore these tables, the uuid part is replaced with a fixed string, for example: '/clickhouse/tables/8e314902-c0a0-44a8-9938-7aadf8cccdaf/{shard}'

@Slach
Copy link
Collaborator

Slach commented Mar 6, 2023

Table tried to restore with the same UUID which used for backup

replace {uuid} to string was resolve following clickhouse 22.5+ behavior
#466
when clickhouse-server can't use {uuid} during create Replicated table only in one node without use ON CLUSTER

@Slach
Copy link
Collaborator

Slach commented Mar 6, 2023

welcome to propose other solution

@leqduyvp
Copy link
Author

leqduyvp commented Mar 7, 2023

Thank you for your quick response.

Can you add an option to use the {uuid} macros? Or should I use an older version of clickhouse-backup to have this behavior?

@Slach
Copy link
Collaborator

Slach commented Mar 7, 2023

Could you explain? Which problem do you try to resolve?

Look to SELECT * FROM system.clusters

add to /etc/clickhouse-server/config.yml

general:
  restore_schema_on_cluster: "your_cluster_name"

then {uuid} will not be replaced during creation inside clickhouse-backup
you shall understand, then {uuid} macro will resolve inside clickhouse-server when CREATE TABLE .. ON CLUSTER ... will execute on each node in DDLWorker thread

@Slach Slach closed this as completed Mar 7, 2023
@leqduyvp
Copy link
Author

leqduyvp commented Mar 7, 2023

Thanks a lot, I'll try again

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

No branches or pull requests

2 participants