Altinity / clickhouse-backup

Tool for easy backup and restore for ClickHouse® using object storage for backup files.
https://altinity.com
Other
1.25k stars 225 forks source link

Error during restore incremental backup already exists after 1 times, please check your schema dependencies #470

Closed gawsoftpl closed 2 years ago

gawsoftpl commented 2 years ago

Error overview

During restoring incremental backup I received error:

error can't create table backup.uk_price_paid: code: 57, message: Directory for table data store/2b3/2b3925e0-1b41-466f-85ae-228765bc2c6c/ already exists after 1 times, please check your schema dependencies

It happened due to UUID collision, most likely because some not random UUIDs were manually specified in CREATE queries. after 1 times, please check your schema dependencies

How to resolve

  1. restart database server
  2. restore only schema with --rm
    clickhouse-backup restore -rm -s backup3
  3. restore only data
    clickhouse-backup restore -d backup3
Slach commented 2 years ago

looks like it expected behavior, and not accroding to "incremental" backup if you try to restore on server where table already exits with the same UUID, you will see this error

During execute clickhouse-backup create UUID inherited from create table definition backup.uk_price_paid on source server