This is an automated email from the ASF dual-hosted git repository.

xuyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 845a903bdd2 [bug](cloud restore) Fix load failed after table restore 
(#60212)
845a903bdd2 is described below

commit 845a903bdd285ae0de8222d18a2a4fa71f4f996e
Author: xy720 <[email protected]>
AuthorDate: Mon Jan 26 15:50:57 2026 +0800

    [bug](cloud restore) Fix load failed after table restore (#60212)
    
    ### What problem does this PR solve?
    
    How to reproduce:
    
    1、create a table with 3 replica and backup it to repo
    
    ```
    CREATE TABLE `test_tbl_3_replica` (
      `companyId` bigint NULL,
      `jobId` bigint NULL,
      `province` text NULL,
      `vCallerId` bigint NULL DEFAULT "0",
      `aCallerId` bigint NULL DEFAULT "-1"
    ) ENGINE=OLAP
    DUPLICATE KEY(`companyId`)
    DISTRIBUTED BY HASH(`companyId`) BUCKETS 8
    PROPERTIES (
    "replication_allocation" = "tag.location.default: 3"
    );
    ```
    
    2、set `reserve_replica = true` in restore command.
    
    ```
    RESTORE SNAPSHOT test.`snapshot_label` FROM `test_repo` PROPERTIES ( 
"backup_timestamp" = "2026-01-23-16-20-57", "reserve_replica" = "true");
    ```
    
    3、after restore finished, insert into the restored table.
    
    ```
    mysql> insert into test_tbl_3_replica values(100,100,'广东',3,3);
    Error1105:errCode=2, detailMessage = tablet 1768908267608 alive replicanum 
1 < load required replicanum 2, alivebackends: [1768462881465]
    ```
---
 fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java | 5 +++--
 1 file changed, 3 insertions(+), 2 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 9d8ee1bcb75..2874dc900c8 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
@@ -250,8 +250,9 @@ public class RestoreJob extends AbstractJob implements 
GsonPostProcessable {
         this.metaVersion = metaVersion;
         this.reserveReplica = reserveReplica;
         this.reserveColocate = reserveColocate;
-        // if backup snapshot is come from a cluster with force replication 
allocation, ignore the origin allocation
-        if (jobInfo.isForceReplicationAllocation) {
+        // if is cloud mode or backup snapshot is come from a cluster with 
force replication allocation,
+        // ignore the origin allocation
+        if (Config.isCloudMode() || jobInfo.isForceReplicationAllocation) {
             this.reserveReplica = false;
         }
         this.reserveDynamicPartitionEnable = reserveDynamicPartitionEnable;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to