Closed dxygit1 closed 6 months ago
I deleted the storage directory and restarted ClickHouse, but I still encountered an error.
curl "chi-clickhouse-cluster-dtstack-1-0:7171/backup/status"
{"command":"restore --rm shard1-increment-20240408050855","status":"error","start":"2024-04-09 06:36:04","finish":"2024-04-09 06:36:10","error":"can't create table `local_1`.`proc_stat_metrics`: code: 57, message: Directory for table data store/72b/72b5f6fe-0721-4c58-aac0-e5598e194e56/ already exists after 44 times, please check your schema dependencies"}
2024/04/09 06:40:20.991523 info CREATE TABLE local_1.proc_stat_metrics UUID '72b5f6fe-0721-4c58-aac0-e5598e194e56' (`_tenant_id_` Float64, `pid` Float64, `__instance_id__` LowCardinality(String), `_mode_` String, `mem_percent` Float64, `_at_date_` Date, `cmdline` String, `iowrite_bytes` Float64, `_receive_timestamp_` DateTime64(3, 'UTC'), `_custom_tags_` String, `page_faults_children_minor_faults` Float64, `ioread_bytes` Float64, `cpu_percent` Float64, `page_faults_children_major_faults` Float64, `open_file_descriptors` Float64, `run_time` Float64, `__appname__` LowCardinality(String), `mem_rss` Float64, `__source__` LowCardinality(String), `cpu_normalized_pct` Float64, `threads` Float64, `involuntary_ctx_switches` Float64, `__ci_resource__` LowCardinality(String), `mem_real` Float64, `__process_name__` LowCardinality(String), `__ip__` LowCardinality(String), `page_faults_major_faults` Float64, `ioread_count` Float64, `iowrite_count` Float64, `__instance_name__` LowCardinality(String), `page_faults_minor_faults` Float64, `_alias_` String, `name` String, `_at_timestamp_` DateTime64(3, 'UTC'), `voluntary_ctx_switches` Float64, `_tag_set_` Array(String), `__catalog__` LowCardinality(String), `_field_set_` Array(String), `status` String, `username` String, `mem_vms` Float64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/1/proc_stat_metrics/2024-04-08/{shard}/hits', '{replica}') PARTITION BY toString(_at_date_) ORDER BY (_at_date_, _at_timestamp_, intHash64(toInt64(toDateTime(_at_timestamp_)))) SAMPLE BY intHash64(toInt64(toDateTime(_at_timestamp_))) SETTINGS index_granularity = 8192 logger=clickhouse
2024/04/09 06:40:20.993446 info clickhouse connection closed logger=clickhouse
2024/04/09 06:40:20.993472 error metrics.ExecuteWithMetrics(restore) return error: can't create table `local_1`.`proc_stat_metrics`: code: 57, message: Directory for table data store/72b/72b5f6fe-0721-4c58-aac0-e5598e194e56/ already exists after 44 times, please check your schema dependencies logger=metrics
2024/04/09 06:40:20.993508 debug api.status.stop -> status.commands[5] == {ActionRowStatus:{Command:restore --rm shard1-increment-20240408050855 Status:error Start:2024-04-09 06:40:20 Finish:2024-04-09 06:40:20 Error:can't create table `local_1`.`proc_stat_metrics`: code: 57, message: Directory for table data store/72b/72b5f6fe-0721-4c58-aac0-e5598e194e56/ already exists after 44 times, please check your schema dependencies} Ctx:<nil> Cancel:<nil>} logger=status
2024/04/09 06:40:20.993540 error API /backup/restore error: can't create table `local_1`.`proc_stat_metrics`: code: 57, message: Directory for table data store/72b/72b5f6fe-0721-4c58-aac0-e5598e194e56/ already exists after 44 times, please check your schema dependencies logger=server
grep -m 1 -C 50 -i "code: 57" /var/log/clickhouse-server/clickhouse-server.err.log
clickhouse@chi-clickhouse-cluster-dtstack-1-0-0:/$ grep -m 1 -C 50 -i "code: 57" /var/log/clickhouse-server/clickhouse-server.err.log 11. DB::create(DB::StorageFactory::Arguments const&) @ 0x0000000012f55958 in /usr/bin/clickhouse 12. DB::StorageFactory::get(DB::ASTCreateQuery const&, String const&, std::shared_ptr<DB::Context>, std::shared_ptr<DB::Context>, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, bool) const @ 0x000000001268513b in /usr/bin/clickhouse 13. DB::InterpreterCreateQuery::doCreateTable(DB::ASTCreateQuery&, DB::InterpreterCreateQuery::TableProperties const&, std::unique_ptr<DB::DDLGuard, std::default_delete<DB::DDLGuard>>&) @ 0x0000000011d1b91e in /usr/bin/clickhouse 14. DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x0000000011d14d5d in /usr/bin/clickhouse 15. DB::InterpreterCreateQuery::execute() @ 0x0000000011d221c0 in /usr/bin/clickhouse 16. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x00000000122e2d15 in /usr/bin/clickhouse 17. DB::executeQuery(String const&, std::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x00000000122de475 in /usr/bin/clickhouse 18. DB::TCPHandler::runImpl() @ 0x0000000013155799 in /usr/bin/clickhouse 19. DB::TCPHandler::run() @ 0x0000000013167b79 in /usr/bin/clickhouse 20. Poco::Net::TCPServerConnection::start() @ 0x0000000015b5e154 in /usr/bin/clickhouse 21. Poco::Net::TCPServerDispatcher::run() @ 0x0000000015b5f351 in /usr/bin/clickhouse 22. Poco::PooledThread::run() @ 0x0000000015c95b87 in /usr/bin/clickhouse 23. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000015c93e5c in /usr/bin/clickhouse 24. ? @ 0x00007f41f0328609 in ? 25. ? @ 0x00007f41f024d353 in ?
2024.04.09 06:36:09.239587 [ 304 ] {d244a429-507e-4c0b-bc14-e7224485c684}
Cannot print extra info for Poco::Exception (version 23.8.8.21.altinitystable (altinity build))
2024.04.09 06:36:09.307656 [ 304 ] {6f12932c-35cf-470b-9e0a-328b42d7c91a} __appname__
LowCardinality(String), __source__
LowCardinality(String), _tenant_id_
Float64, _message_
String, _mode_
String, __path__
LowCardinality(String), __ip__
LowCardinality(String), _collect_time_
Float64, _at_date_
Date, __hostname__
LowCardinality(String), _receive_timestamp_
DateTime64(3, 'UTC'), _custom_tags_
String, _at_timestamp_
DateTime64(3, 'UTC'), _tag_set_
Array(String), _context_seq_
Float64, _field_set_
Array(String)) ENGINE = ReplicatedMergeTree('/clickhouse/tables/1/test/2024-04-08/{shard}/hits', '{replica}') PARTITION BY toString(_atdate) ORDER BY (_atdate, _attimestamp, intHash64(toInt64(toDateTime(_attimestamp)))) SAMPLE BY intHash64(toInt64(toDateTime(_attimestamp))) SETTINGS index_granularity = 8192), Stack trace (when copying this message, always include the lines below):
2024.04.09 06:36:10.176780 [ 304 ] {c27d069e-e20f-46e7-ac79-c1a386f9fa68}
2024.04.09 06:36:10.182710 [ 304 ] {8e74c6fa-8e93-4c7b-921c-2b6d485f09d7} kernel_vmstat__thp_zero_page_alloc
Float64, netstat__tcp_closing
Float64, disk__used_percent
Float64, net__interface
String, processes__paging
Float64, processes__total
Float64, kernel_vmstat__zone_reclaim_failed
Float64, swap__in
Float64, procstat__mem_vms
Float64, kernel_vmstat__numa_foreign
Float64, kernel_vmstat__numa_huge_pte_updates
Float64, kernel_vmstat__pgpgin
Float64, net__bytes_sent
Float64, procstat__pid
Float64, cpu__usage_guest
Float64, cpu__time_guest_nice
Float64, mem__cached
Float64, system__n_users
Float64, cpu__usage_guest_nice
Float64, diskio__name
String, linux_sysctl_fs__aio_nr
Float64, net__bytes_recv_per_sec
Float64, kernel_vmstat__nr_page_table_pages
Float64, kernel_vmstat__unevictable_pgs_stranded
Float64, system__n_cpus
Float64, __hostname__
String, linux_sysctl_fs__inode_nr
Float64, kernel_vmstat__compact_fail
Float64, cpu__time_iowait
Float64, kernel_vmstat__thp_split
Float64, processes__unknown
Float64, kernel_vmstat__balloon_deflate
Float64, system__n_net_cards
Float64, cpu__usage_iowait
Float64, diskio__read_await
Float64, processes__zombies
Float64, system__load5
Float64, _tenant_id_
Float64, _mode_
String, kernel_vmstat__compact_stall
Float64, kernel_vmstat__nr_dirty
Float64, kernel_vmstat__nr_kernel_stack
Float64, kernel_vmstat__nr_anon_pages
Float64, kernel_vmstat__nr_free_pages
Float64, disk__total
Float64, kernel_vmstat__allocstall
Float64, diskio__iops_in_progress
Float64, kernel_vmstat__nr_vmscan_write
Float64, procstat__mem_stack
Float64, procstat__cpu_usage
Float64, kernel_vmstat__pgrefill_normal
Float64, kernel_vmstat__unevictable_pgs_mlocked
Float64, timestamp
String, kernel_vmstat__nr_file_pages
Float64, netstat__tcp_fin_wait1
Float64, procstat__mem_rss
Float64, netstat__tcp_fin_wait2
Float64, kernel_vmstat__pgsteal_direct_dma32
Float64, kernel_vmstat__nr_inactive_file
Float64, kernel__processes_forked
Float64, kernel_vmstat__swap_ra_hit
Float64, kernel_vmstat__nr_anon_transparent_hugepages
Float64, netstat__tcp_listen
Float64, kernel_vmstat__htlb_buddy_alloc_fail
Float64, kernel_vmstat__pgrefill_movable
Float64, system__load1
Float64, processes__running
Float64, kernel_vmstat__pgscan_kswapd_dma32
Float64, mem__buffered
Float64, kernel_vmstat__compact_isolated
Float64, disk__free
Float64, kernel_vmstat__pageoutrun
Float64, kernel_vmstat__pgalloc_movable
Float64, mem__available_percent
Float64, kernel_vmstat__pgscan_direct_normal
Float64, procstat__mem_swap
Float64, kernel_vmstat__nr_shmem
Float64, kernel_vmstat__pgfault
Float64, __instance_id__
LowCardinality(String), kernel_vmstat__pgscan_direct_dma
Float64, _custom_tags
String, kernel_vmstat__kswapd_inodesteal
Float64, cpu__time_softirq
Float64, disk__inodes_total
Float64, kernel_vmstat__pgscan_kswapd_movable
Float64, kernel_vmstat__workingset_refault
Float64, procstat__mem_data
Float64, kernel_vmstat__nr_isolated_file
Float64, linux_sysctl_fs__aio_max_nr
Float64, diskio__write_time
Float64, linux_sysctl_fs__inode_free_nr
Float64, swap__used_percent
Float64, cpu__time_steal
Float64, netstat__tcp_syn_sent
Float64, kernel_vmstat__kswapd_high_wmark_hit_quickly
Float64, kernel_vmstat__pgmigrate_success
Float64, mem__total
Float64, kernel_vmstat__pglazyfreed
Float64, linux_sysctl_fs__dentry_want_pages
Float64, cpu__usage_idle
Float64, cpu__usage_user
Float64, __ip__
String, kernel_vmstat__pgscan_direct_dma32
Float64, kernel_vmstat__unevictable_pgs_culled
Float64, kernel_vmstat__thp_fault_fallback
Float64, kernel_vmstat__pgsteal_kswapd_dma32
Float64, kernel_vmstat__workingset_activate
Float64, kernel_vmstat__thp_collapse_alloc
Float64, cpu__time_irq
Float64, kernel_vmstat__drop_slab
Float64, kernel_vmstat__balloon_migrate
Float64, system__n_disks
Float64, kernel_vmstat__nr_written
Float64, kernel_vmstat__nr_dirty_threshold
Float64, kernel_vmstat__pgsteal_kswapd_dma
Float64, kernel_vmstat__pgsteal_kswapd_normal
Float64, kernel_vmstat__slabs_scanned
Float64, procstat__mem_locked
Float64, diskio__writes
Float64, diskio__write_bytes_per_sec
Float64, netstat__tcp_time_wait
Float64, cpu__usage_irq
Float64, kernel_vmstat__nr_slab_reclaimable
Float64, disk__inodes_used
Float64, kernel_vmstat__numa_interleave
Float64, _receive_timestamp_
DateTime64(3, 'UTC'), kernel_vmstat__pgmigrate_fail
Float64, _custom_tags_
String, kernel_vmstat__unevictable_pgs_scanned
Float64, diskio__await
Float64, net__drop_out
Float64, kernel_vmstat__nr_unstable
Float64, kernel_vmstat__nr_vmscan_immediate_reclaim
Float64, kernel__boot_time
Float64, kernel_vmstat__pgrotated
Float64, mem__free
Float64, netstat__tcp_last_ack
Float64, kernel_vmstat__pgmajfault
Float64, diskio__io_time
Float64, processes__blocked
Float64, cpu__time_guest
Float64, procstat__write_count
Float64, kernel_vmstat__nr_dirty_background_threshold
Float64, kernel_vmstat__htlb_buddy_alloc_success
Float64, kernel_vmstat__pgalloc_normal
Float64, procstat__process_name
String, kernel_vmstat__swap_ra
Float64, _tag_set_
Array(String), swap__free
Float64, kernel_vmstat__pgfree
Float64, swap__total
Float64, kernel_vmstat__numa_pte_updates
Float64, kernel_vmstat__nr_writeback
Float64, net__err_out
Float64, net__drop_in
Float64, kernel_vmstat__compact_success
Float64, kernel_vmstat__pgdeactivate
Float64, _at_date_
Date, procstat__status
Float64, kernel_vmstat__nr_unevictable
Float64, cpu__usage_cpu
String, netstat__tcp_established
Float64, kernel_vmstat__pgscan_kswapd_normal
Float64, kernel_vmstat__nr_active_file
Float64, mem__active
Float64, kernel_vmstat__pgscan_direct_throttle
Float64, kernel_vmstat__pgsteal_direct_movable
Float64, _metrics_type_
String, netstat__udp_socket
Float64, diskio__merged_read_count_per_sec
Float64, diskio__reads_per_sec
Float64, kernel__context_switches
Float64, kernel_vmstat__nr_inactive_anon
Float64, net__packets_sent
Float64, netstat__tcp_close_wait
Float64, system__load15
Float64, kernel_vmstat__numa_miss
Float64, kernel__interrupts
Float64, diskio__read_bytes_per_sec
Float64, kernel_vmstat__nr_alloc_batch
Float64, kernel_vmstat__pgalloc_dma32
Float64, mem__used
Float64, _field_set_
Array(String), kernel_vmstat__pgrefill_dma
Float64, diskio__read_bytes
Float64, kernel_vmstat__kswapd_low_wmark_hit_quickly
Float64, procstat__write_bytes
Float64, mem__used_percent
Float64, disk__path
String, linux_sysctl_fs__dentry_age_limit
Float64, netstat__tcp_syn_recv
Float64, kernel_vmstat__compact_migrate_scanned
Float64, kernel_vmstat__pgsteal_kswapd_movable
Float64, kernel_vmstat__nr_bounce
Float64, cpu__usage_nice
Float64, kernel_vmstat__nr_free_cma
Float64, kernel_vmstat__thp_zero_page_alloc_failed
Float64, disk__inodes_fress
Float64, kernel_vmstat__pgalloc_dma
Float64, disk__fstype
String, kernel_vmstat__pgscan_kswapd_dma
Float64, linux_sysctl_fs__file_max
Float64, kernel_vmstat__pgscan_direct_movable
Float64, diskio__read_time
Float64, net__packets_recv
Float64, diskio__writes_per_sec
Float64, processes__total_threads
Float64, cpu__usage_system
Float64, procstat__read_bytes
Float64, kernel_vmstat__pgrefill_dma32
Float64, kernel_vmstat__thp_fault_alloc
Float64, cpu__time_cpu
String, cpu__usage_steal
Float64, kernel_vmstat__nr_mapped
Float64, kernel_vmstat__unevictable_pgs_rescued
Float64, linux_sysctl_fs__file_nr
Float64, kernel_vmstat__nr_mlock
Float64, diskio__write_bytes
Float64, net__hw_addr
String, kernel_vmstat__nr_dirtied
Float64, kernel_vmstat__unevictable_pgs_munlocked
Float64, diskio__write_await
Float64, cpu__time_nice
Float64, swap__out
Float64, swap__used
Float64, diskio__merged_write_count_per_sec
Float64, netstat__tcp_close
Float64, linux_sysctl_fs__dentry_unused_nr
Float64, system__n_services
Float64, kernel_vmstat__numa_hint_faults_local
Float64, __appname__
String, diskio__merged_read_count
Float64, __source__
String, processes__stopped
Float64, linux_sysctl_fs__dentry_nr
Float64, net__err_in
Float64, kernel_vmstat__pswpin
Float64, kernel_vmstat__drop_pagecache
Float64, __instance_name__
LowCardinality(String), diskio__merged_write_count
Float64, _at_timestamp_
DateTime64(3, 'UTC'), mem__inactive
Float64, net__bytes_sent_per_sec
Float64, kernel_vmstat__pgsteal_direct_dma
Float64, kernel_vmstat__pswpout
Float64, net__bytes_recv
Float64, kernel_vmstat__numa_pages_migrated
Float64, disk__used
Float64, netstat__tcp_none
Float64, kernel_vmstat__workingset_nodereclaim
Float64, kernel_vmstat__balloon_inflate
Float64, cpu__time_system
Float64, procstat__read_count
Float64, mem__available
Float64, kernel_vmstat__numa_other
Float64, diskio__io_util
Float64, kernel_vmstat__pgpgout
Float64, system__uptime
Float64, processes__sleeping
Float64, kernel_vmstat__nr_active_anon
Float64, kernel_vmstat__numa_hint_faults
Float64, cpu__time_user
Float64, kernel_vmstat__pginodesteal
Float64, cpu__usage_softirq
Float64, processes__dead
Float64, disk__device
String, kernel_vmstat__nr_writeback_temp
Float64, kernel_vmstat__nr_isolated_anon
Float64, system__uptime_format
String, diskio__reads
Float64, kernel_vmstat__nr_slab_unreclaimable
Float64, kernel_vmstat__pgsteal_direct_normal
Float64, kernel_vmstat__numa_local
Float64, cpu__time_idle
Float64, kernel_vmstat__numa_hit
Float64, kernel_vmstat__compact_free_scanned
Float64, net__packets_sent_per_sec
Float64, kernel_vmstat__pgactivate
Float64, kernel_vmstat__thp_collapse_alloc_failed
Float64, linux_sysctl_fs__inode_preshrink_nr
Float64, kernel_vmstat__unevictable_pgs_cleared
Float64, net__packets_recv_per_sec
Float64, __path__
LowCardinality(String), __device__
LowCardinality(String), __fstype__
LowCardinality(String), __name__
LowCardinality(String), __interface__
LowCardinality(String), system__platform
String, system__platform_family
String, system__os
String, system__platform_version
String, system__kernel_arch
String, system__kernel_version
String, cpu__usage_busy
Float64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/1/system_metrics/2024-04-08/{shard}/hits', '{replica}') PARTITION BY toString(_atdate) ORDER BY (_atdate, _attimestamp, intHash64(toInt64(toDateTime(_attimestamp)))) SAMPLE BY intHash64(toInt64(toDateTime(_attimestamp))) SETTINGS index_granularity = 8192), Stack trace (when copying this message, always include the lines below):
Could it be because I restored a distributed table referencing a local table first, causing the local table to be affected during the restoration?
could you share
grep "72b5f6fe-0721-4c58-aac0-e5598e194e56" -r /var/lib/clickhouse/backup/shard1-increment-20240408050855/metadata/
Could it be because I restored a distributed table referencing a local table first, causing the local table to be affected during the restoration?
no,
it looks like data was not dropped as expected.
but you shared screenshot where executed DROP DATABASE local_1 SYNC
this operation shall delete physical all /var/lib/clikhouse/store/XXX/XXXXX directories which relaed to tables which present in local_1
database
according to shared screenshots did you deleted database on -0-0-0
but try to restore on -0-1-0 node?
Yesterday, I tried restoring local_1 first, and then restoring others had no issues. I'll retest it again. Thanks.
ok. close issue, feel free reopen if reproduce again
When I deleted the database and restarted ClickHouse, I encountered an error during rollback, indicating that the path exists.