yashmayya commented on code in PR #19448:
URL: https://github.com/apache/pinot/pull/19448#discussion_r4670059536


##########
pinot-common/pom.xml:
##########
@@ -32,6 +32,12 @@
   <properties>
     <pinot.root>${basedir}/..</pinot.root>
     <thrift.bin.path>/usr/local/bin/thrift</thrift.bin.path>
+    <!-- The -shaded jar is for projects outside Pinot and is not part of 
pinot-all, so it relocates its
+         libraries in every build mode, including thin-plugins, like the 
clients. See shade.jackson.prefix
+         in the root pom. The main jar is not shaded. -->
+    
<shade.jackson.prefix>${shade.prefix}.com.fasterxml.jackson</shade.jackson.prefix>
+    <shade.guava.prefix>${shade.prefix}.com.google.common</shade.guava.prefix>
+    <shade.scala.prefix>${shade.prefix}.org.scala-lang</shade.scala.prefix>

Review Comment:
   `pinot-spi` and `pinot-core` have the same kind of `-shaded` jar 
(`build-shaded-jar` profile, which the Docker build and README use). They do 
not pin these prefixes.
   
   I built `pinot-spi` both ways:
   - `-Pbuild-shaded-jar`: 1219 Jackson classes under 
`org/apache/pinot/shaded/`.
   - `-Pbuild-shaded-jar,thin-plugins`: 1219 plain `com/fasterxml/jackson` and 
1990 plain `com/google/common` classes.
   
   `pinot-common-shaded.jar` stays relocated in both. Can we pin the same three 
properties in `pinot-spi` and `pinot-core`, so that their `-shaded` jars do not 
change with the profile?



##########
pinot-plugins/pinot-stream-ingestion/pinot-kinesis/pom.xml:
##########
@@ -38,6 +38,11 @@
     <dependency>
       <groupId>org.apache.pinot</groupId>
       <artifactId>pinot-common</artifactId>
+      <!-- Pinot's own modules are always present where a plugin is loaded, 
from lib/pinot-all.jar or
+           the parent realm, so bundling them into the plugin would ship a 
second copy of them and of
+           their dependency tree - here fastutil, calcite-core and 
grpc-netty-shaded, none of which
+           this plugin uses directly -->
+      <scope>provided</scope>

Review Comment:
   **Default `pinot-all` now gets most Grizzly classes from 4.0.2, not 2.4.4**
   
   I diffed the default `-Pbin-dist` output of the base and this head, entry by 
entry (CRC). In `lib/pinot-all.jar`, 888 of 928 Grizzly classes now come from 
the Grizzly 4.0.2 copy inside `tyrus-standalone-client`. Before, 923 came from 
`grizzly-*-2.4.4`. The thin `pinot-all` has the same mix.
   
   Grizzly is the HTTP server under every REST API. So this silently swaps the 
server library, and 40 classes still come from 2.4.4.
   
   Cause: `pinot-tools` used to reach `pinot-common` (and Grizzly 2.4.4) first 
through `pinot-kinesis`. With this scope, it reaches it only through 
`pinot-java-client`, which comes after `tyrus-standalone-client`. Shade keeps 
the first copy.
   
   The same reorder also changes where `javax/servlet` (now `javax.servlet-api` 
4.0.1, was `jakarta.servlet-api` 4.0.4) and `org/jspecify` classes come from.
   
   My linkage scan finds no missing members, and the default quickstart passes. 
But a class-name comparison cannot see these swaps, so the "only differences" 
note in the description misses them.
   
   I tried a direct `pinot-common` dependency in `pinot-tools`. Grizzly comes 
back, but then the JAXB API classes change source (`jaxb-api` 2.3.1 to 
`jakarta.xml.bind-api` 2.3.3). An order-independent fix looks safer. For 
example, a shade filter that drops `org/glassfish/grizzly/**` from 
`org.glassfish.tyrus.bundles:tyrus-standalone-client`. The 5 Grizzly classes 
that only Tyrus has are not used by anything else in `pinot-all`.



##########
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchSparkDataIngestionJobCommand.java:
##########
@@ -213,6 +243,24 @@ public boolean execute()
     return true;
   }
 
+  /// Fails when the Pinot installation has the thin plugin layout (a 
`plugin-libs/` directory). The
+  /// Spark ingestion jar relocates Jackson and Guava, and links against the 
relocated copies in the
+  /// `pinot-all` jar of the default distribution. The thin `pinot-all` does 
not relocate them, so the
+  /// job fails with linkage errors on the executors. A remote base directory 
is not checked.
+  @VisibleForTesting
+  static void checkNotThinDistribution(String pinotBaseDir) {
+    URI uri = URI.create(pinotBaseDir);
+    if (uri.getScheme() != null && !uri.getScheme().equals("file")) {

Review Comment:
   This skips a remote base dir (`s3://`, `hdfs://`). The command supports 
those: `addAppResource` and `resolveDepsJars` read them through `PinotFS`. So a 
thin install copied to S3 is not refused. `resolveDepsJars` then ships its 
indexed jars, and the job fails on the executors with the linkage errors that 
this check is for.
   
   `resolveDepsJars` already lists every file. If it refuses when it sees a 
`plugin-libs/` jar or a `pinot-plugin.classpath`, the check covers local and 
remote dirs. Then the index code here, and most of its new tests, are not 
needed until thin Spark is supported.



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