This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new c3e1fa5cd02 branch-3.0: [fix](restore) correct the storage_medium of
atomic restore #49330 (#49450)
c3e1fa5cd02 is described below
commit c3e1fa5cd02f0da279dfa89bda192ef5805b1fad
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Mar 25 17:11:04 2025 +0800
branch-3.0: [fix](restore) correct the storage_medium of atomic restore
#49330 (#49450)
Cherry-picked from #49330
Co-authored-by: walter <[email protected]>
---
.../src/main/java/org/apache/doris/backup/RestoreJob.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
index e234da88451..1ae6cc1e3cf 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
@@ -1200,8 +1200,7 @@ public class RestoreJob extends AbstractJob implements
GsonPostProcessable {
localOlapTbl.getName());
}
}
- tabletBases.put(remoteTablet.getId(),
- new TabletRef(localTablet.getId(), schemaHash,
storageMedium));
+ tabletBases.put(remoteTablet.getId(), new
TabletRef(localTablet.getId(), schemaHash));
}
}
}
@@ -1358,8 +1357,11 @@ public class RestoreJob extends AbstractJob implements
GsonPostProcessable {
for (Tablet restoreTablet : restoredIdx.getTablets()) {
TabletRef baseTabletRef = tabletBases == null ? null :
tabletBases.get(restoreTablet.getId());
// All restored replicas will be saved to HDD by default.
- TStorageMedium storageMedium = baseTabletRef == null
- ? TStorageMedium.HDD : baseTabletRef.storageMedium;
+ TStorageMedium storageMedium = TStorageMedium.HDD;
+ if (tabletBases != null) {
+ // ensure this tablet is bound to the same backend disk as
the origin table's tablet.
+ storageMedium =
localTbl.getPartitionInfo().getDataProperty(restorePart.getId()).getStorageMedium();
+ }
TabletMeta tabletMeta = new TabletMeta(db.getId(),
localTbl.getId(), restorePart.getId(),
restoredIdx.getId(), indexMeta.getSchemaHash(),
storageMedium);
Env.getCurrentInvertedIndex().addTablet(restoreTablet.getId(),
tabletMeta);
@@ -2729,12 +2731,10 @@ public class RestoreJob extends AbstractJob implements
GsonPostProcessable {
private static class TabletRef {
public long tabletId;
public int schemaHash;
- public TStorageMedium storageMedium;
- TabletRef(long tabletId, int schemaHash, TStorageMedium storageMedium)
{
+ TabletRef(long tabletId, int schemaHash) {
this.tabletId = tabletId;
this.schemaHash = schemaHash;
- this.storageMedium = storageMedium;
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]