You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/06/08 06:27:10 UTC
[doris] branch branch-1.2-lts updated: [Fix](hive-catalog) Fallback to refresh catalog when hms events are missing (#20586)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new 08bb11dc21 [Fix](hive-catalog) Fallback to refresh catalog when hms events are missing (#20586)
08bb11dc21 is described below
commit 08bb11dc21d91318dd684d631f8e46b5c6bfbde8
Author: zhangdong <49...@qq.com>
AuthorDate: Thu Jun 8 14:27:04 2023 +0800
[Fix](hive-catalog) Fallback to refresh catalog when hms events are missing (#20586)
cherry-pick #20227
---
.../org/apache/doris/datasource/HMSExternalCatalog.java | 16 +++++++++++++++-
.../hadoop/hive/metastore/HiveMetaStoreClient.java | 2 +-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/HMSExternalCatalog.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/HMSExternalCatalog.java
index 1f0b65c720..93659ac23b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/HMSExternalCatalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/HMSExternalCatalog.java
@@ -33,6 +33,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.security.UserGroupInformation;
@@ -229,7 +230,20 @@ public class HMSExternalCatalog extends ExternalCatalog {
LOG.info("Event id not updated when pulling events on catalog [{}]", hmsExternalCatalog.getName());
return null;
}
- return client.getNextNotification(lastSyncedEventId, Config.hms_events_batch_size_per_rpc, null);
+
+ try {
+ return client.getNextNotification(lastSyncedEventId, Config.hms_events_batch_size_per_rpc, null);
+ } catch (IllegalStateException e) {
+ // Need a fallback to handle this because this error state can not be recovered until restarting FE
+ if (HiveMetaStoreClient.REPL_EVENTS_MISSING_IN_METASTORE.equals(e.getMessage())) {
+ lastSyncedEventId = getCurrentEventId();
+ refreshCatalog(hmsExternalCatalog);
+ LOG.warn("Notification events are missing, maybe an event can not be handled "
+ + "or processing rate is too low, fallback to refresh the catalog");
+ return null;
+ }
+ throw e;
+ }
}
private void refreshCatalog(HMSExternalCatalog hmsExternalCatalog) {
diff --git a/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index 4a5acc4a26..4b320ae3e1 100644
--- a/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++ b/fe/fe-core/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -319,7 +319,7 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable {
static final protected Logger LOG = LoggerFactory.getLogger(HiveMetaStoreClient.class);
//copied from ErrorMsg.java
- private static final String REPL_EVENTS_MISSING_IN_METASTORE = "Notification events are missing in the meta store.";
+ public static final String REPL_EVENTS_MISSING_IN_METASTORE = "Notification events are missing in the meta store.";
public HiveMetaStoreClient(Configuration conf) throws MetaException {
this(conf, null, true);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org