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 2022/06/23 02:59:18 UTC
[doris] branch master updated: [fix](multi-catalog) should load datasource before loading cluster (#10330)
This is an automated email from the ASF dual-hosted git repository.
morningman 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 815ea35578 [fix](multi-catalog) should load datasource before loading cluster (#10330)
815ea35578 is described below
commit 815ea35578601e9b6dcde61b39349972f668cdfb
Author: Ashin Gau <As...@users.noreply.github.com>
AuthorDate: Thu Jun 23 10:59:12 2022 +0800
[fix](multi-catalog) should load datasource before loading cluster (#10330)
A temp DataSourceMgr is created when catalog intializes, and will be
updated in the loadCluster process. However, the loadDatasource process
will create a new DataSourceMgr with no cluster updated, and write such
DatasourceMgr to image. Finally, when the doris starts to recover, no
cluster is available.
---
.../main/java/org/apache/doris/catalog/Catalog.java | 19 +++++++------------
.../apache/doris/persist/meta/PersistMetaModules.java | 10 +++++-----
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
index 8f9660760f..4abd66d200 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
@@ -1878,15 +1878,13 @@ public class Catalog {
* Load datasource through file.
**/
public long loadDatasource(DataInputStream in, long checksum) throws IOException {
- if (Config.enable_multi_catalog) {
- DataSourceMgr mgr = DataSourceMgr.read(in);
- // When enable the multi catalog in the first time, the mgr will be a null value.
- // So ignore it to use default datasource manager.
- if (mgr != null) {
- this.dataSourceMgr = mgr;
- }
- LOG.info("finished replay datasource from image");
+ DataSourceMgr mgr = DataSourceMgr.read(in);
+ // When enable the multi catalog in the first time, the mgr will be a null value.
+ // So ignore it to use default datasource manager.
+ if (mgr != null) {
+ this.dataSourceMgr = mgr;
}
+ LOG.info("finished replay datasource from image");
return checksum;
}
@@ -2159,10 +2157,7 @@ public class Catalog {
* Save datasource image.
*/
public long saveDatasource(CountingDataOutputStream out, long checksum) throws IOException {
- // Do not write datasource image when enable multi catalog is false.
- if (Config.enable_multi_catalog) {
- Catalog.getCurrentCatalog().getDataSourceMgr().write(out);
- }
+ Catalog.getCurrentCatalog().getDataSourceMgr().write(out);
return checksum;
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/persist/meta/PersistMetaModules.java b/fe/fe-core/src/main/java/org/apache/doris/persist/meta/PersistMetaModules.java
index 920583bab7..74c56c4d69 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/persist/meta/PersistMetaModules.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/persist/meta/PersistMetaModules.java
@@ -34,11 +34,11 @@ public class PersistMetaModules {
// The write and read of meta modules should be in same order.
public static final List<MetaPersistMethod> MODULES_IN_ORDER;
- public static final ImmutableList<String> MODULE_NAMES = ImmutableList.copyOf(
- new String[] {"masterInfo", "frontends", "backends", "db", "loadJob", "alterJob", "recycleBin",
- "globalVariable", "cluster", "broker", "resources", "exportJob", "syncJob", "backupHandler",
- "paloAuth", "transactionState", "colocateTableIndex", "routineLoadJobs", "loadJobV2", "smallFiles",
- "plugins", "deleteHandler", "sqlBlockRule", "policy", "datasource"});
+ public static final ImmutableList<String> MODULE_NAMES = ImmutableList.of(
+ "masterInfo", "frontends", "backends", "datasource", "db", "loadJob", "alterJob", "recycleBin",
+ "globalVariable", "cluster", "broker", "resources", "exportJob", "syncJob", "backupHandler",
+ "paloAuth", "transactionState", "colocateTableIndex", "routineLoadJobs", "loadJobV2", "smallFiles",
+ "plugins", "deleteHandler", "sqlBlockRule", "policy");
static {
MODULES_MAP = Maps.newHashMap();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org