v.23.8Improvement

Added Setting to Ignore Directory Exists Error During Database Replication

Added a setting allow_moving_table_directory_to_trash that allows to ignore Directory for table data already exists error when replicating/recovering a Replicated database. #53425 (Alexander Tokmakov).
Added a new setting allow_moving_table_directory_to_trash that suppresses the Directory for table data already exists error during replication or recovery of Replicated databases in ClickHouse.

Why it matters

This feature addresses the issue where the replication or recovery process fails due to pre-existing table data directories, which causes an error. By enabling this setting, users can allow the system to ignore this conflict, improving robustness and reducing manual intervention during replication or recovery of replicated tables.

How to use it

To enable this feature, set the allow_moving_table_directory_to_trash setting to true in the ClickHouse server configuration or session settings. For example:

SET allow_moving_table_directory_to_trash = 1


This will allow replication and recovery to continue even if a table data directory already exists by moving it to trash rather than raising an error.