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


##########
fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java:
##########
@@ -927,9 +948,18 @@ private void checkAndRestoreResources() {
     }
 
     private boolean genFileMappingWhenBackupReplicasEqual(PartitionInfo 
localPartInfo, Partition localPartition,
-            Table localTbl, BackupPartitionInfo backupPartInfo, String 
partitionName, BackupOlapTableInfo tblInfo) {
-        short restoreReplicaNum = replicaAlloc.getTotalReplicaNum();
-        short localReplicaNum = 
localPartInfo.getReplicaAllocation(localPartition.getId()).getTotalReplicaNum();
+            Table localTbl, BackupPartitionInfo backupPartInfo, String 
partitionName, BackupOlapTableInfo tblInfo,

Review Comment:
   I think we can just pass a `remoteReplicaAlloc` instead of these 2 
`remotePartInfo` and `remotePartition`



##########
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:
   Looks like the `properties` is indeed build for this purpose. I think it is 
ok to do so.



-- 
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