Altinity / clickhouse-backup

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

I have clickhouse cluster with 2 shard 1 replicated, when i run clickhouse-backup has error #253

Closed cntsp closed 3 years ago

cntsp commented 3 years ago

./clickhouse-backup --config config.yml create tables 2021/08/31 03:28:42 error cat't get tables from clickhouse: code: 999, message: Session expired (Session expired): While executing Tables

The clickhouse cluster has 3 clickhouse instances of docker deploying(shard1 \shard2\replicated1), the some tables engine of is distributed. about the parts configuration of the cluster's config.xml

image

Slach commented 3 years ago

could you share LOG_LEVEL=debug ./clickhouse-backup --config config.yml create test_backup result?

cntsp commented 3 years ago

LOG_LEVEL=debug ./clickhouse-backup --config config.yml tables 2021/08/31 07:21:37 debug SELECT count() FROM system.settings WHERE name = 'show_table_uuid_in_table_create_query_if_not_nil' 2021/08/31 07:21:37 debug SELECT * FROM system.tables WHERE is_temporary = 0 SETTINGS show_table_uuid_in_table_create_query_if_not_nil=1 2021/08/31 07:21:37 error can't get tables: code: 999, message: Session expired (Session expired): While executing Tables

image

Slach commented 3 years ago

could you share the results of

SELECT name, engine FROM system.databases WHERE name !='system'

?

Slach commented 3 years ago

also, could you try to use alexakulov/clickouse-backup:master docker image instead of standalone binary?

cntsp commented 3 years ago

image

Slach commented 3 years ago

is SELECT * FROM system.tables WHERE is_temporary = 0 SETTINGS show_table_uuid_in_table_create_query_if_not_nil=1 works from clickhouse-client ?

cntsp commented 3 years ago

dev8 :) SELECT * FROM system.tables WHERE is_temporary = 0 SETTINGS show_table_uuid_in_table_create_query_if_not_nil=1

SELECT * FROM system.tables WHERE is_temporary = 0 SETTINGS show_table_uuid_in_table_create_query_if_not_nil = 1

Query id: 19c8ec72-eb87-4773-b56f-2a734440fc4b

Received exception from server (version 20.11.4): Code: 999. DB::Exception: Received from localhost:9000. DB::Exception: Session expired (Session expired): While executing Tables.

0 rows in set. Elapsed: 0.406 sec.

Slach commented 3 years ago

let's try to execute

SELECT engine, name FROM system.tables WHERE engine NOT LIKE  '%MergeTree' AND is_temporary = 0
cntsp commented 3 years ago

Excuse me, I need to make some marks! image image

Slach commented 3 years ago

ok. let's try to do something like this to detect which table is root cause of error:

clickhouse-client -mn --echo <$( clickhouse-client -q "SELECT concat('SELECT * FROM system.tables WHERE name=\\'',name,'\\' AND is_temporary = 0 SETTINGS show_table_uuid_in_table_create_query_if_not_nil=1') FROM system.tables WHERE is_temporary = 0 " )
cntsp commented 3 years ago

Sorry, I need to make some marks! image

cntsp commented 3 years ago

sh: 2: cannot open SELECT * FROM system.tables WHERE name=\'.inner.daf2_local_batch\' AND is_temporary = 0 SETTINGS show_table_uuid_in_table_create_query_if_not_nil=1 Is the table .inner.daf2_local_batch root cause of error?

Slach commented 3 years ago

no, I don't think so ;) sorry for a little bit bash misleads try to run

clickhouse-client -q "SELECT concat('SELECT * FROM system.tables WHERE database=',char(0x27),database,char(0x27),' AND name=',char(0x27),name,char(0x27),' AND is_temporary = 0 SETTINGS show_table_uuid_in_table_create_query_if_not_nil=1 FORMAT Vertical;') FROM system.tables WHERE is_temporary = 0 FORMAT TSVRaw" | clickhouse-client -mn --echo

and share the results

Slach commented 3 years ago

@cntsp is the issue still relevant for you? Did you try the latest releases 1.1.0+?

Let's close issue, during inactivity, feel free to reopen if necessary