You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "zhtaoxiang (via GitHub)" <gi...@apache.org> on 2023/05/31 18:24:23 UTC

[GitHub] [pinot] zhtaoxiang commented on a diff in pull request #10812: Enhancing Table Size API to return table size per replica

zhtaoxiang commented on code in PR #10812:
URL: https://github.com/apache/pinot/pull/10812#discussion_r1212080683


##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/TableSizeReader.java:
##########
@@ -132,12 +144,19 @@ public TableSizeDetails getTableSizeDetails(@Nonnull String tableName, @Nonnegat
         }
       }
       if (largestSegmentSizeOnServer != DEFAULT_SIZE_WHEN_MISSING_OR_ERROR) {
-        _controllerMetrics.setValueOfTableGauge(offlineTableName,
-            ControllerGauge.LARGEST_SEGMENT_SIZE_ON_SERVER,
+        _controllerMetrics.setValueOfTableGauge(offlineTableName, ControllerGauge.LARGEST_SEGMENT_SIZE_ON_SERVER,
             largestSegmentSizeOnServer);
       }
     }
 
+    // Set the top level sizes to  DEFAULT_SIZE_WHEN_MISSING_OR_ERROR when all segments are error

Review Comment:
   could you please help me understand the reason for this decision?



##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/TableSizeReader.java:
##########
@@ -248,7 +279,7 @@ public TableSubTypeSizeDetails getTableSubtypeSize(String tableNameWithType, int
       String segment = entry.getKey();
       SegmentSizeDetails sizeDetails = entry.getValue();
       // Iterate over all segment size info, update reported size, track max segment size and number of errored servers
-      long segmentLevelMax = -1L;
+      long segmentLevelMax = DEFAULT_SIZE_WHEN_MISSING_OR_ERROR;

Review Comment:
   with `sizeDetails._maxReportedSizePerReplicaInBytes`, we do not need the variable `segmentLevelMax` any more.



##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/TableSizeReader.java:
##########
@@ -132,12 +144,19 @@ public TableSizeDetails getTableSizeDetails(@Nonnull String tableName, @Nonnegat
         }
       }
       if (largestSegmentSizeOnServer != DEFAULT_SIZE_WHEN_MISSING_OR_ERROR) {
-        _controllerMetrics.setValueOfTableGauge(offlineTableName,
-            ControllerGauge.LARGEST_SEGMENT_SIZE_ON_SERVER,
+        _controllerMetrics.setValueOfTableGauge(offlineTableName, ControllerGauge.LARGEST_SEGMENT_SIZE_ON_SERVER,
             largestSegmentSizeOnServer);
       }
     }
 
+    // Set the top level sizes to  DEFAULT_SIZE_WHEN_MISSING_OR_ERROR when all segments are error
+    if ((hasRealtimeTableConfig && hasOfflineTableConfig && isMissingAllRealtimeSegments && isMissingAllOfflineSegments)

Review Comment:
   1. we can remove "(hasRealtimeTableConfig && hasOfflineTableConfig && isMissingAllRealtimeSegments && isMissingAllOfflineSegments)" if we want to keep this logic
   2. could you please help me understand why we want to set the the top level sizes to DEFAULT_SIZE_WHEN_MISSING_OR_ERROR when either the offline or realtime table has problems? 



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