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

dataroaring 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 8fde0615789 [chore](restore) Log partition visible version (#36920)
8fde0615789 is described below

commit 8fde0615789e119b6a71d3bfe6b943f0bb7c5706
Author: walter <w41te...@gmail.com>
AuthorDate: Thu Jun 27 21:20:33 2024 +0800

    [chore](restore) Log partition visible version (#36920)
---
 fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java   | 7 +++++--
 .../java/org/apache/doris/transaction/DatabaseTransactionMgr.java  | 2 +-
 2 files changed, 6 insertions(+), 3 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 dec821424bf..098c473d32e 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
@@ -1148,6 +1148,7 @@ public class RestoreJob extends AbstractJob implements 
GsonPostProcessable {
 
         // generate new partition id
         long newPartId = env.getNextId();
+        long oldPartId = remotePart.getId();
         remotePart.setIdForRestore(newPartId);
 
         // indexes
@@ -1167,9 +1168,11 @@ public class RestoreJob extends AbstractJob implements 
GsonPostProcessable {
 
         // save version info for creating replicas
         long visibleVersion = remotePart.getVisibleVersion();
+        LOG.info("reset partition {} for restore, visible version: {}, old 
partition id: {}",
+                newPartId, visibleVersion, oldPartId);
 
         // tablets
-        Map<Tag, Integer> nextIndexs = Maps.newHashMap();
+        Map<Tag, Integer> nextIndexes = Maps.newHashMap();
         for (MaterializedIndex remoteIdx : 
remotePart.getMaterializedIndices(IndexExtState.VISIBLE)) {
             int schemaHash = 
remoteTbl.getSchemaHashByIndexId(remoteIdx.getId());
             int remotetabletSize = remoteIdx.getTablets().size();
@@ -1184,7 +1187,7 @@ public class RestoreJob extends AbstractJob implements 
GsonPostProcessable {
                 // replicas
                 try {
                     Pair<Map<Tag, List<Long>>, TStorageMedium> beIdsAndMedium 
= Env.getCurrentSystemInfo()
-                            .selectBackendIdsForReplicaCreation(replicaAlloc, 
nextIndexs, null, false, false);
+                            .selectBackendIdsForReplicaCreation(replicaAlloc, 
nextIndexes, null, false, false);
                     Map<Tag, List<Long>> beIds = beIdsAndMedium.first;
                     for (Map.Entry<Tag, List<Long>> entry : beIds.entrySet()) {
                         for (Long beId : entry.getValue()) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
 
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
index 3850400c1b7..92249f8defc 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
@@ -1598,7 +1598,7 @@ public class DatabaseTransactionMgr {
     protected void unprotectedCommitTransaction2PC(TransactionState 
transactionState, Database db) {
         // transaction state is modified during check if the transaction could 
committed
         if (transactionState.getTransactionStatus() != 
TransactionStatus.PRECOMMITTED) {
-            LOG.warn("Unknow exception. state of transaction [{}] changed, 
failed to commit transaction",
+            LOG.warn("Unknown exception. state of transaction [{}] changed, 
failed to commit transaction",
                     transactionState.getTransactionId());
             return;
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to