Summary
restore_remote fails when --restore-database-mapping is used together with multiple comma-separated tables in --tables.
A single table restore works, but the same command with two tables fails after schema restore.
Command
clickhouse-backup restore_remote \
--schema \
--data \
--tables=dwh.events,dwh.events_invalid \
--restore-database-mapping=dwh:sandbox_tagafonov \
incremental-2026-06-12
Observed Behavior
The restore starts and schema restore creates the target tables, then data restore fails:
RestoreData: restoreData: 'sandbox_tagafonov.events', 'sandbox_tagafonov.events_invalid' is not created. Restore schema first or create missing tables manually
Relevant log sequence:
/backup/actions call: restore_remote --schema --data --tables=dwh.events,dwh.events_invalid --restore-database-mapping=dwh:sandbox_tagafonov incremental-2026-06-12
CREATE DATABASE IF NOT EXISTS `sandbox_tagafonov` ...
CREATE TABLE sandbox_tagafonov.events ...
CREATE TABLE sandbox_tagafonov.events_invalid ...
done, backup=incremental-2026-06-12, operation=restore_schema
found 2 tables with data in backup
RestoreData: restoreData: 'sandbox_tagafonov.events', 'sandbox_tagafonov.events_invalid' is not created. Restore schema first or create missing tables manually
Debug logs show the existence check uses this generated pattern:
match(concat(database,'.',name),'^sandbox_tagafonov\..*sandbox_tagafonov\..*$')
That pattern cannot match real target tables such as:
sandbox_tagafonov.events
sandbox_tagafonov.events_invalid
Expected Behavior
The data restore phase should find the tables created by the schema restore phase and continue restoring data.
Expected matching pattern should be equivalent to:
sandbox_tagafonov.events,sandbox_tagafonov.events_invalid
or:
Workarounds
Both of these work:
# Single table restore
clickhouse-backup restore_remote --schema --data --tables=dwh.events --restore-database-mapping=dwh:sandbox_tagafonov incremental-2026-06-12
# Wildcard table pattern
clickhouse-backup restore_remote --schema --data --tables=dwh.* --restore-database-mapping=dwh:sandbox_tagafonov incremental-2026-06-12
Regression Range
I checked tags using GitHub compare:
- Latest known OK:
v2.6.39
- First known bad:
v2.6.40
- Also affected:
v2.7.2
Likely introduced by:
d03d5155fb747773109844e9010a155d3fd28d39
- d03d515
The suspicious function is changeTablePatternFromRestoreMapping().
Environment
clickhouse-backup: 2.7.2
- Command path: API integration table /
/backup/actions
- ClickHouse version:
25.8
Summary
restore_remotefails when--restore-database-mappingis used together with multiple comma-separated tables in--tables.A single table restore works, but the same command with two tables fails after schema restore.
Command
Observed Behavior
The restore starts and schema restore creates the target tables, then data restore fails:
Relevant log sequence:
Debug logs show the existence check uses this generated pattern:
That pattern cannot match real target tables such as:
Expected Behavior
The data restore phase should find the tables created by the schema restore phase and continue restoring data.
Expected matching pattern should be equivalent to:
or:
Workarounds
Both of these work:
# Single table restore clickhouse-backup restore_remote --schema --data --tables=dwh.events --restore-database-mapping=dwh:sandbox_tagafonov incremental-2026-06-12Regression Range
I checked tags using GitHub compare:
v2.6.39v2.6.40v2.7.2Likely introduced by:
d03d5155fb747773109844e9010a155d3fd28d39The suspicious function is
changeTablePatternFromRestoreMapping().Environment
clickhouse-backup:2.7.2/backup/actions25.8