stalary commented on code in PR #11942:
URL: https://github.com/apache/doris/pull/11942#discussion_r950816440


##########
fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java:
##########
@@ -162,14 +166,17 @@ public RestoreJob() {
     }
 
     public RestoreJob(String label, String backupTs, long dbId, String dbName, 
BackupJobInfo jobInfo, boolean allowLoad,
-            ReplicaAllocation replicaAlloc, long timeoutMs, int metaVersion, 
Env env, long repoId) {
+            ReplicaAllocation replicaAlloc, long timeoutMs, int metaVersion, 
boolean reserveReplica, Env env,
+            long repoId) {
         super(JobType.RESTORE, label, dbId, dbName, timeoutMs, env, repoId);
         this.backupTimestamp = backupTs;
         this.jobInfo = jobInfo;
         this.allowLoad = allowLoad;
         this.replicaAlloc = replicaAlloc;
         this.state = RestoreJobState.PENDING;
         this.metaVersion = metaVersion;
+        this.reserveReplica = reserveReplica;
+        properties.put(PROP_RESERVE_REPLICA, String.valueOf(reserveReplica));

Review Comment:
   Why assign a value here, which looks different from the rest of the 
parameters?



##########
docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Backup-and-Restore/RESTORE.md:
##########
@@ -56,6 +56,7 @@ PROPERTIES ("key"="value", ...);
 - 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'属性,恢复的表或分区的副本数将与备份之前一样。支持多个表或表内多个分区有不同的副本数。

Review Comment:
   ```suggestion
     - "reserve_replica" = "true":默认为 false。当该属性为 true 时,会忽略 replication_num 
属性,恢复的表或分区的副本数将与备份之前一样。支持多个表或表内多个分区有不同的副本数。
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java:
##########
@@ -1858,6 +1893,7 @@ public void readFields(DataInput in) throws IOException {
             String value = Text.readString(in);
             properties.put(key, value);
         }
+        reserveReplica = 
Boolean.parseBoolean(properties.get(PROP_RESERVE_REPLICA));

Review Comment:
   What does this do



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to