EmmyMiao87 commented on a change in pull request #1695: Refactor alter job
URL: https://github.com/apache/incubator-doris/pull/1695#discussion_r318420886
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/load/loadv2/BrokerLoadJob.java
 ##########
 @@ -355,16 +356,24 @@ private void createLoadingTask(Database db, 
BrokerPendingTaskAttachment attachme
 
                 // Generate loading task and init the plan of task
                 LoadLoadingTask task = new LoadLoadingTask(db, table, 
brokerDesc,
-                                                           entry.getValue(), 
getDeadlineMs(), execMemLimit,
-                                                           strictMode, 
transactionId, this);
+                        entry.getValue(), getDeadlineMs(), execMemLimit,
+                        strictMode, transactionId, this, timezone);
                 UUID uuid = UUID.randomUUID();
                 TUniqueId loadId = new 
TUniqueId(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
-                task.init(loadId, attachment.getFileStatusByTable(tableId),
-                          attachment.getFileNumByTable(tableId));
-                // Add tasks into list and pool
+                task.init(loadId, attachment.getFileStatusByTable(tableId), 
attachment.getFileNumByTable(tableId));
                 idToTasks.put(task.getSignature(), task);
                 loadStatistic.numLoadedRowsMap.put(loadId, new AtomicLong(0));
-                
Catalog.getCurrentCatalog().getLoadTaskScheduler().submit(task);
+
+                // save all related tables and rollups in transaction state
+                TransactionState txnState = 
Catalog.getCurrentGlobalTransactionMgr().getTransactionState(transactionId);
+                if (txnState == null) {
+                    throw new UserException("txn does not exist: " + 
transactionId);
+                }
+                txnState.addTableIndexes(table);
+            }
+            // submit all tasks together
+            for (LoadTask loadTask : idToTasks.values()) {
 
 Review comment:
   There are some finished task in `idToTasks` which should not be submitted.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to