github-actions[bot] commented on code in PR #62704:
URL: https://github.com/apache/doris/pull/62704#discussion_r3122927221


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/backup/CloudRestoreJob.java:
##########
@@ -459,6 +491,13 @@ private void handleOlapTableMeta(MetaSeriviceOperation 
operation, OlapTable olap
                 partitions.forEach(partition -> {
                     visibleVersions.add(partition.getCachedVisibleVersion());

Review Comment:
   visibleVersions is already captured from partition.getCachedVisibleVersion() 
on the previous line, so this extra partition.getVisibleVersion() call does not 
affect what preparePartition() persists. For restored CloudPartition objects, 
lastVersionCachedTimeMs starts at 0 after deserialization or copy, so 
getVisibleVersion() immediately issues a get_version RPC against the fresh 
partition id before preparePartition() runs. That makes restore depend on an 
extra RPC succeeding even though CloudInternalCatalog.preparePartition() 
already has its own retry loop. Please seed the local cache from the known 
restore version instead of doing a live lookup here.



##########
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:
   This refresh is scoped to the whole table, not the restored tablets. On a 
partition scoped restore into a large existing table, getAllTabletIds() will 
enqueue stats collection for every tablet in the table even though only the 
restored partition changed. Other cloud paths update only the affected tablets. 
Please limit this to tablets from the restored partitions or restored tables to 
avoid a full table stats burst.



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

Reply via email to