Skip to content

Commit

Permalink
fix ut p0
Browse files Browse the repository at this point in the history
  • Loading branch information
deardeng authored and dataroaring committed Aug 15, 2024
1 parent c0a2b16 commit e665842
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ private static Map<String, String> rewriteReplicaAllocationProperties(

private static Map<String, String> rewriteReplicaAllocationPropertiesByDatabase(
String ctl, String database, Map<String, String> properties) {
// if table contain `replication_allocation` or `replication_allocation`,not need rewrite by db
// if table contain `replication_allocation` or `replication_num`,not need rewrite by db
if (properties != null && (properties.containsKey(PropertyAnalyzer.PROPERTIES_REPLICATION_ALLOCATION)
|| properties.containsKey(PropertyAnalyzer.PROPERTIES_REPLICATION_NUM))) {
return properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,26 @@ public Backend selectBackendForGroupCommit(long tableId, ConnectContext context,
throws LoadException, DdlException {
// If a group commit request is sent to the follower FE, we will send this request to the master FE. master FE
// can select a BE and return this BE id to follower FE.
if (!Env.getCurrentEnv().isMaster()) {
String clusterName = "";
if (isCloud) {
try {
long backendId = new MasterOpExecutor(context)
.getGroupCommitLoadBeId(tableId, context.getCloudCluster(), isCloud);
return Env.getCurrentSystemInfo().getBackend(backendId);
clusterName = context.getCloudCluster();
} catch (Exception e) {
LOG.warn("failed to get cluster name", e);
throw new LoadException(e.getMessage());
}
} else {
}
if (!Env.getCurrentEnv().isMaster()) {
try {
// Master FE will select BE by itself.
return Env.getCurrentSystemInfo()
.getBackend(selectBackendForGroupCommitInternal(tableId, context.getCloudCluster(), isCloud));
long backendId = new MasterOpExecutor(context)
.getGroupCommitLoadBeId(tableId, clusterName, isCloud);
return Env.getCurrentSystemInfo().getBackend(backendId);
} catch (Exception e) {
LOG.warn("get backend failed, tableId: {}, exception", tableId, e);
throw new LoadException(e.getMessage());
}
} else {
return Env.getCurrentSystemInfo()
.getBackend(selectBackendForGroupCommitInternal(tableId, clusterName, isCloud));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ private static void logAuditLogImpl(ConnectContext ctx, String origStmt, Stateme
CatalogIf catalog = ctx.getCurrentCatalog();
String cloudCluster = "";
try {
cloudCluster = ctx.getCloudCluster();
if (Config.isCloudMode()) {
cloudCluster = ctx.getCloudCluster();
}
} catch (ClusterException e) {
LOG.warn("Failed to get cloud cluster", e);
}
Expand Down Expand Up @@ -212,7 +214,9 @@ private static void logAuditLogImpl(ConnectContext ctx, String origStmt, Stateme
MetricRepo.COUNTER_QUERY_ALL.increase(1L);
MetricRepo.USER_COUNTER_QUERY_ALL.getOrAdd(ctx.getQualifiedUser()).increase(1L);
try {
cloudCluster = ctx.getCloudCluster(false);
if (Config.isCloudMode()) {
cloudCluster = ctx.getCloudCluster(false);
}
} catch (ClusterException e) {
LOG.warn("Failed to get cloud cluster", e);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public void testCreateAndDropWithSql() throws Exception {
+ " 'location'='hdfs://loc/db/tbl',\n"
+ " 'file_format'='orc')";
ExceptionChecker.expectThrowsWithMsg(org.apache.doris.nereids.exceptions.AnalysisException.class,
"errCode = 2, detailMessage = errCode = 2,"
"errCode = 2,"
+ " detailMessage = Create hive bucket table need set enable_create_hive_bucket_table to true",
() -> createTable(createBucketedTableErr, true));

Expand Down

0 comments on commit e665842

Please sign in to comment.