You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/10/27 07:08:01 UTC

[GitHub] [pinot] siddharthteotia commented on a diff in pull request #9640: Support reloading consuming segment using force commit

siddharthteotia commented on code in PR #9640:
URL: https://github.com/apache/pinot/pull/9640#discussion_r1006479149


##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManager.java:
##########
@@ -373,16 +369,28 @@ private void reloadSegmentWithMetadata(String tableNameWithType, SegmentMetadata
 
     File indexDir = segmentMetadata.getIndexDir();
     if (indexDir == null) {
+      // Use force commit to reload consuming segment
       SegmentDataManager segmentDataManager = tableDataManager.acquireSegment(segmentName);
       if (segmentDataManager == null) {
+        LOGGER.warn("Failed to find segment data manager for table: {}, segment: {}, skipping reloading segment",
+            tableNameWithType, segmentName);
         return;
       }
       try {
-        if (reloadMutableSegment(tableNameWithType, segmentName, segmentDataManager, schema)) {
-          // A mutable segment has been found and reloaded.
-          segmentDataManager.setLoadTimeMs(System.currentTimeMillis());
+        if (!_instanceDataManagerConfig.shouldReloadConsumingSegment()) {
+          LOGGER.warn("Skip reloading consuming segment: {} in table: {} as configured", segmentName,
+              tableNameWithType);
           return;
         }
+        // TODO: Support force committing HLC consuming segment
+        if (!(segmentDataManager instanceof LLRealtimeSegmentDataManager)) {
+          LOGGER.warn("Cannot reload non-LLC consuming segment: {} in table: {}", segmentName, tableNameWithType);
+          return;
+        }
+        LOGGER.info("Reloading (force committing) LLC consuming segment: {} in table: {}", segmentName,
+            tableNameWithType);
+        ((LLRealtimeSegmentDataManager) segmentDataManager).forceCommit();

Review Comment:
   So forceCommit is async ?



##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManager.java:
##########
@@ -373,16 +369,28 @@ private void reloadSegmentWithMetadata(String tableNameWithType, SegmentMetadata
 
     File indexDir = segmentMetadata.getIndexDir();
     if (indexDir == null) {
+      // Use force commit to reload consuming segment
       SegmentDataManager segmentDataManager = tableDataManager.acquireSegment(segmentName);
       if (segmentDataManager == null) {
+        LOGGER.warn("Failed to find segment data manager for table: {}, segment: {}, skipping reloading segment",
+            tableNameWithType, segmentName);
         return;
       }
       try {
-        if (reloadMutableSegment(tableNameWithType, segmentName, segmentDataManager, schema)) {
-          // A mutable segment has been found and reloaded.
-          segmentDataManager.setLoadTimeMs(System.currentTimeMillis());
+        if (!_instanceDataManagerConfig.shouldReloadConsumingSegment()) {
+          LOGGER.warn("Skip reloading consuming segment: {} in table: {} as configured", segmentName,
+              tableNameWithType);
           return;
         }
+        // TODO: Support force committing HLC consuming segment
+        if (!(segmentDataManager instanceof LLRealtimeSegmentDataManager)) {
+          LOGGER.warn("Cannot reload non-LLC consuming segment: {} in table: {}", segmentName, tableNameWithType);
+          return;
+        }
+        LOGGER.info("Reloading (force committing) LLC consuming segment: {} in table: {}", segmentName,
+            tableNameWithType);
+        ((LLRealtimeSegmentDataManager) segmentDataManager).forceCommit();

Review Comment:
   So `forceCommit` is async ?



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org