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

morningman 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 ff7a04093e5 [fix](fe) fix several blocking bugs #37756 (#37757)
ff7a04093e5 is described below

commit ff7a04093e50eda8c031a65ff610683fff7401d2
Author: Mingyu Chen <[email protected]>
AuthorDate: Mon Jul 15 15:56:01 2024 +0800

    [fix](fe) fix several blocking bugs #37756 (#37757)
    
    bp #37756
---
 .../java/org/apache/doris/analysis/FunctionCallExpr.java    |  1 -
 .../java/org/apache/doris/datasource/ExternalCatalog.java   |  5 +++++
 .../java/org/apache/doris/qe/MasterCatalogExecutor.java     | 13 +++++++++++--
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
index a3ad5ef7e9b..b61c49c0104 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java
@@ -2444,7 +2444,6 @@ public class FunctionCallExpr extends Expr {
         int result = super.hashCode();
         result = 31 * result + Objects.hashCode(opcode);
         result = 31 * result + Objects.hashCode(fnName);
-        result = 31 * result + Objects.hashCode(fnParams);
         return result;
     }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java
index f9253aa03f6..35434a43cb3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java
@@ -598,6 +598,11 @@ public abstract class ExternalCatalog
             // Should not return null.
             // Because replyInitCatalog can only be called when 
`use_meta_cache` is false.
             // And if `use_meta_cache` is false, getDbForReplay() will not 
return null
+            if (!db.isPresent()) {
+                LOG.warn("met invalid db id {} in replayInitCatalog, catalog: 
{}, ignore it to skip bug.",
+                        log.getRefreshDbIds().get(i), name);
+                continue;
+            }
             Preconditions.checkNotNull(db.get());
             tmpDbNameToId.put(db.get().getFullName(), db.get().getId());
             tmpIdToDb.put(db.get().getId(), db.get());
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java
index bb0f5a88e14..0fd07445108 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java
@@ -64,11 +64,20 @@ public class MasterCatalogExecutor {
         boolean isReturnToPool = false;
         try {
             TInitExternalCtlMetaResult result = 
client.initExternalCtlMeta(request);
-            
Env.getCurrentEnv().getJournalObservable().waitOn(result.maxJournalId, 
waitTimeoutMs);
             if (!result.getStatus().equalsIgnoreCase(STATUS_OK)) {
                 throw new UserException(result.getStatus());
+            } else {
+                // DO NOT wait on journal replayed, this may cause deadlock.
+                // 1. hold table read lock
+                // 2. wait on journal replayed
+                // 3. previous journal (eg, txn journal) replayed need to hold 
table write lock
+                // 4. deadlock
+                // But no waiting on journal replayed may cause some request 
on non-master FE failed for some time.
+                // There is no good solution for this.
+                // In feature version, this whole process is refactored, so we 
temporarily remove this waiting.
+                // 
Env.getCurrentEnv().getJournalObservable().waitOn(result.maxJournalId, 
timeoutMs);
+                isReturnToPool = true;
             }
-            isReturnToPool = true;
         } catch (Exception e) {
             LOG.warn("Failed to finish forward init operation, please try 
again. ", e);
             throw e;


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

Reply via email to