github-actions[bot] commented on code in PR #62704:
URL: https://github.com/apache/doris/pull/62704#discussion_r3122972850
##########
fe/fe-core/src/main/java/org/apache/doris/cloud/backup/CloudRestoreJob.java:
##########
@@ -157,6 +159,36 @@ public synchronized void run() {
}
}
+ @Override
+ protected void updateOlapTablesVersion(Database db, boolean isReplay) {
+ super.updateOlapTablesVersion(db, isReplay);
+ if (isReplay) {
+ return;
+ }
+ for (String tableName : jobInfo.backupOlapTableObjects.keySet()) {
+ Table tbl =
db.getTableNullable(jobInfo.getAliasByOriginNameIfSet(tableName));
+ if (tbl == null || tbl.getType() != TableType.OLAP) {
+ continue;
+ }
+ OlapTable olapTable = (OlapTable) tbl;
+
+ // sync version
+ List<Pair<OlapTable, Long>> tableVersionMap = Lists.newArrayList(
+ Pair.of(olapTable, olapTable.getCachedTableVersion()));
+ Map<CloudPartition, Pair<Long, Long>> partitionVersionMap = new
HashMap<>(olapTable.getPartitions().size());
+ for (Partition partition : olapTable.getPartitions()) {
+ CloudPartition cloudPartition = (CloudPartition) partition;
+ long version = cloudPartition.getCachedVisibleVersion();
+ partitionVersionMap.put(cloudPartition, Pair.of(version,
partition.getVisibleVersionTime()));
+ }
+ ((CloudEnv) env).getCloudFEVersionSynchronizer()
+ .pushVersionAsync(dbId, tableVersionMap,
partitionVersionMap);
Review Comment:
For restore into an existing cloud table, this loop pushes
getCachedVisibleVersion() for every partition in the table, not just the
partitions touched by the restore. In cloud mode that value is only FE cache.
After restart or failover, untouched partitions can still hold old serialized
versions. Pushing them here resets follower cache TTL via
setCachedVisibleVersion(...), so other FEs can keep using stale versions for
unrelated partitions until TTL expires. Please only sync versions for
partitions affected by this restore, or fetch authoritative versions before
pushing untouched partitions.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]