Skip to content

Commit 3171bf2

Browse files
committed
[fix](cloud) Fix the error of Cloud forwarding SQL not finding the cluster (apache#41819)
1 parent 8ae600d commit 3171bf2

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -626,17 +626,17 @@ public void deleteTablet(long tabletId) {
626626
public void addReplica(long tabletId, Replica replica) {
627627
long stamp = writeLock();
628628
try {
629-
Preconditions.checkState(tabletMetaMap.containsKey(tabletId),
630-
"tablet " + tabletId + " not exists, replica " + replica.getId()
631-
+ ", backend " + replica.getBackendIdWithoutException());
632629
// cloud mode, create table not need backendId, represent with -1.
633630
long backendId = Config.isCloudMode() ? -1 : replica.getBackendIdWithoutException();
631+
Preconditions.checkState(tabletMetaMap.containsKey(tabletId),
632+
"tablet " + tabletId + " not exists, replica " + replica.getId()
633+
+ ", backend " + backendId);
634634
replicaMetaTable.put(tabletId, backendId, replica);
635635
replicaToTabletMap.put(replica.getId(), tabletId);
636636
backingReplicaMetaTable.put(backendId, tabletId, replica);
637637
if (LOG.isDebugEnabled()) {
638638
LOG.debug("add replica {} of tablet {} in backend {}",
639-
replica.getId(), tabletId, replica.getBackendIdWithoutException());
639+
replica.getId(), tabletId, backendId);
640640
}
641641
} finally {
642642
writeUnlock(stamp);

fe/fe-core/src/main/java/org/apache/doris/common/proc/ReplicasProcNode.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
import com.google.common.collect.ImmutableList;
3535
import com.google.common.collect.ImmutableMap;
36+
import com.google.common.collect.Lists;
3637

37-
import java.util.Arrays;
3838
import java.util.List;
3939

4040
/*
@@ -116,7 +116,7 @@ public ProcResult fetchResult() throws AnalysisException {
116116
if (Config.enable_query_hit_stats) {
117117
queryHits = QueryStatsUtil.getMergedReplicaStats(replica.getId());
118118
}
119-
List<String> replicaInfo = Arrays.asList(String.valueOf(replica.getId()),
119+
List<String> replicaInfo = Lists.newArrayList(String.valueOf(replica.getId()),
120120
String.valueOf(replica.getBackendIdWithoutException()),
121121
String.valueOf(replica.getVersion()),
122122
String.valueOf(replica.getLastSuccessVersion()),

fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java

-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ private TMasterOpRequest buildStmtForwardParams() throws AnalysisException {
218218
cluster = ctx.getCloudCluster(false);
219219
} catch (Exception e) {
220220
LOG.warn("failed to get cloud compute group", e);
221-
throw new AnalysisException("failed to get cloud compute group", e);
222221
}
223222
if (!Strings.isNullOrEmpty(cluster)) {
224223
params.setCloudCluster(cluster);

0 commit comments

Comments
 (0)