This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 2810029d24 [fix](multi-catalog) fix bug that replay init catalog may
happen after catalog is dropped (#15919)
2810029d24 is described below
commit 2810029d246710643372c7041ba49069576ee388
Author: Mingyu Chen <[email protected]>
AuthorDate: Sat Jan 14 09:41:37 2023 +0800
[fix](multi-catalog) fix bug that replay init catalog may happen after
catalog is dropped (#15919)
---
build.sh | 1 +
.../java/org/apache/doris/datasource/CatalogMgr.java | 18 ++++++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/build.sh b/build.sh
index fb2e0b86cb..b3090a2af7 100755
--- a/build.sh
+++ b/build.sh
@@ -145,6 +145,7 @@ if [[ "$#" == 1 ]]; then
BUILD_META_TOOL='OFF'
BUILD_SPARK_DPP=1
BUILD_HIVE_UDF=1
+ BUILD_JAVA_UDF=1
CLEAN=0
else
while true; do
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java
index 57c6fb2c55..8fe1e07425 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java
@@ -49,7 +49,6 @@ import org.apache.doris.persist.gson.GsonUtils;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.ShowResultSet;
-import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.gson.annotations.SerializedName;
@@ -519,17 +518,27 @@ public class CatalogMgr implements Writable,
GsonPostProcessable {
}
}
+ // init catalog and init db can happen at any time,
+ // even after catalog or db is dropped.
+ // Because it may already hold the catalog or db object before they are
being dropped.
+ // So just skip the edit log if object does not exist.
public void replayInitCatalog(InitCatalogLog log) {
ExternalCatalog catalog = (ExternalCatalog)
idToCatalog.get(log.getCatalogId());
- Preconditions.checkArgument(catalog != null);
+ if (catalog == null) {
+ return;
+ }
catalog.replayInitCatalog(log);
}
public void replayInitExternalDb(InitDatabaseLog log) {
ExternalCatalog catalog = (ExternalCatalog)
idToCatalog.get(log.getCatalogId());
- Preconditions.checkArgument(catalog != null);
+ if (catalog == null) {
+ return;
+ }
ExternalDatabase db = catalog.getDbForReplay(log.getDbId());
- Preconditions.checkArgument(db != null);
+ if (db == null) {
+ return;
+ }
db.replayInitDb(log, catalog);
}
@@ -602,3 +611,4 @@ public class CatalogMgr implements Writable,
GsonPostProcessable {
internalCatalog = (InternalCatalog)
idToCatalog.get(InternalCatalog.INTERNAL_DS_ID);
}
}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]