adoroszlai opened a new pull request, #7324: URL: https://github.com/apache/ozone/pull/7324
## What changes were proposed in this pull request? Classpath files for Ozone components only include dependencies, but not the component's own jar file. Thus, Ozone needs to find it at runtime: https://github.com/apache/ozone/blob/2139367b52d68773f25d79abce0439323dde9671/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh#L2820-L2826 which causes error if multiple versions of the same component happen to be present in the `$HDDS_LIB_JARS_DIR` directory: ``` $ ls share/ozone/lib/ozone-manager* share/ozone/lib/ozone-manager-1.3.0.jar share/ozone/lib/ozone-manager-1.4.0.jar ``` ``` ozone-om-1 | ERROR: Component jar file /opt/hadoop/share/ozone/lib/ozone-manager-1.3.0.jar ozone-om-1 | /opt/hadoop/share/ozone/lib/ozone-manager-1.4.0.jar is missing from /opt/hadoop/share/ozone/lib ... ozone-om-1 | Error: Could not find or load main class org.apache.hadoop.ozone.om.OzoneManagerStarter ozone-om-1 | Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.ozone.om.OzoneManagerStarter ozone-om-1 exited with code 1 ``` This PR appends the main artifact jar to the classpath files at build time. Some commits are taken from #7190. https://issues.apache.org/jira/browse/HDDS-11588 ## How was this patch tested? Added duplicate jars and verified OM is functional: ``` $ cd hadoop-ozone/dist/target/ozone-2.0.0-SNAPSHOT $ ls -1 share/ozone/lib/ozone-manager* share/ozone/lib/ozone-manager-1.2.0.jar share/ozone/lib/ozone-manager-1.3.0.jar share/ozone/lib/ozone-manager-1.4.0.jar share/ozone/lib/ozone-manager-2.0.0-duplicate.jar share/ozone/lib/ozone-manager-2.0.0-SNAPSHOT.jar share/ozone/lib/ozone-manager-empty.jar $ cd compose/ozone $ OZONE_DATANODES=3 ./run.sh -d $ docker-compose exec -T scm ozone freon ockg -n1 -t1 ... 2024-10-17 04:13:40,879 [shutdown-hook-0] INFO freon.BaseFreonGenerator: Successful executions: 1 ``` Existing tests for regression: https://github.com/adoroszlai/ozone/actions/runs/11372007991 -- 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]
