branch-4.1: [fix](fe) cache version and get tablet stats actively for RestoreJob (#62704)#64045
Conversation
|
run buildall |
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
There was a problem hiding this comment.
Pull request overview
Backports a FE fix to improve cloud restore correctness by propagating restored table/partition version cache updates and proactively marking restored tablets as active so stats can be fetched after RestoreJob completes.
Changes:
- Change
RestoreJob.updateOlapTablesVersionto beprotectedand acceptisReplay, enabling cloud-specific overrides. - Add a
CloudRestoreJoboverride that pushes table/partition version caches to other FEs and registers restored tablets withCloudTabletStatMgr. - Cache the returned table version on partition commit, and refresh cloud partition cached visible versions during restore meta prepare.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
fe/fe-core/src/main/java/org/apache/doris/cloud/backup/CloudRestoreJob.java |
Adds cloud-specific version sync + active-tablet registration and updates cached version handling during restore. |
fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java |
Refactors version-update hook to be overridable and replay-aware. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // 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())); | ||
| } |
| ((CloudPartition) partition).setCachedVisibleVersion(partition.getVisibleVersion(), | ||
| System.currentTimeMillis()); | ||
| LOG.info("set cloud partition: {}, version: {}, versionTime: {}", | ||
| partition.getId(), partition.getCachedVisibleVersion(), | ||
| partition.getVisibleVersionTime()); | ||
| } |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
pick #62704