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

dataroaring pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 4c5a7b26e29 [chore](restore) Log partition visible version (#37414)
4c5a7b26e29 is described below

commit 4c5a7b26e290f34834a3c4f4d0b8cbc8543c22e9
Author: walter <[email protected]>
AuthorDate: Mon Jul 8 18:58:16 2024 +0800

    [chore](restore) Log partition visible version (#37414)
    
    Cherry-pick #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 63459e5da53..2e20a9fa223 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
@@ -1123,6 +1123,7 @@ public class RestoreJob extends AbstractJob {
 
         // generate new partition id
         long newPartId = env.getNextId();
+        long oldPartId = remotePart.getId();
         remotePart.setIdForRestore(newPartId);
 
         // indexes
@@ -1142,9 +1143,11 @@ public class RestoreJob extends AbstractJob {
 
         // 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();
@@ -1159,7 +1162,7 @@ public class RestoreJob extends AbstractJob {
                 // 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 3e21d8824f5..e2c791777d8 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
@@ -1470,7 +1470,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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to