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

hotfix created empty .tar.gz in 2.2.7+ #676

Closed
Slach opened this issue Jun 23, 2023 · 1 comment · Fixed by #677
Closed

hotfix created empty .tar.gz in 2.2.7+ #676

Slach opened this issue Jun 23, 2023 · 1 comment · Fixed by #677
Assignees
Milestone

Comments

@Slach
Copy link
Collaborator

Slach commented Jun 23, 2023

system.disks
default, disk2

disk_mapping:
   "default": "/var/lib/clickhouse/"
   "default-1-1": "/var/lib/clickhouse"
   "disk2": "/var/lib/clickhouse2/"
   "disk2-1-1": "/var/lib/clickhouse2"

wrong empty .tar.gz is created, which can't be restored

@Slach Slach self-assigned this Jun 23, 2023
@Slach Slach modified the milestones: 2.2.8, 2.3.0 Jun 23, 2023
@Slach
Copy link
Collaborator Author

Slach commented Jun 26, 2023

A root reason for wrong create parts in 2.2.7,
2.2.6 is not affected
v2.2.5...v2.2.7#diff-2da9a9de21c1940972736f4bfc8c28eda6344c5198c018ff300bd04c4baeaf90R529-R533

look screenshot
image

  1. code which mixed system.disks and disk_mapping instead of just replacing disk path, was added @AlexAkulov 😉
    it is helpful, when you make to download backup with different disk structure with current system.disks

  2. changes in 2.2.7, relates to Use UNFREEZE TABLE in ClickHouse after backup finished to allow s3 disks unlock and delete remote keys during merge #423
    we make UNFREEZE and don't delete /var/lib/clickhouse/data/db/table/shadow/part_name after moving hard link files to /var/lib/clickhouse/backup/backup_name/shadow/db/table/disk_name/part_name/
    we make UNFREEZE after all disks processed for prepare properly delete S3 remote keys because UNFREEZE makes decrement link count fields in local metadata files in /var/lib/clickhouse/disks/s3_disk/data/db/table/part_name/*.*

  3. so, a wrong disk got a non-empty part list
    and this non-empty part list added to backup_name/metadata/db/table.json
    JSON serialization of the empty list, just write nothing to table.json under a wrong disk name in 2.2.6-

  4. empty directories with part_name in /var/lib/clickhouse/backup/backup_name/shadow/db/table/wrong-disk-name during uploading create empty archive files because we just iterate directories for creating a list of files for uploading

  5. because *.tag.gz files empty, so the download process failed because part_name directory was not created after downloading

Slach added a commit that referenced this issue Jun 26, 2023
@Slach Slach closed this as completed in 62e8a54 Jun 26, 2023
Slach added a commit that referenced this issue Jun 26, 2023
@Slach Slach mentioned this issue Jun 26, 2023
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 a pull request may close this issue.

1 participant