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

can't ALTER TABLE ... FREEZE ... after successfully restore, frozen-metadata.txt present #826

Closed
hueiyuan opened this issue Feb 6, 2024 · 23 comments
Assignees
Milestone

Comments

@hueiyuan
Copy link

hueiyuan commented Feb 6, 2024

Description

After restore data from s3, we want to keep watching to backup data to s3 through backup tool server api.
But we always have this problem..., please follow this below error message.

| 2024/02/06 08:36:09.438515 error b.ch.GetInProgressMutations error: can't get in progress mutations: context canceled backup=shardshard1-increment-20240206083609 logger= │
│ backuper operation=create table=ck_job.dist_otel_trace_lab_trace_id_ts                                                                                                    │
│ 2024/02/06 08:36:09.446330 error b.AddTableToBackup error: can't freeze table: code: 27, message: Cannot parse input: expected '\t' before: 'chi%2Dck%2Djob%2Dv1%2Dck%2Dj │
│ ob%2Dv1%2Ds1r0\ndefault\n455c89ee-3b76-4c0d-81c6-3033f59d98b9\n' backup=shardshard1-increment-20240206083609 logger=backuper operation=create table=ck_job.otel_trace_lab │
│ _ubt                                                                                                                                                                      │
│ 2024/02/06 08:36:09.484358 error b.AddTableToBackup error: can't freeze table: code: 27, message: Cannot parse input: expected '\t' before: 'chi%2Dck%2Djob%2Dv1%2Dck%2Dj │
│ ob%2Dv1%2Ds1r0\ndefault\n566173c4-3697-4709-b1dd-78cc55a77075\n' backup=shardshard1-increment-20240206083609 logger=backuper operation=create table=ck_job.otel_trace_lab │
│ 2024/02/06 08:36:09.651814 error metrics.ExecuteWithMetrics(create_remote) return error: one of createBackupLocal go-routine return error: can't freeze table: code: 27,  │
│ message: Cannot parse input: expected '\t' before: 'chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds1r0\ndefault\n3462309a-c4da-40d6-b70e-712b82f42c43\n' logger=metrics           │
│ 2024/02/06 08:36:09.656748 error metrics.ExecuteWithMetrics(delete) return error: 'shardshard1-increment-20240206083609' is not found on local storage logger=metrics     │
│ 2024/02/06 08:36:09.656757 error Watch error: too many errors create_remote: 1, delete local: 1, during watch full_interval: 24h, abort watching logger=server            │
│ 2024/02/06 08:36:09.656769 debug api.status.stop -> status.commands[3] == {ActionRowStatus:{Command:watch Status:error Start:2024-02-06 08:36:09 Finish:2024-02-06 08:36: │
│ 09 Error:too many errors create_remote: 1, delete local: 1, during watch full_interval: 24h, abort watching} Ctx:<nil> Cancel:<nil>} logger=status

We are not sure why can not create_remote after restore data and why shows \t this error. hope someone can assist to answer it.
But if we do not execute restore, just directly execute watch after pod start running. the backup can normally running.

Version

clickhouse-operator: 0.22.2
clickhouse-server: 23.8.9
clickhouse-keeper: 23.8.9
clickhouse-backup: 2.4.27

disk configuration of clickhouse server

<yandex>
    <storage_configuration>
        <disks>
            <s3_tier_cold>
                <endpoint>https://s3.us-west-2.amazonaws.com/bucket/yyyyy/</endpoint>
                <send_metadata>true</send_metadata>
                <type>s3</type>
                <use_environment_credentials>true</use_environment_credentials>
            </s3_tier_cold>
        </disks>
        <policies>
            <default>
                <volumes>
                    <default>
                        <disk>default</disk>
                    </default>
                </volumes>
            </default>
            <move_from_local_disks_to_s3>
                <volumes>
                    <cold>
                        <disk>s3_tier_cold</disk>
                    </cold>
                    <hot>
                        <disk>default</disk>
                    </hot>
                </volumes>
            </move_from_local_disks_to_s3>
        </policies>
    </storage_configuration>
<yandex>

print-config for clickhouse-backup tool

general:
    remote_storage: s3
    max_file_size: 0
    disable_progress_bar: true
    backups_to_keep_local: 0
    backups_to_keep_remote: 0
    log_level: debug
    allow_empty_backups: false
    download_concurrency: 8
    upload_concurrency: 3
    use_resumable_state: true
    restore_schema_on_cluster: ""
    upload_by_part: true
    download_by_part: true
    restore_database_mapping: {}
    retries_on_failure: 3
    retries_pause: 30s
    watch_interval: 2m
    full_interval: 24h
    watch_backup_name_template: shard{shard}-{type}-{time:20060102150405}
    sharded_operation_mode: ""
    cpu_nice_priority: 15
    io_nice_priority: idle
    retriesduration: 30s
    watchduration: 2m0s
    fullduration: 24h0m0s
clickhouse:
    username: ippadmin
    password: ippcluster81
    host: localhost
    port: 9000
    disk_mapping: {}
    skip_tables:
        - system.*
        - INFORMATION_SCHEMA.*
        - information_schema.*
        - _temporary_and_external_tables.*
    skip_table_engines: []
    timeout: 5m
    freeze_by_part: false
    freeze_by_part_where: ""
    use_embedded_backup_restore: false
    embedded_backup_disk: ""
    backup_mutations: true
    restore_as_attach: false
    check_parts_columns: true
    secure: false
    skip_verify: false
    sync_replicated_tables: false
    log_sql_queries: true
    config_dir: /etc/clickhouse-server/
    restart_command: exec:systemctl restart clickhouse-server
    ignore_not_exists_error_during_freeze: true
    check_replicas_before_attach: true
    tls_key: ""
    tls_cert: ""
    tls_ca: ""
    max_connections: 8
    debug: false
s3:
    access_key: ""
    secret_key: ""
    bucket: ipp-clickhouse-lab
    endpoint: ""
    region: us-west-2
    acl: private
    assume_role_arn: arn:aws:iam::xxxxx:role/xxxxx
    force_path_style: true
    path: job-backup-eks/chi-shard-backup
    object_disk_path: ob-tiered-backup/{cluster}/{shard}
    disable_ssl: false
    compression_level: 1
    compression_format: zstd
    sse: ""
    sse_kms_key_id: ""
    sse_customer_algorithm: ""
    sse_customer_key: ""
    sse_customer_key_md5: ""
    sse_kms_encryption_context: ""
    disable_cert_verification: false
    use_custom_storage_class: false
    storage_class: STANDARD
    custom_storage_class_map: {}
    concurrency: 9
    part_size: 0
    max_parts_count: 2000
    allow_multipart_download: false
    object_labels: {}
    request_payer: ""
    debug: true
gcs:
    credentials_file: ""
    credentials_json: ""
    credentials_json_encoded: ""
    bucket: ""
    path: ""
    object_disk_path: ""
    compression_level: 1
    compression_format: tar
    debug: false
    force_http: false
    endpoint: ""
    storage_class: STANDARD
    object_labels: {}
    custom_storage_class_map: {}
    client_pool_size: 24
cos:
    url: ""
    timeout: 2m
    secret_id: ""
    secret_key: ""
    path: ""
    compression_format: tar
    compression_level: 1
    debug: false
api:
    listen: 0.0.0.0:7171
    enable_metrics: true
    enable_pprof: false
    username: ""
    password: ""
    secure: false
    certificate_file: ""
    private_key_file: ""
    ca_cert_file: ""
    ca_key_file: ""
    create_integration_tables: true
    integration_tables_host: ""
    allow_parallel: false
    complete_resumable_after_restart: true
ftp:
    address: ""
    timeout: 2m
    username: ""
    password: ""
    tls: false
    skip_tls_verify: false
    path: ""
    object_disk_path: ""
    compression_format: tar
    compression_level: 1
    concurrency: 9
    debug: false
sftp:
    address: ""
    port: 22
    username: ""
    password: ""
    key: ""
    path: ""
    object_disk_path: ""
    compression_format: tar
    compression_level: 1
    concurrency: 9
    debug: false
azblob:
    endpoint_schema: https
    endpoint_suffix: core.windows.net
    account_name: ""
    account_key: ""
    sas: ""
    use_managed_identity: false
    container: ""
    path: ""
    object_disk_path: ""
    compression_level: 1
    compression_format: tar
    sse_key: ""
    buffer_size: 0
    buffer_count: 3
    max_parts_count: 256
    timeout: 4h
custom:
    upload_command: ""
    download_command: ""
    list_command: ""
    delete_command: ""
    command_timeout: 4h
    commandtimeoutduration: 4h0m0s
@Slach
Copy link
Collaborator

Slach commented Feb 6, 2024

2024/02/06 08:35:00.620462 error metrics.ExecuteWithMetrics(create_remote) return error: one of createBackupLocal go-routine return error: can't freeze table: code: 27, │

This is a trimmed error message, could you share the full error message?
turn on wrap lines in your log viewer

@Slach
Copy link
Collaborator

Slach commented Feb 6, 2024

when you store data to backup?

Could you check is backuped data still present on remote storage?

aws s3 ls s3://ipp-clickhouse-lab/job-backup-eks/chi-shard-backup/restored_backup_name
aws s3 ls s3://ipp-clickhouse-lab/ob-tiered-backup/{cluster}/{shard}/restored_backup_name

@hueiyuan
Copy link
Author

hueiyuan commented Feb 6, 2024

@Slach but we have wrapped line in our log viewer. Just these information.

Screenshot 2024-02-06 at 5 04 48 PM

@hueiyuan
Copy link
Author

hueiyuan commented Feb 6, 2024

when you store data to backup?

In general, backup mechanism should prevent data loss or another chaos problems occur. So we emulate if need to restore data to clickhouse server pod from s3. And once restore completed, we will start to ingest the new data and start backup. And in this step, can not execute backup(create_remote).

Could you check is backuped data still present on remote storage?

@Slach We have checked it, these backup data are still present on remote storage.

@hueiyuan
Copy link
Author

hueiyuan commented Feb 6, 2024

if we also click house-server have the below error message

DB::ParsingException::ParsingException<String&>(int, FormatStringHelperImpl<std::type_identity<String&>::type>, String&) @ 0x000000000c6755ad in /usr/bin/clickhouse
2024.02.06 08:36:05.519315 [ 47 ] {a76a9cc7-97b1-4d1f-9ccb-ec309d730472} <Error> TCPHandler: Code: 27. DB::ParsingException: Cannot parse input: expected '\t' before: 'chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds1r0\ndefault\n566173c4-3697-4709-b1dd-78cc55a77075\n'. (CANNOT_PARSE_INPUT_ASSERTION_FAILED), Stack trace (when copying this message, always include the lines below):
1. DB::ParsingException::ParsingException<String&>(int, FormatStringHelperImpl<std::type_identity<String&>::type>, String&) @ 0x000000000c6755ad in /usr/bin/clickhouse
2024.02.06 08:36:09.432015 [ 47 ] {78096c75-ca2c-4da7-b855-f88ce04b4b63} <Error> DiskObjectStorageTransaction: An error occurred while executing transaction's operation #0 (PureMetadataObjectStorageOperation): Code: 27. DB::ParsingException: Cannot parse input: expected '\t' before: 'chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds1r0\ndefault\n3462309a-c4da-40d6-b70e-712b82f42c43\n'. (CANNOT_PARSE_INPUT_ASSERTION_FAILED), Stack trace (when copying this message, always include the lines below):

Do not sure what is the '\t'...

@Slach
Copy link
Collaborator

Slach commented Feb 6, 2024

Could you share results of
grep -C 10 3462309a-c4da-40d6-b70e-712b82f42c4 -r /var/lib/clickhouse/disks/s3_tier_cold/
and
SELECT count(), _part FROM ck_job.otel_trace_lab_ubt GROUP BY _part?

@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach
There result grep command (we use 9f33243d-b7b5-4f13-9f4c-bc6823d96df0 to execute it)

/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012215/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012215/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012215/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012215/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207012415/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1920_1920_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1751_1919_34/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1921_1921_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_902_1750_101/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207013015/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_1922_1922_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207011815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207011815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207011815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207011815/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_901_151/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_0_0_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_0_0_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_0_0_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_0_0_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_5_5_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_5_5_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_5_5_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_5_5_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_4_4_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_4_4_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_4_4_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_4_4_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_2_2_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_2_2_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_2_2_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_2_2_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_1_1_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_1_1_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_1_1_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_1_1_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0
--
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_3_3_0/frozen_metadata.txt-2
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_3_3_0/frozen_metadata.txt-chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_3_3_0/frozen_metadata.txt-default
/var/lib/clickhouse/disks/s3_tier_cold/store/758/758570e7-7b2b-4dd3-9623-f14926889dcf/20240207_3_3_0/frozen_metadata.txt:9f33243d-b7b5-4f13-9f4c-bc6823d96df0

The result for sql command:

┌─count()─┬─_part──────────┐
│   20810 │ 20240207_0_0_0 │
│      16 │ 20240207_2_2_0 │
│       6 │ 20240207_3_3_0 │
│      21 │ 20240207_1_1_0 │
└─────────┴────────────────┘

And our table engine is ReplicatedMergeTree, 3 shards 2 replicas on k8s.
Especially, watch command only failed after restore data command...

@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach
We have tried some experiment. We found if data is stored on hot disk (not expired by ttl, inner 1 hour), and restore and execute watch command is normal.

But once expired ttl(previous 1 hour) and stored on s3. When we restore and execute watch command. Original issues problem occur again. Does s3 tier disk not support backup restore after ttl move to s3?

@Slach
Copy link
Collaborator

Slach commented Feb 7, 2024

You need just to delete frozen-metadata.txt

ClickHouse/ClickHouse#58247

new versions of clickhouse-backup will just ignore this file
upgrade clickhouse-backup to 2.4.28

@Slach Slach closed this as completed Feb 7, 2024
@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach 2.4.28 is released? the latest release version on GitHub repo is 2.4.27

@Slach
Copy link
Collaborator

Slach commented Feb 7, 2024

2.4.27 also contain ignoring fronzen-metadata.txt

@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach But we originally just use 2.4.27.... Can refer to this issue description
#826 (comment)

@Slach Slach reopened this Feb 7, 2024
@Slach Slach changed the title Can not watch(create_remote) after restore data from s3 can't ALTER TABLE ... FREEZE ... after successfully restore, frozen-metadata.txt present Feb 7, 2024
@Slach
Copy link
Collaborator

Slach commented Feb 7, 2024

for successfull ALTER TABLE ...FREZZE during create remote please remove frozen-metadata.txt* in
something like
find /var/lib/clickhouse/disks/s3_tier_cold/ -name frozen-metadata*.* -delete

@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach
we have upgrade 2.4.28 still have this problem.
And after execute this command find /var/lib/clickhouse/disks/s3_tier_cold/ -name frozen-metadata*.* -delete, we still have the problem during watch command (create_remote)...

Screenshot 2024-02-07 at 3 27 00 PM

@Slach
Copy link
Collaborator

Slach commented Feb 7, 2024

are you sure you deleted all frozen-metadata*.* files?

what return?

find /var/lib/clickhouse/disks/s3_tier_cold/ -name frozen-metadata*.*

@Slach Slach self-assigned this Feb 7, 2024
@Slach Slach added this to the 2.4.29 milestone Feb 7, 2024
@Slach Slach closed this as completed in 78ae58d Feb 7, 2024
@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

what return?

@Slach This command returns null response.

root@chi-ck-job-v1-ck-job-v1-s0r0-0:/var/lib/clickhouse/disks/s3_tier_cold# cd /var/lib/clickhouse/disks/s3_tier_cold/
root@chi-ck-job-v1-ck-job-v1-s0r0-0:/var/lib/clickhouse/disks/s3_tier_cold#

Should I upgrade to 2.4.29 to double check it whether is solved?

@Slach
Copy link
Collaborator

Slach commented Feb 7, 2024

what return
find /var/lib/clickhouse/disks/s3_tier_cold/ | grep frozen ?

what return

ALTER TABLE  table=ck_job.otel_trace_lab_ubt FREEZE WITH NAME 'test_freeze';
ALTER TABLE  table=ck_job.otel_trace_lab_ubt UNFREEZE WITH NAME 'test_freeze';

?

2.4.29 is not released yet, only docker image

@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach
All of return following your suggestion is below:

what return
The result of find /var/lib/clickhouse/disks/s3_tier_cold/ | grep frozen

/var/lib/clickhouse/disks/s3_tier_cold/store/219/219ee73a-3e6c-402a-9fb2-fed47fc98221/all_4_4_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/store/ba2/ba2867df-6602-4baf-9e6c-08f5be8d8505/20240207_0_0_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/store/a6e/a6e2f96d-97f9-4976-b660-9b06bb9aafdb/20240207_0_0_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_606_606_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_605_605_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_579_604_5/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_578_132/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_0_602_388/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_603_603_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_606_606_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_604_604_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071129/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_605_605_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_606_606_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_605_605_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_579_604_5/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab/s3_tier_cold/20240207_0_578_132/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab_ubt/s3_tier_cold/20240207_0_606_121/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_0_602_388/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_603_603_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_606_606_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_604_604_0/frozen_metadata.txt
/var/lib/clickhouse/disks/s3_tier_cold/backup/shardshard0-increment-20240207071329/shadow/ck_job/otel_trace_lab_trace_id_ts/s3_tier_cold/all_605_605_0/frozen_metadata.txt

The return of ALTER TABLE ck_job.otel_trace_lab_ubt FREEZE WITH NAME 'test_freeze';

ALTER TABLE ck_job.otel_trace_lab_ubt
    FREEZE WITH NAME 'test_freeze'

Query id: 1f659712-1d0c-4704-93e7-9dfc842ef360


0 rows in set. Elapsed: 0.004 sec.

Received exception from server (version 23.8.9):
Code: 27. DB::Exception: Received from localhost:9000. DB::ParsingException. DB::ParsingException: Cannot parse input: expected '\t' before: 'chi%2Dck%2Djob%2Dv1%2Dck%2Djob%2Dv1%2Ds0r0\ndefault\na6e2f96d-97f9-4976-b660-9b06bb9aafdb\n'. (CANNOT_PARSE_INPUT_ASSERTION_FAILED)

The return of ALTER TABLE ck_job.otel_trace_lab_ubt UNFREEZE WITH NAME 'test_freeze';

ALTER TABLE ck_job.otel_trace_lab_ubt
    UNFREEZE WITH NAME 'test_freeze'

Query id: 77de8031-0b32-4a13-803c-729e79316dbf

Ok.

0 rows in set. Elapsed: 0.001 sec.

@Slach
Copy link
Collaborator

Slach commented Feb 7, 2024

you didn't delete frozen_metadata.txt
delete it
and try to FREEZE / UNFREEZE again

@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach
Great! That's work! (Execute cli: find /var/lib/clickhouse/disks/s3_tier_cold -name frozen_metadata*.* -delete )
I found that original find command is frozen-metadata.txt instead of frozen_metadata.txt (it's underline instead of dash), so indeed delete it clearly after modify name.
After delete it, the watch command is work.

So I would like to confirm something. When we execute restore command, and clickhouse would freeze table, right?
And this is the reason why we just need to delete these frozen files.

And v2.4.29 will includes this feature? we are worried about these operator too manual so that easily operation error.

@Slach
Copy link
Collaborator

Slach commented Feb 7, 2024

2.4.29 will include fixes for create / upload / download / restore commands to allow ignore frozen_metadata, unfortunatelly we can't affect exists unproperly restored data, and it shall be fixed manually

@Slach Slach reopened this Feb 7, 2024
@hueiyuan
Copy link
Author

hueiyuan commented Feb 7, 2024

@Slach
Thanks for your answer.
I have a question to check it.
To be honest, I am not sure the objective about frozen_metadata.txt. Hope you can share it let me understand it.

@Slach Slach closed this as completed in a06afa8 Feb 9, 2024
@Slach
Copy link
Collaborator

Slach commented Feb 9, 2024

So I would like to confirm something. When we execute restore command, and clickhouse would freeze table, right?

when we create backup then clickhouse-server create frozen-metadata.txt
which we uploaded to remote storage

during restore we download it
and attach downloaded data sucessfully

but after it FREEZE command inside watch stop work

2.4.29 will ignore frozen_metadata during create / upload / download and restore

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