Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](restore) Reset next version for remote table when restore #40118 #40166

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,9 @@ private void checkAndPrepareMeta() {
return;
}

// reset next version to visible version + 1 for all partitions
remoteOlapTbl.resetVersionForRestore();

// Reset properties to correct values.
remoteOlapTbl.resetPropertiesForRestore(reserveDynamicPartitionEnable, reserveReplica,
replicaAlloc, isBeingSynced);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,12 @@ public void resetPropertiesForRestore(boolean reserveDynamicPartitionEnable, boo
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
Expand Down
Loading