Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
wyxxxcat committed Feb 13, 2025
1 parent 65b9daf commit 69419d1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ Restoration operation attributes, the format is `<key>` = `<value>`,currently
- "timeout" = "3600": The task timeout period, the default is one day. in seconds.
- "meta_version" = 40: Use the specified meta_version to read the previously backed up metadata. Note that this parameter is used as a temporary solution and is only used to restore the data backed up by the old version of Doris. The latest version of the backup data already contains the meta version, no need to specify it.
- "clean_tables" : Indicates whether to clean up tables that do not belong to the restore target. For example, if the target db before the restore has tables that are not present in the snapshot, specifying `clean_tables` can drop these extra tables and move them into the recycle bin during the restore.
- This feature is supported since the Apache Doris 1.2.6 version
- This feature is supported since the Apache Doris 2.1.6 version
- "clean_partitions": Indicates whether to clean up partitions that do not belong to the restore target. For example, if the target table before the restore has partitions that are not present in the snapshot, specifying `clean_partitions` can drop these extra partitions and move them into the recycle bin during the restore.
- This feature is supported since the Apache Doris 1.2.6 version
- This feature is supported since the Apache Doris 2.1.6 version
- atomic_restore - : The data will be loaded into a temporary table first, and then the original table will be replaced atomically to ensure that the read and write of the target table are not affected during the recovery process.
- "force_replace" : Force replace when the table exists and the schema is different with the backup table.
- Note that to enable `force_replace`, you must enable `atomic_restore`

## Optional Parameters

Expand Down Expand Up @@ -100,20 +103,6 @@ The user executing this SQL command must have at least the following privileges:
- There can only be one executing BACKUP or RESTORE task under the same database.
- You can restore the backed up tables in the warehouse to replace the existing tables of the same name in the database, but you must ensure that the table structures of the two tables are exactly the same. The table structure includes: table name, column, partition, Rollup, etc.
- You can specify some partitions of the recovery table, and the system will check whether the partition Range or List can match.
- PROPERTIES currently supports the following properties:
- "backup_timestamp" = "2018-05-04-16-45-08": Specifies which time version of the corresponding backup to restore, required. This information can be obtained with the `SHOW SNAPSHOT ON repo;` statement.
- "replication_num" = "3": Specifies the number of replicas for the restored table or partition. Default is 3. If restoring an existing table or partition, the number of replicas must be the same as the number of replicas of the existing table or partition. At the same time, there must be enough hosts to accommodate multiple replicas.
- "reserve_replica" = "true": Default is false. When this property is true, the replication_num property is ignored and the restored table or partition will have the same number of replication as before the backup. Supports multiple tables or multiple partitions within a table with different replication number.
- "reserve_dynamic_partition_enable" = "true": Default is false. When this property is true, the restored table will have the same value of 'dynamic_partition_enable' as before the backup. if this property is not true, the restored table will set 'dynamic_partition_enable=false'.
- "timeout" = "3600": The task timeout period, the default is one day. in seconds.
- "meta_version" = 40: Use the specified meta_version to read the previously backed up metadata. Note that this parameter is used as a temporary solution and is only used to restore the data backed up by the old version of Doris. The latest version of the backup data already contains the meta version, no need to specify it.
- "clean_tables" : Indicates whether to clean up tables that do not belong to the restore target. For example, if the target db before the restore has tables that are not present in the snapshot, specifying `clean_tables` can drop these extra tables and move them into the recycle bin during the restore.
- This feature is supported since the Apache Doris 2.1.6 version
- "clean_partitions": Indicates whether to clean up partitions that do not belong to the restore target. For example, if the target table before the restore has partitions that are not present in the snapshot, specifying `clean_partitions` can drop these extra partitions and move them into the recycle bin during the restore.
- This feature is supported since the Apache Doris 2.1.6 version
- atomic_restore - : The data will be loaded into a temporary table first, and then the original table will be replaced atomically to ensure that the read and write of the target table are not affected during the recovery process.
- "force_replace" : Force replace when the table exists and the schema is different with the backup table.
- Note that to enable `force_replace`, you must enable `atomic_restore`
- The table name backed up in the warehouse can be restored to a new table through the AS statement. But the new table name cannot already exist in the database. The partition name cannot be modified.
- Efficiency of recovery operations:In the case of the same cluster size, the time-consuming of the restore operation is basically the same as the time-consuming of the backup operation. If you want to speed up the recovery operation, you can first restore only one copy by setting the `replication_num` parameter, and then adjust the number of copies by [ALTER TABLE PROPERTY](../../../../sql-manual/sql-statements/table-and-view/table/ALTER-TABLE-PROPERTY), complete the copy.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ FROM `<repository_name>`
- "reserve_dynamic_partition_enable" = "true":默认为 false。当该属性为 true 时,恢复的表会保留该表备份之前的'dynamic_partition_enable'属性值。该值不为 true 时,则恢复出来的表的'dynamic_partition_enable'属性值会设置为 false。
- "timeout" = "3600":任务超时时间,默认为一天。单位秒。
- "meta_version" = 40:使用指定的 meta_version 来读取之前备份的元数据。注意,该参数作为临时方案,仅用于恢复老版本 Doris 备份的数据。最新版本的备份数据中已经包含 meta version,无需再指定。
- "clean_tables": 表示是否清理不属于恢复目标的表。例如,如果恢复之前的目标数据库有备份中不存在的表,指定 `clean_tables` 就可以在恢复期间删除这些额外的表并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- "clean_partitions ":表示是否清理不属于恢复目标的分区。例如,如果恢复之前的目标表有备份中不存在的分区,指定 `clean_partitions` 就可以在恢复期间删除这些额外的分区并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- atomic_restore - :先将数据加载到临时表中,再以原子方式替换原表,确保恢复过程中不影响目标表的读写。
- “force_replace” :当表存在且架构与备份表不同时,强制替换。
- 注意,要启用“force_replace”,必须启用"atomic_restore"

## 可选参数

Expand Down Expand Up @@ -96,18 +101,6 @@ FROM `<repository_name>`
- 同一数据库下只能有一个正在执行的 BACKUP 或 RESTORE 任务。
- 可以将仓库中备份的表恢复替换数据库中已有的同名表,但须保证两张表的表结构完全一致。表结构包括:表名、列、分区、Rollup 等等。
- 可以指定恢复表的部分分区,系统会检查分区 Range 或者 List 是否能够匹配。
- PROPERTIES 目前支持以下属性:
- "backup_timestamp" = "2018-05-04-16-45-08":指定了恢复对应备份的哪个时间版本,必填。该信息可以通过 `SHOW SNAPSHOT ON repo;` 语句获得。
- "replication_num" = "3":指定恢复的表或分区的副本数。默认为 3。若恢复已存在的表或分区,则副本数必须和已存在表或分区的副本数相同。同时,必须有足够的 host 容纳多个副本。
- "reserve_replica" = "true":默认为 false。当该属性为 true 时,会忽略 replication_num 属性,恢复的表或分区的副本数将与备份之前一样。支持多个表或表内多个分区有不同的副本数。
- "reserve_dynamic_partition_enable" = "true":默认为 false。当该属性为 true 时,恢复的表会保留该表备份之前的'dynamic_partition_enable'属性值。该值不为 true 时,则恢复出来的表的'dynamic_partition_enable'属性值会设置为 false。
- "timeout" = "3600":任务超时时间,默认为一天。单位秒。
- "meta_version" = 40:使用指定的 meta_version 来读取之前备份的元数据。注意,该参数作为临时方案,仅用于恢复老版本 Doris 备份的数据。最新版本的备份数据中已经包含 meta version,无需再指定。
- "clean_tables": 表示是否清理不属于恢复目标的表。例如,如果恢复之前的目标数据库有备份中不存在的表,指定 `clean_tables` 就可以在恢复期间删除这些额外的表并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- "clean_partitions ":表示是否清理不属于恢复目标的分区。例如,如果恢复之前的目标表有备份中不存在的分区,指定 `clean_partitions` 就可以在恢复期间删除这些额外的分区并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- atomic_restore - :先将数据加载到临时表中,再以原子方式替换原表,确保恢复过程中不影响目标表的读写。
- “force_replace” :当表存在且架构与备份表不同时,强制替换。
- 注意,要启用“force_replace”,必须启用“atomic_restore”
- 可以通过 AS 语句将仓库中备份的表名恢复为新的表。但新表名不能已存在于数据库中。分区名称不能修改。
- 恢复操作的效率: 在集群规模相同的情况下,恢复操作的耗时基本等同于备份操作的耗时。如果想加速恢复操作,可以先通过设置 `replication_num` 参数,仅恢复一个副本,之后在通过调整副本数 [ALTER TABLE PROPERTY](../../../../sql-manual/sql-statements/table-and-view/table/ALTER-TABLE-PROPERTY.md),将副本补齐。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ FROM `<repository_name>`
- "reserve_dynamic_partition_enable" = "true":默认为 false。当该属性为 true 时,恢复的表会保留该表备份之前的'dynamic_partition_enable'属性值。该值不为 true 时,则恢复出来的表的'dynamic_partition_enable'属性值会设置为 false。
- "timeout" = "3600":任务超时时间,默认为一天。单位秒。
- "meta_version" = 40:使用指定的 meta_version 来读取之前备份的元数据。注意,该参数作为临时方案,仅用于恢复老版本 Doris 备份的数据。最新版本的备份数据中已经包含 meta version,无需再指定。
- "clean_tables": 表示是否清理不属于恢复目标的表。例如,如果恢复之前的目标数据库有备份中不存在的表,指定 `clean_tables` 就可以在恢复期间删除这些额外的表并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- "clean_partitions ":表示是否清理不属于恢复目标的分区。例如,如果恢复之前的目标表有备份中不存在的分区,指定 `clean_partitions` 就可以在恢复期间删除这些额外的分区并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- atomic_restore - :先将数据加载到临时表中,再以原子方式替换原表,确保恢复过程中不影响目标表的读写。
- “force_replace” :当表存在且结构与备份表不同时,强制替换。
- 注意,要启用“force_replace”,必须启用“atomic_restore”

## 可选参数

Expand Down Expand Up @@ -96,18 +101,6 @@ FROM `<repository_name>`
- 同一数据库下只能有一个正在执行的 BACKUP 或 RESTORE 任务。
- 可以将仓库中备份的表恢复替换数据库中已有的同名表,但须保证两张表的表结构完全一致。表结构包括:表名、列、分区、Rollup 等等。
- 可以指定恢复表的部分分区,系统会检查分区 Range 或者 List 是否能够匹配。
- PROPERTIES 目前支持以下属性:
- "backup_timestamp" = "2018-05-04-16-45-08":指定了恢复对应备份的哪个时间版本,必填。该信息可以通过 `SHOW SNAPSHOT ON repo;` 语句获得。
- "replication_num" = "3":指定恢复的表或分区的副本数。默认为 3。若恢复已存在的表或分区,则副本数必须和已存在表或分区的副本数相同。同时,必须有足够的 host 容纳多个副本。
- "reserve_replica" = "true":默认为 false。当该属性为 true 时,会忽略 replication_num 属性,恢复的表或分区的副本数将与备份之前一样。支持多个表或表内多个分区有不同的副本数。该功能自 Apache Doris 1.2 版本起支持。
- "reserve_dynamic_partition_enable" = "true":默认为 false。当该属性为 true 时,恢复的表会保留该表备份之前的'dynamic_partition_enable'属性值。该值不为 true 时,则恢复出来的表的'dynamic_partition_enable'属性值会设置为 false。该功能自 Apache Doris 1.2 版本起支持。
- "timeout" = "3600":任务超时时间,默认为一天。单位秒。
- "meta_version" = 40:使用指定的 meta_version 来读取之前备份的元数据。注意,该参数作为临时方案,仅用于恢复老版本 Doris 备份的数据。最新版本的备份数据中已经包含 meta version,无需再指定。
- "clean_tables": 表示是否清理不属于恢复目标的表。例如,如果恢复之前的目标数据库有备份中不存在的表,指定 `clean_tables` 就可以在恢复期间删除这些额外的表并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- "clean_partitions ":表示是否清理不属于恢复目标的分区。例如,如果恢复之前的目标表有备份中不存在的分区,指定 `clean_partitions` 就可以在恢复期间删除这些额外的分区并将其移入回收站。该功能自 Apache Doris 2.1.6 版本起支持。
- atomic_restore - :先将数据加载到临时表中,再以原子方式替换原表,确保恢复过程中不影响目标表的读写。
- “force_replace” :当表存在且架构与备份表不同时,强制替换。
- 注意,要启用“force_replace”,必须启用"atomic_restore"
- 可以通过 AS 语句将仓库中备份的表名恢复为新的表。但新表名不能已存在于数据库中。分区名称不能修改。
- 恢复操作的效率: 在集群规模相同的情况下,恢复操作的耗时基本等同于备份操作的耗时。如果想加速恢复操作,可以先通过设置 `replication_num` 参数,仅恢复一个副本,之后在通过调整副本数 [ALTER TABLE PROPERTY](../../../../sql-manual/sql-statements/table-and-view/table/ALTER-TABLE-PROPERTY.md),将副本补齐。

Expand Down
Loading

0 comments on commit 69419d1

Please sign in to comment.