Skip to content

Commit 7bc5275

Browse files
authored
clickhouse: configure backup directory. (#9277)
ClickHouse doesn't allow us to capture backups unless a backup directory is configured, and we can't configure a backup directory without restarting ClickHouse. To support backup collection for testing purposes, and in case we wind up needing to use backups during production operations, configure a ClickHouse backup directory via clickhouse-admin.
1 parent 399ab8a commit 7bc5275

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

clickhouse-admin/types/src/config.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ impl ReplicaConfig {
102102
let user_files_path = data_path.clone().join("user_files");
103103
let temp_files_path = data_path.clone().join("tmp");
104104
let format_schema_path = data_path.clone().join("format_schemas");
105+
let backup_path = data_path.clone().join("backup");
105106
format!(
106107
"<!-- generation:{generation} -->
107108
<clickhouse>
@@ -204,9 +205,13 @@ impl ReplicaConfig {
204205
205206
<!-- Controls how many tasks could be in the queue -->
206207
<max_tasks_in_queue>1000</max_tasks_in_queue>
207-
</distributed_ddl>
208+
</distributed_ddl>
208209
209-
<merge_tree>
210+
<backups>
211+
<allowed_path>{backup_path}</allowed_path>
212+
</backups>
213+
214+
<merge_tree>
210215
<!-- Disable sparse column serialization, which we expect to not need -->
211216
<ratio_of_defaults_for_sparse_serialization>1.0</ratio_of_defaults_for_sparse_serialization>
212217

clickhouse-admin/types/testutils/replica-server-config.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,13 @@
107107

108108
<!-- Controls how many tasks could be in the queue -->
109109
<max_tasks_in_queue>1000</max_tasks_in_queue>
110-
</distributed_ddl>
110+
</distributed_ddl>
111111

112-
<merge_tree>
112+
<backups>
113+
<allowed_path>./data/backup</allowed_path>
114+
</backups>
115+
116+
<merge_tree>
113117
<!-- Disable sparse column serialization, which we expect to not need -->
114118
<ratio_of_defaults_for_sparse_serialization>1.0</ratio_of_defaults_for_sparse_serialization>
115119

0 commit comments

Comments
 (0)