cherry pick from #40118 Co-authored-by: smallx <e9999e@163.com>
This commit is contained in:
@ -751,6 +751,9 @@ public class RestoreJob extends AbstractJob {
|
||||
return;
|
||||
}
|
||||
|
||||
// reset next version to visible version + 1 for all partitions
|
||||
remoteOlapTbl.resetVersionForRestore();
|
||||
|
||||
// Reset properties to correct values.
|
||||
remoteOlapTbl.resetPropertiesForRestore(reserveDynamicPartitionEnable, reserveReplica,
|
||||
replicaAlloc, isBeingSynced);
|
||||
|
||||
@ -577,6 +577,12 @@ public class OlapTable extends Table implements MTMVRelatedTableIf {
|
||||
setColocateGroup(null);
|
||||
}
|
||||
|
||||
public void resetVersionForRestore() {
|
||||
for (Partition partition : idToPartition.values()) {
|
||||
partition.setNextVersion(partition.getVisibleVersion() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Status resetIdsForRestore(Env env, Database db, ReplicaAllocation restoreReplicaAlloc,
|
||||
boolean reserveReplica, String srcDbName) {
|
||||
// ATTN: The meta of the restore may come from different clusters, so the
|
||||
|
||||
Reference in New Issue
Block a user