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

Error while creating backups of tables with DISTRIBUTED engine #44

Closed
oleksandr-neshcheret opened this issue Sep 9, 2019 · 5 comments
Closed

Comments

@oleksandr-neshcheret
Copy link

I have observed an issue during creating a backup for table with use DISTRIBUTED engine:

$ sudo docker run --rm -it --network host -v "/mnt/clickhouse:/var/lib/clickhouse" -e S3_BUCKET=test   alexakulov/clickhouse-backup create db_layer_0.sikandar_replicated
2019/09/09 16:35:04 Create backup 'db_layer_0.sikandar_replicated'
2019/09/09 16:35:04 Freeze 'db_layer_0.sikandar_replicated'
2019/09/09 16:35:04 Freeze 'db_layer_1.sikandar_replicated'
2019/09/09 16:35:04 Freeze 'default.sikandar'
2019/09/09 16:35:04 can't freeze 'default.sikandar' with: code: 48, message: Partition operations are not supported by storage Distributed

Looks like that issue is related to a fact that distributed table does not hold data itself, thus it doesn't have any partition.

CREATE TABLE sikandar
(
    sikandarDay Date, 
    sikandarId String, 
    sikandarAge UInt32
)
ENGINE = Distributed(level0, db_layer_0, sikandar_replicated, sipHash64(sikandarId));

The way current freeze works in the code(https://github.com/AlexAkulov/clickhouse-backup/blob/5d3a0d0196d58eb00cad915738795a120554f1ed/clickhouse.go#L178) fails

d40c477505fb :) ALTER TABLE default.sikandar FREEZE

ALTER TABLE default.sikandar
    FREEZE


Received exception from server (version 19.4.1):
Code: 48. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Partition operations are not supported by storage Distributed. 

Does distributed table backup is supported now, maybe I have missed something?

BR,
Aleksandr

@AlexAkulov
Copy link
Collaborator

Hi, Aleksandr!

Thank you! It fixed in 8646a73

@oleksandr-neshcheret
Copy link
Author

Thank for fixing.

@gowth
Copy link

gowth commented Aug 7, 2021

Does the clickhouse-backup tool work for distributed engines, because i see there is a limitation that this tool wont work for distributed engines

@gowth
Copy link

gowth commented Aug 7, 2021

@Slach
Copy link
Collaborator

Slach commented Aug 9, 2021

@gowth
clickhouse-backup works with DISTIRBUTED engine
could you describe what exactly wrong with your installation?

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

4 participants