github-actions[bot] commented on code in PR #66083:
URL: https://github.com/apache/doris/pull/66083#discussion_r3655554825


##########
fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java:
##########
@@ -1169,17 +1169,32 @@ public List<TOlapTableLocationParam> 
createDummyLocation(OlapTable table) throws
 
         final long fakeTabletId = 0;
         SystemInfoService clusterInfo = Env.getCurrentSystemInfo();
-        List<Long> aliveBe = clusterInfo.getAllBackendIds(true);
-        if (aliveBe.isEmpty()) {
+        List<Backend> currentClusterBackends;
+        if (Config.isCloudMode()) {
+            ConnectContext context = ConnectContext.get();
+            if (context == null) {
+                throw new UserException("connect context is null when creating 
dummy location");
+            }
+            currentClusterBackends = ((CloudSystemInfoService) clusterInfo)
+                    .getBackendsByClusterName(context.getCloudCluster());

Review Comment:
   [P1] Preserve auto-start before using the backend snapshot
   
   `getBackendsByClusterName()` does not run `waitForAutoStart()`. With 
`enable_nereids_distribute_planner=false`, `NereidsPlanner.doDistribute()` 
skips worker selection, and `InsertIntoTableCommand` reaches `finalizeSink()` 
under the table read lock before the legacy coordinator's later `prepare()` can 
wake the group. If the selected compute group is suspended, every cached BE 
fails `isLoadAvailable()`, so this now throws `no available BE in cluster` 
instead of auto-starting and running the insert. This is distinct from the 
earlier lock-wait issue: resolve/wake the group before taking the table lock, 
then use the resolved nonblocking snapshot here.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to