Skip to content

branch-4.1: [fix](fe) cache version and get tablet stats actively for RestoreJob (#62704)#64045

Merged
yiguolei merged 1 commit into
apache:branch-4.1from
mymeiyi:branch-4.1-pick-62704
Jun 3, 2026
Merged

branch-4.1: [fix](fe) cache version and get tablet stats actively for RestoreJob (#62704)#64045
yiguolei merged 1 commit into
apache:branch-4.1from
mymeiyi:branch-4.1-pick-62704

Conversation

@mymeiyi
Copy link
Copy Markdown
Contributor

@mymeiyi mymeiyi commented Jun 3, 2026

pick #62704

Copilot AI review requested due to automatic review settings June 3, 2026 02:49
@mymeiyi mymeiyi requested a review from yiguolei as a code owner June 3, 2026 02:49
@mymeiyi
Copy link
Copy Markdown
Contributor Author

mymeiyi commented Jun 3, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.updateOlapTablesVersion to be protected and accept isReplay, enabling cloud-specific overrides.
  • Add a CloudRestoreJob override that pushes table/partition version caches to other FEs and registers restored tablets with CloudTabletStatMgr.
  • 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.

Comment on lines +175 to +183
// 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()));
}
Comment on lines +498 to +503
((CloudPartition) partition).setCachedVisibleVersion(partition.getVisibleVersion(),
System.currentTimeMillis());
LOG.info("set cloud partition: {}, version: {}, versionTime: {}",
partition.getId(), partition.getCachedVisibleVersion(),
partition.getVisibleVersionTime());
}
@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/32) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 1.45% (1/69) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit 443897b into apache:branch-4.1 Jun 3, 2026
30 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants