dataroaring commented on code in PR #51039:
URL: https://github.com/apache/doris/pull/51039#discussion_r2139493102


##########
fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java:
##########
@@ -972,48 +982,33 @@ public static void setPartitionKeys(TOlapTablePartition 
tPartition, PartitionIte
         }
     }
 
-    public List<TOlapTableLocationParam> createDummyLocation(OlapTable table) 
throws UserException {
-        TOlapTableLocationParam locationParam = new TOlapTableLocationParam();
-        TOlapTableLocationParam slaveLocationParam = new 
TOlapTableLocationParam();
-
+    public void createDummyLocation(OlapTable table, TOlapTableLocationParam 
locationParam) throws UserException {
         final long fakeTabletId = 0;
         SystemInfoService clusterInfo = Env.getCurrentSystemInfo();
         List<Long> aliveBe = clusterInfo.getAllBackendIds(true);
         if (aliveBe.isEmpty()) {
             throw new UserException(InternalErrorCode.REPLICA_FEW_ERR, "no 
available BE in cluster");
         }
+        // By planning a dummy tablet in each BE,
+        // one-step close wait is ensured that multiple senders have sent all 
the data.
         for (int i = 0; i < table.getIndexNumber(); i++) {
-            // only one fake tablet here
-            if (singleReplicaLoad) {
-                Long[] nodes = aliveBe.toArray(new Long[0]);
-                List<Long> slaveBe = aliveBe;
-
-                Random random = new SecureRandom();
-                int masterNode = random.nextInt(nodes.length);
-                locationParam.addToTablets(new TTabletLocation(fakeTabletId,
-                        Arrays.asList(nodes[masterNode])));
-
-                slaveBe.remove(masterNode);
-                slaveLocationParam.addToTablets(new 
TTabletLocation(fakeTabletId,
-                        slaveBe));
-            } else {
-                locationParam.addToTablets(new TTabletLocation(fakeTabletId,
-                        Arrays.asList(aliveBe.get(0)))); // just one fake 
location is enough
-
-                LOG.info("created dummy location tablet_id={}, be_id={}", 
fakeTabletId, aliveBe.get(0));
-            }
+            locationParam.addToTablets(new TTabletLocation(fakeTabletId, 
aliveBe));
+            LOG.info("created dummy location tablet_id={}, be_ids={}", 
fakeTabletId, aliveBe);

Review Comment:
   Maybe too many logs.



-- 
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