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

zclll 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 65c4e01a1bb [Fix](dictionary) Decrease dictionary version when commit 
failed (#51444)
65c4e01a1bb is described below

commit 65c4e01a1bb9ed1c3c4eb7b747abb9702ea7fdc6
Author: zclllyybb <[email protected]>
AuthorDate: Wed Jun 4 18:01:09 2025 +0800

    [Fix](dictionary) Decrease dictionary version when commit failed (#51444)
---
 .../java/org/apache/doris/dictionary/DictionaryManager.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/dictionary/DictionaryManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/dictionary/DictionaryManager.java
index f3e63248e73..ff25e1cd5a3 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/dictionary/DictionaryManager.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/dictionary/DictionaryManager.java
@@ -481,10 +481,12 @@ public class DictionaryManager extends MasterDaemon 
implements Writable {
 
         // commit and check the result. not modify metadata so dont need lock.
         if (!commitNextVersion(ctx, dictionary)) {
+            dictionary.decreaseVersion();
+            
Env.getCurrentEnv().getEditLog().logDictionaryDecVersion(dictionary);
             dictionary.trySetStatus(oldStatus);
             abortNextVersion(ctx, dictionary, dictionary.getVersion());
-            throw new RuntimeException("Dictionary " + dictionary.getName() + 
" commit version "
-                    + (dictionary.getVersion() + 1) + " failed");
+            throw new RuntimeException(
+                    "Dictionary " + dictionary.getName() + " commit version " 
+ dictionary.getVersion() + " failed");
         }
 
         // commit succeed. update metadata.
@@ -496,8 +498,8 @@ public class DictionaryManager extends MasterDaemon 
implements Writable {
         } else {
             dictionary.setLastUpdateResult("succeed");
         }
-        LOG.info("Dictionary {} refresh succeed. used src version {}", 
dictionary.getName(),
-                ctx.getStatementContext().getDictionaryUsedSrcVersion());
+        LOG.info("Dictionary {} refresh succeed. now version is {}. used src 
version {}", dictionary.getName(),
+                dictionary.getVersion(), 
ctx.getStatementContext().getDictionaryUsedSrcVersion());
     }
 
     private boolean commitNextVersion(ConnectContext ctx, Dictionary 
dictionary) {


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

Reply via email to