nextdreamblue commented on code in PR #11942: URL: https://github.com/apache/doris/pull/11942#discussion_r950964011
########## 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: 主要是为了兼容老的元数据,这个新的属性通过properties这个已有的变量去保存,可以很好地兼容之前的恢复任务元数据。如果不保存,会有丢失这个属性信息,所以折中了下,使用properties这个目前看来其实没有使用的变量。 ########## 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: 理由同下 -- 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