wangbo commented on code in PR #48187: URL: https://github.com/apache/doris/pull/48187#discussion_r1966383068
########## fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java: ########## @@ -3096,19 +3097,31 @@ public TFetchOption generateTwoPhaseReadOption(long selectedIndexId) { fetchOption.setFetchRowStore(useStoreRow); fetchOption.setUseTwoPhaseFetch(true); - // get backend by tag - Set<Tag> tagSet = new HashSet<>(); ConnectContext context = ConnectContext.get(); - if (context != null) { - tagSet = context.getResourceTags(); + if (context == null) { + context = new ConnectContext(); + context.setThreadLocalInfo(); } BeSelectionPolicy policy = new BeSelectionPolicy.Builder() .needQueryAvailable() .setRequireAliveBe() - .addTags(tagSet) .build(); + TPaloNodesInfo nodesInfo = new TPaloNodesInfo(); - for (Backend backend : Env.getCurrentSystemInfo().getBackendsByPolicy(policy)) { + ComputeGroup computeGroup = null; + if (Config.isCloudMode()) { + try { + computeGroup = Env.getCurrentEnv().getComputeGroupMgr() + .getComputeGroup(context.getComputeGroup()); + } catch (ComputeGroupException e) { + throw new RuntimeException(e); + } + } else { + computeGroup = Env.getCurrentEnv().getComputeGroupMgr() + .getComputeGroup(context.getComputeGroupSet()); Review Comment: 1 目前ConnectCtx.get就是得拆两个方法,因为存算分离下找不到cluster是必须失败的。但是存算一体找不到还可以继续执行,这是为了和resource tag的方法做兼容。 2 还有就是都用set这个事,我感觉可能比较优雅的做法是ctx.getComputeGroup直接返回一个ComputeGroup类型的对象,这样至少可以保证方法签名的一致,至少调用者不用关心他是个set还是单个的。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org