swaminathanmanish commented on code in PR #20291:
URL: https://github.com/apache/pinot/pull/20291#discussion_r4602274472


##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/TableMetadataReader.java:
##########
@@ -131,8 +136,23 @@ private TableReloadJsonResponse 
processSegmentMetadataReloadResponse(
   public JsonNode getSegmentsMetadata(String tableNameWithType, @Nullable 
List<String> columns,
       @Nullable List<String> segments, int timeoutMs)
       throws InvalidConfigException, IOException {
+    return getSegmentsMetadata(tableNameWithType, columns, segments, timeoutMs,
+        ControllerConf.DEFAULT_SEGMENT_METADATA_MAX_SEGMENT_COLUMNS);
+  }
+
+  /// Same as above, but rejects the request before calling any server when it 
would fetch more than
+  /// `maxSegmentColumns` (segment, column) entries, replicas included.
+  public JsonNode getSegmentsMetadata(String tableNameWithType, @Nullable 
List<String> columns,
+      @Nullable List<String> segments, int timeoutMs, int maxSegmentColumns)
+      throws InvalidConfigException, IOException {
     Map<String, List<String>> serverToSegs =
         _pinotHelixResourceManager.getServerToSegmentsMap(tableNameWithType);
+    long numEntries = countSegmentColumnEntries(serverToSegs, segments, 
getNumColumns(tableNameWithType, columns));

Review Comment:
   Can you include the number of segments and the number of columns as well as 
part of the error msg. 



##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -922,7 +923,8 @@ private JsonNode getSegmentsMetadataFromServer(String 
tableNameWithType, List<St
     TableMetadataReader tableMetadataReader =
         new TableMetadataReader(_executor, _connectionManager, 
_pinotHelixResourceManager);
     return tableMetadataReader.getSegmentsMetadata(tableNameWithType, columns, 
segments,
-        _controllerConf.getServerAdminRequestTimeoutSeconds() * 1000);
+        _controllerConf.getServerAdminRequestTimeoutSeconds() * 1000,
+        _controllerConf.getSegmentMetadataMaxSegmentColumns());

Review Comment:
   Can we make this query param instead of controller config which requires 
restart.  Would a hard upper cap in the worst case (5x or 10x the default) make 
sense. 
    
   



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