github-advanced-security[bot] commented on code in PR #19682:
URL: https://github.com/apache/druid/pull/19682#discussion_r3575187012


##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/PartialProjectionLoadRuleQueryTest.java:
##########
@@ -248,6 +255,43 @@
     );
   }
 
+  @Test
+  void testCoordinatorSeesPartialLoadFootprint()
+  {
+    // End-to-end check that PartialLoadedDataSegment reaches the 
coordinator's inventory accounting: the historical's
+    // announcement stamps realizedBytes (metadata + selected projection + 
__base dep) as loadedBytes, so
+    // sys.servers.curr_size for the historical reflects the partial footprint 
— strictly less than the segment's full
+    // size (which includes the unmatched projection's bytes). Without the 
fix, forAnnouncement would stamp
+    // segment.getSize() and curr_size would equal the full size.
+    final long fullSize = Long.parseLong(
+        cluster.callApi().runSql(
+            "SELECT \"size\" FROM sys.segments WHERE datasource = '" + 
dataSource + "'"
+        ).trim()
+    );

Review Comment:
   ## CodeQL / Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/11333)



##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/PartialProjectionLoadRuleQueryTest.java:
##########
@@ -248,6 +255,43 @@
     );
   }
 
+  @Test
+  void testCoordinatorSeesPartialLoadFootprint()
+  {
+    // End-to-end check that PartialLoadedDataSegment reaches the 
coordinator's inventory accounting: the historical's
+    // announcement stamps realizedBytes (metadata + selected projection + 
__base dep) as loadedBytes, so
+    // sys.servers.curr_size for the historical reflects the partial footprint 
— strictly less than the segment's full
+    // size (which includes the unmatched projection's bytes). Without the 
fix, forAnnouncement would stamp
+    // segment.getSize() and curr_size would equal the full size.
+    final long fullSize = Long.parseLong(
+        cluster.callApi().runSql(
+            "SELECT \"size\" FROM sys.segments WHERE datasource = '" + 
dataSource + "'"
+        ).trim()
+    );
+    Assertions.assertTrue(fullSize > 0, "sys.segments.size must be populated 
for the ingested segment");
+
+    final long currSize = Long.parseLong(
+        cluster.callApi().runSql(
+            "SELECT curr_size FROM sys.servers WHERE server_type = 
'historical'"
+        ).trim()
+    );

Review Comment:
   ## CodeQL / Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/11334)



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