morningman commented on a change in pull request #2781: Batch Operate Rollup 
table in Doris #2671
URL: https://github.com/apache/incubator-doris/pull/2781#discussion_r376708933
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/alter/RollupJobV2.java
 ##########
 @@ -614,33 +614,35 @@ private void replayPending(RollupJobV2 replayedJob) {
                 // table may be dropped before replaying this log. just return
                 return;
             }
-
-            // add all rollup replicas to tablet inverted index
-            TabletInvertedIndex invertedIndex = 
Catalog.getCurrentInvertedIndex();
-            for (Long partitionId : partitionIdToRollupIndex.keySet()) {
-                MaterializedIndex rollupIndex = 
partitionIdToRollupIndex.get(partitionId);
-                TStorageMedium medium = 
tbl.getPartitionInfo().getDataProperty(partitionId).getStorageMedium();
-                TabletMeta rollupTabletMeta = new TabletMeta(dbId, tableId, 
partitionId, rollupIndexId,
-                        rollupSchemaHash, medium);
-
-                for (Tablet rollupTablet : rollupIndex.getTablets()) {
-                    invertedIndex.addTablet(rollupTablet.getId(), 
rollupTabletMeta);
-                    for (Replica rollupReplica : rollupTablet.getReplicas()) {
-                        invertedIndex.addReplica(rollupTablet.getId(), 
rollupReplica);
-                    }
-                }
-            }
-            tbl.setState(OlapTableState.ROLLUP);
+            addTabletToInvertedIndex(tbl);
         } finally {
             db.writeUnlock();
         }
 
-        this.jobState = JobState.WAITING_TXN;
+        this.jobState = JobState.PENDING;
 
 Review comment:
   Add a comment here to explain why after replaying the pending job,
   the state is still PENDING:
   
   `to make sure that this job will run runPendingJob() again to create the 
rollup replicas`

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to